rustc: 1.0.0 -> 1.1.0

@madjar @cstrahan @wizeman @globin

Looks good to me.
@telotortium Did you build it locally ? If not, I guess we could just send it to hydra.

Great! Could you update cargo too? Thanks a lot.

Looks good to me too.

@flosse I'm in the process of updating nightly rust, cargo and racerRust.

@flosse I've updated cargo locally too, as well as rustPlatform in order to build cargo. I have a couple more questions:

They've started to release cargo with SemVer-based version numbers (specifically, I've built 0.3.0, which builds with stable Rust 1.1.0). Should we switch over the non-snapshot build to use these numbers rather than dates?
I've switched rustCargoPlatform to use the stable rustc rather than the nightly rustcMaster. OK?
No new Cargo snapshot has been made in the rust-lang/cargo repo, so cargoSnapshot has not been updated and is even more out of date than before. Is there a way to hide the cargoSnapshot package from nix-env -qa, since it's only used to build cargo?

@telotortium

I think that should be fine, but IMO you should also change fetchgit's rev attribute (i.e., the src.rev attribute) in cargo's default.nix file to be "refs/tags/0.3.0".
Perfect
I don't know whether there is a better way to do this (it seems kind of hack), but if you change cargoSnapshot = callPackage... to something like cargoSnapshot = { cargo = callPackage... };, then nix-env won't see it (unless you'd also add a recurseIntoAttrs). In this case you'd then have to change cargoSnapshot references to cargoSnapshot.cargo.

Actually, I needed to update the Cargo snapshot to some later nightly (I used 2015-06-17) to avoid rust-lang/cargo#976.

@madjar I've installed rustc and cargo locally, but I'm going to use nix-build to test out the builds locally as well (since I just found out about that command).

What about racer pkg, wasn't it broken by update?

@jagajaga The current version of racer builds fine for me after the updates to rustc and cargo.

@wizeman Implemented your suggestions.

Instead of removing 1.0.0.nix and adding 1.1.0.nix, can you just name the file to stable.nix or possibly default.nix?
Furthermore, I didn't see that this was here, so I made a PR (#8701) myself that included various comments for how to update the rustc snapshot information. Can you perhaps merge those comments into your PR?

Patched the contents of #8701 into this PR (including adding @Havvy as a maintainer, let me know if you want me to remove that).

You can keep me as a maintainer. Now that I know how, it's not a major burden to do it.

When testing these commits locally I got a hash mismatch in cargo:
Failed: output path ‘/nix/store/l5rfbx2b1plrjljilpv8zfg8ix6wssfw-cargo’ should have r:sha256 hash ‘1y90d5zdlivsx67ac5k4zr5d4m6mirbhj76xp0fwd7k61rx0svws’, instead has ‘1ckb2xd7nm8357imw6b1ci2ar8grnihzan94kvmjrijq6sz8yv9i’

I remember a vague mention somewhere that leaveDotGit may cause problems.

Perhaps you're referring to #8567.
It could be because of that, but this type of problem is more likely to be because you didn't update the hash when you switched to using refs/tags/0.3.0 instead of the commit hash. Did you forget to do this, by any chance?
Note that you won't necessarily experience this error even if you forgot to update the hash, because Nix will reuse the output of the previous hash if you had already downloaded it. So it will work on your machine (because Nix had already fetched the contents that had the previous hash), but it won't work on others...

That could be it. How do you force Nix to do a rebuild?

Usually nix will not rebuild the same package unless the inputs have changed. Right now, on your machine, even though you changed the git revision, nix still thinks the inputs haven't changed because the input hash hasn't changed.
So what I do in this case is to change the last character of the hash (to a zero, for example), which makes Nix think that the input has changed. If you then tell Nix to build the package, Nix will rebuild it (because the hash changed), then it will complain about a wrong hash and tell you the correct one at the same time (like in the error message I showed above).
There is a more standard solution to rebuild a package, which involves running nix-store --delete /nix/store/<derivation-path> and then nix-build it. However, this is much harder to get right unless you're sure you know what you're doing, because nix will refuse to delete something when there are references to it somewhere in the nix store or in some profile, and also, you'd have to be sure you're deleting the right derivation. For example, in this case, the right derivation to rebuild wouldn't be the cargo package, it would be the src attribute of the cargo (i.e. the result of fetchgit)...
So I think the first suggestion I mentioned, although hackier, is easier to get right.

I pushed the change to the Cargo hash

Merged. Thanks!


cheveron ends, double cheverons, and stars

Adds:

md- and sm- cheveron ends (this PR replaces a a previous PR for these icons)
md- and sm- double cheverons (requested by #20).
md- and sm- stars (requested by #12)

Source file: https://www.figma.com/file/fjAkyElxifdf022WLL1ZqK/Heroicons-v0.1

Hey! Thank you so much for this but unfortunately we aren't accepting community contributions for actual icon designs — this is Steve's pet creative project and he'd like to design the icons himself. Hope that's understandable and thanks again ❤


Use configuration language

Consider about how to describe pipeline in configuration file more readable, efficiently.
ref. https://github.com/hashicorp/hcl

Hi @ainoya my apologies, I only just noticed this issue, I should have referenced this in my pull request, I'll add it now. See #127 which is a duplicate.

I close this for cleaning issues.


Slow performance when dragging slider

Describe the bug
When testing the widgets example and dragging the slider the update takes 20 ms in total which is quite slow. Also dragging the controller itself is very laggy.
To Reproduce
Steps to reproduce the behavior:

cargo run --release --examples widgets
Drag slider
Notice that the update is being slow.

Expected behavior
It's expected that the update is fast and doesn't take 20 ms on a fast PC
Desktop (please complete the following information):

OS: Ubuntu 18, Threadripper 32 cores, 3.2 Ghz CPU

Additional context
I added this temporary code inside orbclient/mod.rs
            let prev_time = Instant::now();
            for i in 0..self.window_shells.len() {
                let mut remove = false;
                if let Some(window_shell) = self.window_shells.get_mut(i) {
                    window_shell.update();
                    window_shell.render();

                    window_shell.update_clipboard();
                    window_shell.drain_events();
                    window_shell.receive_requests();

                    if !window_shell.is_open() {
                        remove = true;
                    }
                }

                if remove {
                    self.window_shells.remove(i);
                    break;
                }
            }

            self.receive_requests();

            let current_time = Instant::now();
            println!("duration {:#?}", current_time - prev_time);

Output (high numbers while dragging)
duration 11.602µs
duration 10.219µs
duration 12.534µs
duration 43.883µs
duration 25.39321ms
duration 19.554445ms
duration 20.057975ms
duration 20.025733ms
duration 19.956963ms
duration 20.024992ms
duration 20.132557ms
duration 20.805289ms
duration 20.308552ms
duration 20.084406ms
duration 19.612777ms
duration 20.152404ms
duration 20.388825ms
duration 19.576738ms
duration 19.993302ms
duration 19.52479ms

A quick profile indicates that over half of the time is spent inside malloc (!)

Hey, thank you for the your report. Which tool did you use. More performance will be also part of the next release. I hope we could also fix the issue with true slider. You info will help.

Thanks! I used perf as described here http://www.brendangregg.com/perf.html#TimedProfiling I didn't investigate in much detail tho

Thank you

I used cargo instrument a profiling tool for macOS. I looks like the most time is spent inside the compose method of raqote. I've created an issue there: https://github.com/jrmuizel/raqote/issues/159

Having the same issue on the web port.

On release mode with PR #324 it is a lot of faster. On debug it is a little bit faster.


DocuSignClient.InterceptRequest and DocuSignClient.InterceptResponse never invoked by EnvelopesApi [v. 6.5.0]

I'm in the process of updating my product's dependency on a v 5.x version of the SDK. I support the deprecation of RestSharp, but in the process it seems the SDK broke the InterceptRequest and InterceptResponse methods of DocuSignClient.
After making the changes required to migrate to v 6.x, those methods are never invoked. I've examined the decompiled code for the DocuSign SDK and they do not appear to be called by EnvelopesApi.

I looked through your source code and it looks like the calls to InterceptRequest and InterceptResponse are present but commented out with no explanation. Can these be restored?
https://github.com/docusign/docusign-esign-csharp-client/blob/f0ada4407b9a4d6e3942d0b753d981c1ea8893ca/sdk/src/DocuSign.eSign/Client/DocuSignClient.cs#LL244C41-L244C41

Greetings,
I appreciate your message to DocuSign Developer support.
We will investigate about this.

Hello, has there been any progress on this? It seems like it should be an easy change and it is blocking me from using the current version of your SDK.

Hello, our team is working on this, but we don't have an ETA yet.

@slif-cpr - I've just started on the new version of the SDK as well and wondering how are you using DocuSignClient ?
Do you use the CallApiAysnc method to make calls to DocuSign ?  Or, expose the DocuSignClient to other classes like EnvelopesApi ?
Which one is ideal based on your experience.

Hi @Sudharsan-Narayanasamy,
We are still using version 5.6.0 of the SDK. I believe DocuSignClient was introduced in a later version. We defined a subclass of ApiClient to override InterceptRequest and InterceptResponse, and then we always provide an instance of that client when initializing EnvelopesApi to make API calls. Let me know if that doesn't answer your question

Thank you @slif-cpr for quick response. It does answer my question and now I have few more :)
Do you use dependency injection for EnvelopesApi ?
InterceptRequest is where you add the token ?
Also, have you used RequestJWTApplicationToken ?

Hi @Sudharsan-Narayanasamy, sorry I have not had a chance to respond sooner.
When we instantiate EnvelopesApi, we pass in our custom subclass of ApiClient that overrides InterceptRequest and InterceptResponse, so yes, I suppose we're using dependency injection.
We are only using InterceptRequest and InterceptResponse for logging. We add the token to the default headers when we instantiate the ApiClient subclass.
We are using APIClient.RequestJWTUserToken - haven't checked how that differs from RequestJWTApplicationToken.

Our team has also faced this issue.
@InbarGazit Could you please take a look at it?

Hi @Sudharsan-Narayanasamy, does your team have any update on when this issue is expected to be resolved?

Hi @slif-cpr @ugrdtr2312, this issue should be resolved in version 6.6.0 of the NuGet package that was released today.

Closing due to fix


[Feature Request]  help me do an enhancement about  el-tree

Existing Component
Yes
Component Name
el-tree
Description
When l cancel all children node at one's parent , the parent will be cancel checked status.
I want to the parent  will be cancel checked status unless I clicked the checkbox only.
The parent  node can get checked status(not a indeterminate status)  whether children exist.
for example--> no children's parent will can be selected
--parent
|
|---parent   (checked)
|---  children (no checked)
|---  children (no checked)
|---  children (no checked)
|---parent

@Leopoldthecoder any particular reason why it won't be supported? This is actually a common case, the parent is also an entity so even though the parent is checked, its children may not be selected. We're using this component in our permissions page and we have the following structure:
- Access the data
   - Access additional x data
   - Access additional y data
   - Access additional y data


table: fix #22136

Please make sure these boxes are checked before submitting your PR, thank you!

[x] Make sure you follow Element's contributing guide (中文 | English | Español | Français).
[x] Make sure you are merging your commits to dev branch.
[x] Add some descriptions and refer relative issues for you PR.
fix #22136

@xinguanhua fixed the problem, please review it


GEOMESA-877 Move SFTBuilder to utils from accumulo

Moved SftBuilder to utils and made AccumuloSftBuilder, which extends SftBuilder, to get access to splitter information. Refactored classes using SftBuilder to import the correct class.
Signed-off-by: Jake Kenneally<EMAIL_ADDRESS>

type magic!

gonna look this over and try to get it merged today...anybody else have more comments?

046b6ec79361f07a2258de6e04bd742fd370d554


Update web agencies JSON

What's changed, or what was fixed?

Update web directory JSON

Fixes: Monthly update of /web/agencies data
Target Live Date: ASAP / 04-06-2018

[ ] This has been reviewed and approved by (NAME)
[x] I have run gulp test locally and all tests pass.
[x] I have added the appropriate type-something label.
[x] I've staged the site and manually verified that my content displays correctly.

CC: @petele

:+1:

:tada: This has been pushed live to https://developers.google.com/web/


fix woq example and update document for v1.19.0

Type of Change
feature or bug fix or documentation or validation or others
API changed or not
Description
detail description
Expected Behavior & Potential Risk
the expected behavior that triggered by this PR
How has this PR been tested?
how to reproduce the test (including hardware information)
Dependency Change?
any library dependency introduced or removed

it's a fix for accuracy, bf16 cannot get correct accuracy as below, no idea but bf16 is not necessary so remove it.
inc_gaudi_test #150 [Jenkins]

latest: https://inteltf-jenk.sh.intel.com/view/lpot-validation/job/inc_gaudi_test/153/

@XuehaoSun  please help trigger the test of opt_125m_woq_autoround_int4_hpu, not opt_125m_woq_autoround_int4 after removing environment variables and using requirement-autoround-hpu.txt in validation code.

@xin3he @XuehaoSun suggest testing the auto-round on the CPU as well.

cpu: https://inteltf-jenk.sh.intel.com/view/lpot-validation/job/intel-lpot-validation-top-mr-extension/5595/

Verify complete GPTQ test based on https://github.com/intel/neural-compressor/pull/2100
https://inteltf-jenk.sh.intel.com/job/inc_gaudi_test/156/

The CPU test failed @XuehaoSun, please help verify the validation machine environment issue.
This issue is not related to this PR and this PR didn't change CPU related logic. so we merge it first for release test.  @yiliu30

The CPU test failed @XuehaoSun, please help verify the validation machine environment issue.
This issue is not related to this PR and this PR didn't change CPU related logic. so we merge it first for release test. @yiliu30

@xin3he  It's fine with me. Please create a Jira to track it in case we miss it in the future.


Add OpenTelemetry configuration and instrumentation to replace AppInsights and prometheus-net

Description

Related Issue(s)

#586
#601
#587
#593

Verification

[ ] Your code builds clean without any errors or warnings
[ ] Manual testing done (required)
[ ] Relevant automated test added (if you find this hard, leave it and we'll help out)
[ ] All tests run green

Documentation

[ ] User documentation is updated with a separate linked PR in altinn-studio-docs. (if applicable)

Before merge:
remove TelemetryClient,
remove prometheus endpoint and metrics,
telemetry collector must exist and be connectde to Azure

Time to update already 😄  https://github.com/advisories/GHSA-vh2m-22xx-q94f

I think we should set the IncludeFormattedMessage flag to true, this "renders" the log message and includes the format as an attribute instead: https://github.com/open-telemetry/opentelemetry-dotnet/blob/57c442cc7b2fe93c81ca877de28f5204fdb11ebb/src/OpenTelemetry/Logs/ILogger/OpenTelemetryLogger.cs#L93
IncludeFormattedMessage = false:

IncludeFormattedMessage = true:

@martinothamar I added a snapshot test poc commit: https://github.com/Altinn/app-lib-dotnet/pull/589/commits/484d2b03856ce4f46aa7bb31bcf09cf771f63146. Some points I would like feedback on:

Does adding telemetry tests to already existing tests increase the complexity of the tests too much?
The verify is currently for activities as in this example there are no metrics, I was thinking in the case of both we do an additional verify call with CapturedMetrics

Awesome!
Maybe we should also write down specifically what is considered public contract. I am thinking

Trace names (DisplayName)
Tag names
Metric names
IdFormat - important for interoperability, for example App Insights SDK uses W3C

With that in mind we should probably have a custom serializer/model for the snapshot files.
How about a TelemetrySink.Verify function that does this (for both activities and metrics in one go)?

Does adding telemetry tests to already existing tests increase the complexity of the tests too much?

Maybe we should not add the useTelemetry = false case, and only test the instrumented path, since in v9 it will always be there? That would be a little less code. If TelemetrySink also wraps the verify stuff like suggested above then there wouldn't be too much code to add I think

The verify is for activities as in this example there are no metrics, I was thinking in the case of both we do an additional verify call with CapturedMetrics

If we just have a single TelemetrySink.Verify instance method that outputs 1 file with both activites and metrics, would that work?

In https://github.com/Altinn/app-lib-dotnet/pull/589/commits/0ba8f5abc4552fde56aa952afcfddf7dcf56f09a I

Removed AltinnAppBuilder and
Moved logging configuration into AddOpenTelemetry
Add APPLICATIONINSIGHTS_CONNECTION_STRING support: https://learn.microsoft.com/en-us/azure/azure-monitor/app/opentelemetry-configuration?tabs=aspnetcore

The end users can still configure OTel, just by using these DI hooks directly instead
void RegisterCustomAppServices(IServiceCollection services, IConfiguration config, IWebHostEnvironment env)
{
    services.ConfigureOpenTelemetryMeterProvider(builder => builder.AddConsoleExporter());
    services.ConfigureOpenTelemetryTracerProvider(builder => builder.AddConsoleExporter());
    services.Configure<OpenTelemetryLoggerOptions>(builder => builder.AddConsoleExporter());
    // In the future the logging API will become:
    // services.ConfigureOpenTelemetryLoggerProvider(builder => builder.AddConsoleExporter());
}

Delegates for these kinds of things are executed in order as expected. The way our template for Program.cs is setup, the users configuration will be applied before our own (AddAltinnAppServices). That is something to think about as some APIs on the builders may have us override something the user configured previously...
I think this is better than returning something from AddAltinnAppServices, both because that would make users change code below the Unless you are sure what you are doing do not change the following code marker in Program.cs, and it leaves us with fewer public APIs to think about (including the IOpenTelemetryBuilder that we were a bit worried about). What do you guys think?

I like a simpler and more limited interface without a custom builder (unless we really need it).

...as some APIs on the builders may have us override something the user configured previously

Currently we typically use the TryAdd* service registration methods, so that it doesn't override previously registered services, so we have kind of a solution for that problem.

I was referring to the APIs on the OTel builder, e.g. TraceProviderBuilder.SetSampler, which currently I think is the only "problematic" API we use. We set the sampler to AlwaysOnSampler when running in development environment which overrides whatever may be set in RegisterCustomAppServices. Code-based sampling takes precedence over sampling config from IConfiguration, so we could maybe set to always_on there, or leave it completely to SDK default/app config. So I guess a list of options would be

Don't configure the sampler in lib at all
Configure sampling through IConfiguration - in memory collection that is overridable from appsettings/env
Call AddOpenTelemetry earlier in the pipeline

Doc on existing sampling in App Insights SDK, adaptive sampling is default: https://learn.microsoft.com/en-us/azure/azure-monitor/app/sampling-classic-api
Defaul in OTel is ParentBasedSampler(AlwaysOnSampler). Reminder for my self: sync with platform team on current sampling in regards to cost. Ideally turning on the OTel feature doesn't increase Azure cost for service owners. Adaptive sampling isn't implemented in the Azure Monitor OTel distribution yet. IMO tail sampling in an agent like OTel collector should also be a good option

https://github.com/Altinn/app-lib-dotnet/pull/589/commits/ca80eb99d4412023ae8704b91e93d98135fe6b36 adds a GetSnapshot method to TelemetrySink. This makes adding telemetry testing to existing tests simpler.
SomeTest()
{
TelemetrySink sink = new();
...
var res = cut.MethodUnderTest(param_1, ..., param_n, sink);
...
Verify(sink.GetSnapshot());
}

ca80eb9 adds a GetSnapshot method to TelemetrySink. This makes adding telemetry testing to existing tests simpler.

Very nice! For future PR review when we might have a metric removed or added that affects many tests, I think it would be better if you printed them separated by newline so that we get a better git diff.
Can we assert the values for tags as well? instance.guid looks a little strange when it is actually expected to be some known value (as it is in most tests).

For future PR review when we might have a metric removed or added that affects many tests, I think it would be better if you printed them separated by newline so that we get a better git diff.

The Xunit.Verify library generates a diff file when verify is false. Here as an example I altered the expected snapshot to have one less metric and a different guid than the actual. What is then displayed is a nice diff:

Can we assert the values for tags as well? instance.guid looks a little strange when it is actually expected to be some known value (as it is in most tests).

Agreed

Nice to see the value! For instance creation tests we can't really hard code the value, so we need some way to ignore it, but not a requirement for this or.

Your screenshot is cropped so I can't really see if you removed one or more metrics to illustrate how the diff is displayed. If it is common to have more than 3 metrics, I think it makes sense to print them on separate lines to avoid horizontal scrolling.

Horizontal scrolling is a good point. I have updated the snapshot creation such that all inserts are on separate lines.

Nice to see the value! For instance creation tests we can't really hard code the value, so we need some way to ignore it, but not a requirement for this or.

Trying to create a return string for snapshot testing was a mistake. Using an object as input is the way to go, an it allows sending a settings object as input to the verify method, in which one can ignore values which are never the same. One caveat is that the library tries to be smart with guids. See commit https://github.com/Altinn/app-lib-dotnet/pull/589/commits/97b96ffe3d578f1de871c1a7335d2a1bc7c5af61 where this verified file has stripped the guid as opposed the the string "email" being included in this verify file

Trying to create a return string for snapshot testing was a mistake. Using an object as input is the way to go, an it allows sending a settings object as input to the verify method

I think we can do much better with custom settings like .GetSnapshot(ignoredTagValues: ["instance.guid"]), than a generic Verify library can do with settings. If we add this to many tests it is worth it to make the intention as clear as possible.

I think we can do much better with custom settings like .GetSnapshot(ignoredTagValues: ["instance.guid"]), than a generic Verify library can do with settings (the heuristic to just ignore Guid is not perfect to say the least). If we add this to many tests it is worth it to make the intention as clear as possible, without copying lots of boilerplate.

Verify.Xunit.Settings gives us this. I would advice against reinventing this solution.
The tradeoff is with guids as you point out, however the difference in value for our tests between a value being set to "Guid_1" and being set to "insert guid here" usually boils down to testing that when Guid.Parse("my_guid_to_parse") is done in a test it results in "my_guid_to_parse"

@ivarne since we've removed prometheus-net here, could you remove the subset of changes that affects? Is there any simplification to be made due to this?


Optimise "[...] * N" where N is a non-literal C integer value.

Closes https://github.com/cython/cython/issues/3922

Thanks Stefan! 😄


How are the init witness candidates been chosen in play.snapshot?

all delegates which has produced blocks will be chosen as witness candidate, except for those init** ones in genesis file.


Xamarin iOS Support

Hi guys,
I hope pull requests are welcome.
I have added the support for Xamarin.iOS including TLS1.2 using CFStream and NSStream. I have tested the stuff with iOS 8 and iOS 9 but it should also be able to run on some older versions.
Best regards,
Paul

Pull requests are definitely welcome. Thanks for the iOS support! I'll get it merged in right away.


Feature Request: Enable customization of timeline colors for sensors

History Explorer is an outstanding contribution to Home Assistant.  It is far superior to the History panel kludge that was released in the 2022.7 core update.
Here's an feature that I think would be very useful ---
I have a template sensor derived from a binary_sensor for our garage door:
 - platform: template
    sensors:
      garage_door_status:
        friendly_name: 'Garage Door Status'
        unique_id: "Garage Door Status"
        value_template: >-
          {% if is_state('binary_sensor.garage_door_tilt_sensor_access_control_window_door_is_open', "on") %}Open{% else %}Closed{% endif %}

It would be advantageous to enable the ability to change the default timeline bar colors for the template sensor for an entity.  In my case, when the garage_door_status sensor state is Closed, the timeline color is red, and when it is Open the color is purple.  This feature would enable the user to customize these colors.  I suggest something similar to the domain color features for switch.on / off and light.on / off that would be applied at the entity level.
stateColors:
  switch.off: silver
  switch.on: red
  ........
# FR: Would like to be able to do
#  sensor.garage_door_status.open: red
#  sensor.garage_door_status.closed: green

Screenshot of my current History Explorer panel is attached.

So basically being able to customize the state colors on a per-entity level ? Sounds like a reasonable suggestion and easy enough to implement.
As possible workarounds right now, you can either override these two states for the entire sensor domain or add a device_class statement to your template sensor, effectively putting it into a device class (like door) that you can then customize the state colors for.

@alexarch21 "So basically being able to customize the state colors on a per-entity level ?"
Yes, exactly.  That would be perfect.
I used your suggested workaround by modifying the templated garage_door_status sensor to a binary_sensor, adding the device_class (door) and setting the state colors in the card.  That works a treat, so thank for the suggestion.  It still would be nice to have the ability to override the state color(s) at the entity level so I hope you have time to add that to an upcoming release.
Thanks for your assistance here and for this great addition to HA.  IMHO it is so much better than the current History panel that it should become part of core.

So, a related nice improvement in History Explorer would be to allow the user to specify the default colors for timeline based on the entity's templated state (e.g., on/off, open/closed, dry/wet, lock/unlock, etc.).

This is exactly what the card does. What you're seeing in the timeline events is the actual sensor state. If it says 'Dry', then that means the sensor state is 'Dry', exactly as-is. There's no translation or reinterpretation going on. It's the raw sensor state value. The card will select a default color for every individual state, unless you override it. For your sensors, you will need to override the state names you see, because that's the sensor value (like for example sensor.Dry).
Things are different for binary_sensors, they will always be either on or off (or unknown).

Thanks for the clarification, your explanation helped me get'er done!
Although I read the documentation several times and looked through all the examples, I completely missed that you could override the state simply by using 'sensor.state: yellow' or whatever.  I was already overriding colors for light.on, switch.off etc. but didn't grok that this capability extended to the more specific case of sensor.Dry: green.  Silly me.  My apology for that.
Thanks again.

Maybe the documentation could be clearer on that too. There's always room for improvement.

If you would like, I'll take a shot at adding a few sentences for you to use here: https://github.com/alexarch21/history-explorer-card#customizing-state-colors

Thanks, I'll include your contribution on the next documentation update. I might reword it a little, since this doesn't exclusively apply to template sensors, but to basically any sensor that uses states other than on or off (MQTT, hvac, weather, etc).

Agree, it indeed would be helpful to clarify the broader use case in the documentation update.
I don't know if you'd like a separate feature request and if so I can create one , but here's another suggestion for improvement of the timeline graphs:

Provide the ability to set the timeline graph margins (similar to the "axisAddMargin" feature).
Provide the ability to change the timeline font and the label and graph height.

Neither of these is a particular priority but if either one is easy to implement it would be yet another feature that may be useful to others.  As always, comments / feedback is welcome.

Provide the ability to set the timeline graph margins (similar to the "axisAddMargin" feature

Can you elaborate what you mean by this ? The axisAddMargin features for line graphs change the margin of the visible data space on the Y axis. There is no Y axis on timelines, in fact the visualized data space is all horizontal (the vertical axis doesn't contain any information). So there's no margin on the Y axis so to speak, because there is no Y axis.

Provide the ability to change the timeline font and the label and graph height.

That would be opening a huge can of worms to be honest. Because once you introduce customization to that level, you'd have to add it everywhere in the card, or people will start complaining that the menu point of this dropmenu there should have the font configurable too... I'll rather keep that can closed for now :)

Good day!
The specific intent of this feature request was to enable the user to set the vertical spacing between timeline graphs.  Sometimes a picture is worth 1K words, so see the attached.  Personally I would like to be able to set the spacing to near zero, perhaps with the only visible area between the timelines a few pixels that might be tall enough for the gridline.
I understand your rationale regarding the timeline font/label/graph height, thanks for considering it anyway.

!

Ok, so it's the spacing between the timelines. I assume you already set the popup height to slim ?
The problem here is, as you noted, the tooltip popup. Since it's rendered into a canvas, the popup is going to be cut off if there's not enough vertical space. That's not much of an issue if you have 3 or more timelines in a graph, but it's an issue with one or two. If I force the space smaller with 3 bars, it could look like this:

Which would be approximately fine, even though the popup is already clipped a little. This would become much worse with only 1 or two lines. So the renderer will have to override the user provided spacing for less than 3 items. Otherwise things will break.

The real solution is to make the popup an html overlay. But that's a lot of work for relatively little return. Most people don't mind the extra spacing. I mean I could make it a 'use at your own risk' option, but then I'll get bug reports about the popup being only half visible when people put the spacing at 0 :)

"Use at your own risk" works for me.
Alternatively, maybe one option would be to combine the reduced timeline spacing option with a mandatory change to a horizontal layout for the tooltip.   Would that solve the 'cutoff' problem?

V1.0.24 now supports the customization for states of single entities. I also used your example to make the readme a little more explicit about the raw state values.
About the timeline size, that's another issue. The real way forward here is a html overlay.

This works perfectly!  Thank you so much.


[docs] unify the windows requirements

Description
This PR refactors the Calico for Windows requirements into a single page so that we fix drift in the Windows requirements (k8s versions not matching the main system requirements page, supported Windows versions differing depending on the page, etc.)
Preview:
https://deploy-preview-5622--calico-master.netlify.app/getting-started/windows-calico/quickstart
https://deploy-preview-5622--calico-master.netlify.app/getting-started/windows-calico/kubernetes/requirements

Related issues/PRs

Todos

[ ] Tests
[ ] Documentation
[ ] Release note

Release Note

None required

Love what you did for Quickstart! My only input is to add the geeky details to System Reqs page as well. So that section would look like this:
What’s supported in this release
✓ Install: Manifest install for Kubernetes clusters
✓ Platforms: Kubernetes, OpenShift, RKE, EKS, AKS
✓ Networking:

CNI options from under "Requirements"

Thanks @bmckercher123! I think I know what you're getting at but I'd like to get this set of changes in first.


docs: Update the Architecture Section in the zebra book to include zebra-rpc

Motivation

The "Architecture" section of the zebra book helps newcomers to Zebra to understand its different components. This has currently not been updated with details of zebra-rpc or zebra-node-services.
While we're making changes, the detailed descriptions of each crate's dependencies, responsibilities, and exported types are out of date.
We'd be better just linking to:

Cargo.toml for dependencies (or providing a cargo tree command)
the API reference for responsibilities and exported types, for example:

https://doc-internal.zebra.zfnd.org/zebra_network/index.html

@mpguerra the architecture section is also missing zebra-node-services. Did you want to add it at the same time?
While we're making changes, the detailed descriptions of each crate's dependencies, responsibilities, and exported types are out of date. We'd be better just linking to:

Cargo.toml for dependencies
the API reference for responsibilities and exported types, for example:

https://doc-internal.zebra.zfnd.org/zebra_network/index.html

@mpguerra the architecture section is also missing zebra-node-services. Did you want to add it at the same time?
While we're making changes, the detailed descriptions of each crate's dependencies, responsibilities, and exported types are out of date. We'd be better just linking to:

Cargo.toml for dependencies

the API reference for responsibilities and exported types, for example:

https://doc-internal.zebra.zfnd.org/zebra_network/index.html

I don't think that adding those 2 references is enough for a system design overview. When i see architecture i generally expect some sort of diagram and/or a short explication of each important piece, something like that. For sure not a link to cargo.toml or the api reference.

@mpguerra the architecture section is also missing zebra-node-services. Did you want to add it at the same time?
While we're making changes, the detailed descriptions of each crate's dependencies, responsibilities, and exported types are out of date. We'd be better just linking to:

Cargo.toml for dependencies

the API reference for responsibilities and exported types, for example:

https://doc-internal.zebra.zfnd.org/zebra_network/index.html

I don't think that adding those 2 references is enough for a system design overview. When i see architecture i generally expect some sort of diagram and/or a short explication of each important piece, something like that. For sure not a link to cargo.toml or the api reference.

We might want to link to the zebrad overviews in:

https://doc.zebra.zfnd.org/zebrad/index.html
https://doc-internal.zebra.zfnd.org/zebrad/commands/start/index.html

The start command tasks are an up-to-date overview of how the application actually works. But they don't describe what each crate does.
If we want a description of each crate, we could remove the incorrect bits from the existing descriptions, and just keep them short?

Unscheduling this for now


Copy of failure reports sent directly to the webmaster

When CSVProc or any rake task fails a copy should be sent to the webmaster

Deployed to test3


Unable to link with Express

I am trying to integrate this with Express, any idea or samples to how the integration should be like? The polling or webhook would interfere with the current port isn't it?

Could you suggest how you would expect the library to integrate with Express? Could you add elaborate code snippets to try explain to us?

I am thinking since telegram supports webhook, possibly using app.use, to map the webhook to setup the webhook for telegram. At the moment, for example, if we have an Express server to serve other endpoints, integrating telegram would be convenient than executing it as an external script.
Please advise.

can you write some code just to illustrate?

Sure.
For example,
telegram_webhook = require('./backend/routes/telegram/webhook'),
...
app.use('/webhook', telegram_webhook);
...
app.use(function (err, req, res, next) {
	res.status(err.status || 500);
});

const port = process.env.PORT || SERVER_PORT;
const http_server = require('http').createServer(app);
http_server.listen(port, function () {
	console.log(`${APP_NAME} running on port ${port}.`);
});

How can we run Telegram webhook within the webhook for instance?

You have to remember that the webhook receives all kinds of updates, for example, new messages, edited messages, callback queries, etc. So you might want to handle this in your Express middleware, probably by re-writing the route for subsequent middlewares.
If that is the case, this package might not be what you want. You will want to get more "low-level", so that you process the actual updates as they are received, rather than work with events.

You are right there! I also figured that I could work around that by just running as a new process.
Thanks! I'll close this thread.

I think it would be cool having the possibility to inject the Express router, even using it.

Yes, it would be cool. In fact, it would pretty helpful especially since we have a webhook feature, everything sits nicely in the architecture.


Datascience with python : Vision Transformers

Description 📜
In this, I have clearly explained the Vision transformer algorithm with the necessary pre-requisites.
Outline of the video

Working of transformers
Transformers in vision
ViT paper explanation
Coding the architecture

Issue : #5529

Type of change 📝

[X] Video (Animations, screen-recordings, presentations and regular explanatory films are all possibilties etc)

Domain of Contribution 📊

[X] Data Science with Python

Checklist ✅

[X] I follow Contributing Guidelines & Code of conduct of this project.
[X] I have performed a self-review of my own code or work.
[X] My changes generates no new warnings.
[X] I'm GWOC'21 contributor

Link to the video! ⬇

May I know, where can I find project structure.
And can you please be more specific about what's not sufficient?!

@DhruvBajaj01 I have deleted those commits and created new ones and raised another PR.
https://github.com/girlscript/winter-of-contributing/pull/6205


Storage schema improvement

Now
SELECT
    table,
    partition,
    column,
    formatReadableSize(size) AS size,
    rows,
    days,
    formatReadableSize(avgDaySize) AS avgDaySize
FROM
(
    SELECT
        table,
        partition,
        column,
        sum(column_bytes_on_disk) AS size,
        sum(rows) AS rows,
        min(min_date) AS min_date,
        max(max_date) AS max_date,
        max_date - min_date AS days,
        size / (max_date - min_date) AS avgDaySize
    FROM system.parts_columns
    WHERE active
    GROUP BY
        table,
        partition,
        column
    ORDER BY rows DESC
)

┌─table───────────────────┬─partition─┬─column───────────────┬─size───────┬─────────rows─┬─days─┬─avgDaySize─┐
│ graphite_reverse        │ 201808    │ Path                 │ 105.61 GiB │<PHONE_NUMBER>90 │   30 │ 3.52 GiB   │
│ graphite_reverse        │ 201808    │ Date                 │ 1.92 GiB   │<PHONE_NUMBER>90 │   30 │ 65.54 MiB  │
│ graphite_reverse        │ 201808    │ Timestamp            │ 515.08 GiB │<PHONE_NUMBER>90 │   30 │ 17.17 GiB  │
│ graphite_reverse        │ 201808    │ Time                 │ 553.24 GiB │<PHONE_NUMBER>90 │   30 │ 18.44 GiB  │
│ graphite_reverse        │ 201808    │ Value                │ 140.33 GiB │<PHONE_NUMBER>90 │   30 │ 4.68 GiB   │
│ graphite_tagged         │ 201808    │ Date                 │ 406.78 MiB │    644830350 │   30 │ 13.56 MiB  │
│ graphite_tagged         │ 201808    │ Path                 │ 4.02 GiB   │    644830350 │   30 │ 137.09 MiB │
│ graphite_tagged         │ 201808    │ Version              │ 1.62 GiB   │    644830350 │   30 │ 55.35 MiB  │
│ graphite_tagged         │ 201808    │ Deleted              │ 12.35 MiB  │    644830350 │   30 │ 421.51 KiB │
│ graphite_tagged         │ 201808    │ Tags                 │ 13.28 GiB  │    644830350 │   30 │ 453.18 MiB │
│ graphite_tagged         │ 201808    │ Tag1                 │ 110.11 MiB │    644830350 │   30 │ 3.67 MiB   │
│ graphite_series_reverse │ 201808    │ Deleted              │ 327.00 B   │        12211 │   30 │ 10.90 B    │
│ graphite_series_reverse │ 201808    │ Date                 │ 476.00 B   │        12211 │   30 │ 15.87 B    │
│ graphite_series_reverse │ 201808    │ Path                 │ 18.46 KiB  │        12211 │   30 │ 630.07 B   │
│ graphite_series_reverse │ 201808    │ Level                │ 494.00 B   │        12211 │   30 │ 16.47 B    │
│ graphite_series_reverse │ 201808    │ Version              │ 1.01 KiB   │        12211 │   30 │ 34.57 B    │
│ graphite_tree           │ 201611    │ Deleted              │ 53.00 B    │          478 │    0 │ inf YiB    │
│ graphite_tree           │ 201611    │ Level                │ 88.00 B    │          478 │    0 │ inf YiB    │
│ graphite_tree           │ 201611    │ Path                 │ 6.65 KiB   │          478 │    0 │ inf YiB    │
│ graphite_tree           │ 201611    │ Version              │ 381.00 B   │          478 │    0 │ inf YiB    │
│ graphite_tree           │ 201611    │ Date                 │ 56.00 B    │          478 │    0 │ inf YiB    │

Time + Timestamp columns  in graphite_reverse table 1 Tb, while Path + Value is 240 Gb
Questions:

It's possible to remove Timestamp column?
Timestamp used in graphite-clickhouse AS SELECT Path, Time, Value, Timestamp FROM graphite_reverse but filter AND (Time >=<PHONE_NUMBER> AND Time <=<PHONE_NUMBER>))
May be split Path column to:
Metric
Tags
This change will make  easier to share, analyse and aggregate data

For me remove Timestamp save 3 Tb of disk space on clickhouse cluster.
Can I create PR with new uploader type?

It's possible to remove Timestamp column?
Timestamp is used only for select last value for several points with equal time. Making this field optional is hard, but you can try writing a zero value to it.

May be split Path column to: Metric, Tags.
This is incompatible with GraphiteMergeTree engine. You can use url functions like extractURLParameter for work with current Path encoding.

Can I create PR with new uploader type?
Maybe it's better to add option zero-timestamp topoints and points-reverse uploaders

Timestamp is used only for select last value for several points with equal time.

Could you explain this a little bit better?


Negative base armor value

So i have downloaded apotheosis and noticed that after sometime when i take damage (i think ) my base armor value goes negative. Also all armor stats are wierd too - they can go negative or lower number. The only fix i found is dying.

what mods are you using?

Well... Better question is what mod i m not using lmao. 350 mods is quite a lot. There are few mods that i suspect could cause this:

Sintraya connector (i dont think its causing it, never had problems with it but will write about it otherwise)

Born in chaos (Almost everytime i fought with mobs from this mod and took hefty amount of damage resulted in this wierd armor value)

I forgot to add this is 1.20.1 forge

I m also using AttributeFix and tried deleting config file after installing apotheosis

Well... Better question is what mod i m not using lmao. 350 mods is quite a lot. There are few mods that i suspect could cause this:
* Sintraya connector (i dont think its causing it, never had problems with it but will write about it otherwise)

* Born in chaos (Almost everytime i fought with mobs from this mod and took hefty amount of damage resulted in this wierd armor value)

I forgot to add this is 1.20.1 forge

Are you getting negative armour values fighting other mobs? if not disable born in chaos and see if that fixes it

The problem is that its very hard for me to get this again. I think it might be this lifestealer mob because i fought him twice and i got these values  after fighting him. I ll try again later tho

Nothing in apoth modifies the base values of attributes, whatever is fiddling with your base values is something external.


WalletConnect SwitchETHNetwork error

The Add network is working fine but the switch is firing an error after completion (still goes through but fires an error anyway :

This is the data that i send him :

fixed it by sending EthChain instead of EthChainData


UI. Gradle project. Test sources root can be located anywhere

Description
In Gradle projects test sources root can be located anywhere. Need to add this possibility for a user.
Expected behavior
In Gradle project Test sources root can be located anywhere, it can be configured in build.gradle file.
So we'll need to be able to generate tests to a directory located outside src.

Environment
Checked on IDEA Ultimate 2022.1.3
Gradle 6.3, 7.4
Potential alternatives
Current behavior forbids destination folder outside /src/test
Context
For example: https://github.com/volivan239/virt-mem-personal/blob/main/build.gradle
Now integrationTest directory can't be selected as destination folder:

@Vassiliy-Kudryashov Please have a look at the referenced project:
https://github.com/volivan239/virt-mem-personal
There is a source root in the root - and it is not found by UTBot


Update to Camunda 8.5 #16

Resolves #16

Build fails?

@zambrovski it uses a snapshot of the api, we need to release it first.


Dev

Dana / Scott --
I have the first pass at AMA documentation and a few questions for you in the doc in bold.
Hope this looks decent.  Given the number of reports and aliases, this was the best way I could think to do it and based on the MA documentation it looked like it was OK to do so.
Thanks as always!
Matt

This is good stuff.  I'd like to get it merged soonish, but don't really want to overwrite the existing autosens and meal-assist documentation for people who don't want to go all the way to AMA just yet.  Perhaps we should make this a new page, called "Configuring Advanced Meal Assist" or similar, to make clear that it is a separate and optional thing for now?
I'd also like to get away from telling people to paste in .ini contents.  (That's better than nothing, but after merging would want to update that part to use openaps commands to add each section, if you don't beat me to it.)

Looking good @logichammer! Ditto the opinion of @scottleibrand ..I'm thinking 3 separate pages: Configuring Meal Assist; Configuring Advanced Meal Assist; and Configuring Automatic Sensitivity Mode (all under phase 6 section).
A few minor edits in here that I'd add, but I'll do that after we get this to the right page structure and merged :) Thanks!

Closing this in favor of wip/ama-docs

Very glad to see it over there!!!!


Fix typo

The word "further" was misspelled in the string "To futher configure Debug and Run"
There is no issue associated to this fix.

Thanks @mattogodoy!


Display full path instead of just the last part segment

Given a .har with content queries such as
{
    "name": ":method",
    "value": "GET"
},
{
    "name": ":path",
    "value": "/api/someresource/1234"
}

Right now the plugin just display
GET 1234
This doesn't really give me enough context to work with, instead it would be way more useful if the full path value was written out
GET /api/someresource/1234
If you prefer the first view perhaps this could be behind a config value?
I'd think most people would prefer the second view though.

I like this idea of making it configurable. Let me add it to the backlog.

@laurencee 0.0.2 version is published it has the capability you were looking for, thanks for your suggestion.


Definition of Array , Structure and String

When I am defining String , It's gives an error " not found in scope".I also want to know how can we define dynamic array and structure in ink.

did you use https://paritytech.github.io/ink/ink_prelude/string/struct.String.html for String? Its on prelude.
By Dynamic Array you probably mean Vec which is allowed.

@wheresaddie  Close the issue?


Investigate why some endpoints don't require authentication

Apparently GET for devices endpoint doesn't require auth event though I thought I configured all endpoints to require it. It might be related to CSRF tokens only being necessary for certain types of requests by default (POST and DELETE for example). Ideally everything should be authenticated since users shouldn't be able to see other users' devices etc.

This is also causing the server to error when making a GET request while not logged in.
comp490-db-1   | 2022-03-03 17:26:52.544 UTC [1455] ERROR:  relation "api_device" does not exist at character 105
comp490-db-1   | 2022-03-03 17:26:52.544 UTC [1455] STATEMENT:  SELECT "api_device"."id", "api_device"."name", "api_device"."description", "api_device"."owner_id" FROM "api_device" LIMIT 21
comp490-db-1   | 2022-03-03 17:26:52.546 UTC [1455] ERROR:  relation "api_device" does not exist at character 105
comp490-db-1   | 2022-03-03 17:26:52.546 UTC [1455] STATEMENT:  SELECT "api_device"."id", "api_device"."name", "api_device"."description", "api_device"."owner_id" FROM "api_device" LIMIT 21
comp490-db-1   | 2022-03-03 17:26:52.549 UTC [1455] ERROR:  relation "api_device" does not exist at character 105
comp490-db-1   | 2022-03-03 17:26:52.549 UTC [1455] STATEMENT:  SELECT "api_device"."id", "api_device"."name", "api_device"."description", "api_device"."owner_id" FROM "api_device" LIMIT 21
comp490-db-1   | 2022-03-03 17:26:52.552 UTC [1455] ERROR:  relation "api_device" does not exist at character 105
comp490-db-1   | 2022-03-03 17:26:52.552 UTC [1455] STATEMENT:  SELECT "api_device"."id", "api_device"."name", "api_device"."description", "api_device"."owner_id" FROM "api_device" LIMIT 21
comp490-web-1  | Internal Server Error: /api/devices/
comp490-web-1  | Traceback (most recent call last):
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/fields/__init__.py", line 1823, in get_prep_value
comp490-web-1  |     return int(value)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/contrib/auth/models.py", line 420, in __int__
comp490-web-1  |     raise TypeError('Cannot cast AnonymousUser to int. Are you trying to use it in place of User?')
comp490-web-1  | TypeError: Cannot cast AnonymousUser to int. Are you trying to use it in place of User?
comp490-web-1  |
comp490-web-1  | The above exception was the direct cause of the following exception:
comp490-web-1  |
comp490-web-1  | Traceback (most recent call last):
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/exception.py", line 47, in inner
comp490-web-1  |     response = get_response(request)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/core/handlers/base.py", line 181, in _get_response
comp490-web-1  |     response = wrapped_callback(request, *callback_args, **callback_kwargs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
comp490-web-1  |     return view_func(*args, **kwargs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/rest_framework/viewsets.py", line 125, in view
comp490-web-1  |     return self.dispatch(request, *args, **kwargs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 509, in dispatch
comp490-web-1  |     response = self.handle_exception(exc)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 469, in handle_exception
comp490-web-1  |     self.raise_uncaught_exception(exc)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
comp490-web-1  |     raise exc
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/rest_framework/views.py", line 506, in dispatch
comp490-web-1  |     response = handler(request, *args, **kwargs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/rest_framework/mixins.py", line 38, in list
comp490-web-1  |     queryset = self.filter_queryset(self.get_queryset())
comp490-web-1  |   File "/web/web/api/viewsets/device.py", line 11, in get_queryset
comp490-web-1  |     return Device.objects.filter(owner=self.request.user)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/manager.py", line 85, in manager_method
comp490-web-1  |     return getattr(self.get_queryset(), name)(*args, **kwargs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 941, in filter
comp490-web-1  |     return self._filter_or_exclude(False, args, kwargs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 961, in _filter_or_exclude
comp490-web-1  |     clone._filter_or_exclude_inplace(negate, args, kwargs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/query.py", line 968, in _filter_or_exclude_inplace
comp490-web-1  |     self._query.add_q(Q(*args, **kwargs))
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/query.py", line 1393, in add_q
comp490-web-1  |     clause, _ = self._add_q(q_object, self.used_aliases)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/query.py", line 1412, in _add_q
comp490-web-1  |     child_clause, needed_inner = self.build_filter(
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/query.py", line 1347, in build_filter
comp490-web-1  |     condition = self.build_lookup(lookups, col, value)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/sql/query.py", line 1193, in build_lookup
comp490-web-1  |     lookup = lookup_class(lhs, rhs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/lookups.py", line 25, in __init__
comp490-web-1  |     self.rhs = self.get_prep_lookup()
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/fields/related_lookups.py", line 117, in get_prep_lookup
comp490-web-1  |     self.rhs = target_field.get_prep_value(self.rhs)
comp490-web-1  |   File "/usr/local/lib/python3.9/site-packages/django/db/models/fields/__init__.py", line 1825, in get_prep_value
comp490-web-1  |     raise e.__class__(
comp490-web-1  | TypeError: Field 'id' expected a number but got <django.contrib.auth.models.AnonymousUser object at 0x7f085c4f7f10>.

GET /api/devices while not logged in also causes this server error
Internal Server Error: /api/devices/
Traceback (most recent call last):
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/fields/__init__.py", line 1823, in get_prep_value
    return int(value)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/contrib/auth/models.py", line 420, in __int__
    raise TypeError('Cannot cast AnonymousUser to int. Are you trying to use it in place of User?')
TypeError: Cannot cast AnonymousUser to int. Are you trying to use it in place of User?

The above exception was the direct cause of the following exception:

Traceback (most recent call last):
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/core/handlers/exception.py", line 47, in inner
    response = get_response(request)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/core/handlers/base.py", line 181, in _get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/views/decorators/csrf.py", line 54, in wrapped_view
    return view_func(*args, **kwargs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/rest_framework/viewsets.py", line 125, in view
    return self.dispatch(request, *args, **kwargs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 509, in dispatch
    response = self.handle_exception(exc)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 469, in handle_exception
    self.raise_uncaught_exception(exc)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 480, in raise_uncaught_exception
    raise exc
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/rest_framework/views.py", line 506, in dispatch
    response = handler(request, *args, **kwargs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/rest_framework/mixins.py", line 38, in list
    queryset = self.filter_queryset(self.get_queryset())
  File "/home/mark/repos/python/comp490/web/api/viewsets/device.py", line 11, in get_queryset
    return Device.objects.filter(owner=self.request.user)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/manager.py", line 85, in manager_method
    return getattr(self.get_queryset(), name)(*args, **kwargs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/query.py", line 941, in filter
    return self._filter_or_exclude(False, args, kwargs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/query.py", line 961, in _filter_or_exclude
    clone._filter_or_exclude_inplace(negate, args, kwargs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/query.py", line 968, in _filter_or_exclude_inplace
    self._query.add_q(Q(*args, **kwargs))
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1393, in add_q
    clause, _ = self._add_q(q_object, self.used_aliases)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1412, in _add_q
    child_clause, needed_inner = self.build_filter(
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1347, in build_filter
    condition = self.build_lookup(lookups, col, value)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/sql/query.py", line 1193, in build_lookup
    lookup = lookup_class(lhs, rhs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/lookups.py", line 25, in __init__
    self.rhs = self.get_prep_lookup()
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/fields/related_lookups.py", line 117, in get_prep_lookup
    self.rhs = target_field.get_prep_value(self.rhs)
  File "/home/mark/repos/python/comp490/.venv/lib/python3.10/site-packages/django/db/models/fields/__init__.py", line 1825, in get_prep_value
    raise e.__class__(
TypeError: Field 'id' expected a number but got <django.contrib.auth.models.AnonymousUser object at 0x7f8aa39428f0>.


predefined options for ajax select2

Hello, I have next html
<select class="change_item_dropdown_ajax form-control" id="item_id" name="item_id" onchange="updateData(this, this.value, 16)" >
<optgroup label="System Data">
  <option value="17">Test</option>
  <option selected="selected" value="18">System</option>
</optgroup>
</select>

    $(".change_item_dropdown_ajax").select2({
        ajax: {
            url: "get_user_items",
            dataType: 'json',
            delay: 250,
            theme: "classic",
            data: function (params) {
                return {
                    q: { name_contains: params.term } // search term
                };
            },
            processResults: function (data) {
                return {
                    results: data
                };
            },
            cache: true
        },
        allowClear: true,
        placeholder: '--- Please select item ---',
        minimumInputLength: 1
    });

I want to make possibility for customer to see some default system options with items <optgroup label="System Data">, but also add ability to make search ajax queries by his own items.
However after binding select2 it doesn't show <optgroup label="System Data">...</optgroup> ,
select2 options are empty and it only displays hint "Please enter 1 or more characters".
It's not even clear if it is possible to do, thanks
SO Question http://stackoverflow.com/questions/33080739/select2-default-options-with-ajax

#684 , is quite similar but for older version

+1
My use case:  the select initially lists "recently viewed" items - the user should be able to select from these items without searching (this will be about 50% of cases).  If the desired item is not in this "recently viewed" list of options, the user starts typing a search term to trigger the AJAX call and load the search results.
However, as soon as I add the ajax option to select2, the initial data options provided in the underlying select widget are no longer displayed.

Just noticed:  the initial / default list of options are also not displayed when you explicitly specify minimumInputLength (even if the ajax option is not specified).

I created custom adapter extended from AjaxAdapter with defaultResults option, which will be used instead of ajax call results, if query length shorter than minimumInputLength.
Here it is: https://gist.github.com/govorov/3ee75f54170735153349b0a430581195
Hope it will help you.
@kevin-brown What about to incude this feature into basic AjaxAdapter?

@govorov Could you provide an example of how to use your adapter?

I have a custom widget based on Select2, that allows user to select city (Russian and Ukraine in my case, so I'm sorry for only russian screenshots in advance, but hope it's still clear what's going on on them). Here is the gist with comments (coffeescript): https://gist.github.com/govorov/274a8aac5fb910472ff1d0022f32f53e
And some screenshots:
Default top-population cities, when there is no input:

Response result, when input is provided:

+1  Being able to display an initial default list rendered from unselected <options> would be very nice functionality to have.

+1

It also strange as documentation states that you can provide default selections with ajax by putting actual options in the select:

If you need to provide default selections, you just need to include an option for each selection that contains the value and text that should be displayed.

+1

+1

May I know the status of this issue or if there's already a plan where in the roadmap this issue will be addressed?

I would also be interested on a native solution for this. As pointed out above, the docs suggest that initial values can be set with native HTML options, and that results untrue in case you use an AJAX data provider.

+1

👍

I'm interested in solution as well

+1

@kevin-brown what about the issue? It is open more than a year :)

+1

+1

So, this was closed... was it implemented? Any resolution at all? What?

I've heard selectize can do this properly.

+1

+1

hello?

+1

+1

+1

It works. Documentation:

If you need to provide default selections, you just need to include an option for each selection that contains the value and text that should be displayed.

This is important: selected="selected" for each option you want to preload.
Here is my working code:
HTML:
<select class="form-control select2-multiple" style="width: 100%;" name="test[]" multiple="multiple">
    <option value="1" selected="selected">Option 1</option>
    <option value="2" selected="selected">Option 2</option>
</select>

JS:
$input.select2({'theme':'bootstrap','ajax':{ .... });

Result:

@merik Thank you for your effort, but in this issue, a method to prefill options before the first ajax call is searched.

@fsteinbauer this is now documented in https://select2.org/programmatic-control/add-select-clear-items#preselecting-options-in-an-remotely-sourced-ajax-select2

That does not address the intial issue, which is to allow a list of selected AND un-selected options the user can select from before using the AJAX search to find their selection.

Alright, well, the original issue did not make that very clear.  This issue comes across as a "fix mah codez" type of issue, rather than a formal feature request or bug fix with a minimal, complete, and verifiable example.
So you're saying that this issue boils down to the ability to have preselected options?  I believe there are several issues/PRs specifically about this already.

That's fine, and maybe I was just seeing that in the initial issue because that's what I was trying to accomplish. Could you reference them or point me to the other issues requesting this sort of thing?

allow a list of selected AND un-selected options the user can select from before using the AJAX search to find their selection.

I'm doing exactly this in my own application that uses Select2, without any problems and as described in the documentation.  I populate the selected options initially in my server-rendered DOM:
<select name="institutions[]" class="form-control select2" type="text" multiple="multiple" data-placeholder="Please select an institution">
{% for institution in student.institutions %}
    <option value="{{institution.id}}" selected>{{institution.slug}}</option>
{% endfor %}
</select>

and then initialize Select2 on this control, with an AJAX data source:
// Institution select
form.find("select[name='institutions[]']").select2({
    ajax: {
        url: site.uri.public + "/api/institutions",
        dataType: "json",
        delay: 250,
        data: function (params) {
            return {
                filters: {
                    name : params.term
                },
                page: params.page || 0,
                size: params.size || 10
            };
        },
        processResults: function (data, params) {
            var suggestions = [];
            // Process the data into dropdown options
            if (data && data.rows) {
                jQuery.each(data.rows, function(idx, row) {
                    row.text = row.slug;
                    suggestions.push(row);
                });
            }

            params.page = params.page || 0;
            params.size = params.size || 10;

            return {
                results: suggestions,
                pagination: {
                    more: (params.page * params.size) < data.count_filtered
                }
            };
        }
    },
    width: '100%',
    templateResult: function(item) {
        // Display institution name as tag option
        return $("
" + item.name + "
");
    },
    cache: true
});

Is this the same as your use case?  If so, could you please post your code to the forums, and we can discuss it there?

Disclaimer: This is the functionality that I am asking for, I am unable to confirm if this is what the original issue is specifically asking for.

        Book *
        <select id="book" class="select2-books form-control" name="book" required>
            <optionx></option>
            <option value="1">Recent Book #1</option>
            <option value="2">Recent Book #2</option>
            <option value="3">Recent Book #3</option>
            <option value="4">Recent Book #4</option>
        </select>

$(".select2-books").select2({
    ajax: {
        url: public_url + "/api/book/search",
        dataType: 'json',
        delay: 250,
        data: function(params) {
            return {
                q: params.term,
                page: params.page
            };
        },
        processResults: function(data, params) {
            params.page = params.page || 1;
            return {
                results: data.items,
                pagination: {
                    more: (params.page * 30) < data.total_count
                }
            };
        },
        cache: true
    },
    escapeMarkup: function(markup) {
        return markup;
    },
    minimumInputLength: 3,
    placeholder: 'Select a Book...',
    instructions: 'To find a book, search the Book\'s Title, ISBN, or Authors',
});

Result
Recent Book #1 is preselected (even though there is a blank option first that should be selected by default)

Preset options to not display when element is selected

Desired
When selected the preset options are displayed first. These would be what we expect the user will select, followed by a search box in case we didnt provide the correct preset options. (I messed up the image below in Photoshop, options obviously should be 1, 2, 3, 4)

Disclaimer: This is the functionality that I am asking for, I am unable to confirm if this is what the original issue is specifically asking for.

        Book *
        <select id="book" class="select2-books form-control" name="book" required>
            <optionx></option>
            <option value="1">Recent Book #1</option>
            <option value="2">Recent Book #2</option>
            <option value="3">Recent Book #3</option>
            <option value="4">Recent Book #4</option>
        </select>

$(".select2-books").select2({
    ajax: {
        url: public_url + "/api/book/search",
        dataType: 'json',
        delay: 250,
        data: function(params) {
            return {
                q: params.term,
                page: params.page
            };
        },
        processResults: function(data, params) {
            params.page = params.page || 1;
            return {
                results: data.items,
                pagination: {
                    more: (params.page * 30) < data.total_count
                }
            };
        },
        cache: true
    },
    escapeMarkup: function(markup) {
        return markup;
    },
    minimumInputLength: 3,
    placeholder: 'Select a Book...',
    instructions: 'To find a book, search the Book\'s Title, ISBN, or Authors',
});

Result
Recent Book #1 is preselected (even though there is a blank option first that should be selected by default)

Preset options to not display when element is selected

Desired
When selected the preset options are displayed first. These would be what we expect the user will select, followed by a search box in case we didnt provide the correct preset options. (I messed up the image below in Photoshop, options obviously should be 1, 2, 3, 4)

Did you ever come up with an adequate solution @Rockstar04 ?  I'm looking to do the same thing.

@geoff-maddock I do not believe I did. We also had to stop using Select2 entirely because of accessibility issues.

Hey, I was looking also looking for a solution and actually you can do it if you can access the backend.
You need, however to remove the  minimumInputLength: 3 option so that the query is made to backend. Make the check at backend and send empty list back if query term's length is less than three. Then at processResults add after the first line:
if (page == 1) {
  $(".select2-books").find('option').each(function (i, e) {
     var object = {id: e.value, text: e.text};
     if ($.inArray(object, data.items) == -1)
       data.items.push(object);
     });
}

This will then add the initial options to the data list. At least worked for me and solved the problem. You have to think harder if you don't have the access to the backend and want to limit the first query to be sent only after typing three characters.

Wrote a post titled Predefined options for Select2 control using remote data source that demonstrates solution suggested by @govorov above.

I have updated extended adapter created by @govorov  As it will not displaying predefined options untill search is performed and also not working for pagination.
`$.fn.select2.amd.define('select2/data/extended-ajax', ['./ajax', './tags', '../utils', 'module', 'jquery'], function (AjaxAdapter, Tags, Utils, module, $) {
function ExtendedAjaxAdapter($element, options) {
    //we need explicitly process minimumInputLength value
    //to decide should we use AjaxAdapter or return defaultResults,
    //so it is impossible to use MinimumLength decorator here
    this.minimumInputLength = options.get('minimumInputLength');
    this.defaultResults = options.get('defaultResults');

    ExtendedAjaxAdapter.__super__.constructor.call(this, $element, options);
}

Utils.Extend(ExtendedAjaxAdapter, AjaxAdapter);

//override original query function to support default results
var originQuery = AjaxAdapter.prototype.query;

ExtendedAjaxAdapter.prototype.query = function (params, callback) {
    var defaultResults = (typeof this.defaultResults == 'function') ? this.defaultResults.call(this) : this.defaultResults;
    if ((defaultResults && defaultResults.length) && (!params.term || params.term.length < this.minimumInputLength) && (params._type && params._type == 'query')) {
        var data = { results: defaultResults };
        var processedResults = this.processResults(data, params);
        callback(processedResults);
    }
    else  {
        originQuery.call(this, params, callback);
    }
};

if (module.config().tags) {
    return Utils.Decorate(ExtendedAjaxAdapter, Tags);
} else {
    return ExtendedAjaxAdapter;
}

});`


Refactor: Centralize one place to calculate attack- and damage-bonuses

It is used in both the Display functionality on the character sheet, as well as for the dice mechanics. I am not a big fan of how I have to jump around as I always forget I put the code for calculating this in the ActorSheetSD class. And it may make sense to either have a method in the RollSD class that uses optional actor and item do determine these bonuses.
I suggest we wait with this refactor until the test suite I'm going to work on after 1.0.0 release is done.

This is partly done by the calcWeaponMasterBonus function. I would like to add one for backstabbing, but I want to find a way to do this and keeping the testability of the code without having to mock actual actors and items unnecessarily.


After logging in you must reload the app for the profile page to display

Help us reproduce - tell us about your environment

Latest version, ejected from Expo
Android 5.0 USB connected
Ubuntu 16.04 development environment

Steps to reproduce

Run the app
Login

Expected result

The profile page with the personalized greeting is displayed

Actual result

The login dialog box is displayed
The console shows the error "Error: TypeError: Cannot read property 'map' of undefined" at Login.js 49

Didn't mean to close, the console error is related to line 48:
.then(() => Actions.tabbar())


Rubocop: Fix Layout/IndentHeredoc issues

I removed the exclusionary line from the rubocop file, and then ran rubocop -a.
On visually inspecting the resulting output, I manually adjusted the offenses in lint_spec as the autocorrect did some weird things with it.
I also took a look at the Layout/SpaceInsideHashLiteralBraces TODO, and couldn't find the offense. Was it possibly fixed in a different PR? Can we remove that line from the rubocop file list?

Yeah, that violation was probably removed as part of one of the other RuboCop PRs. Let's remove that TODO from the .rubocop.yml. Thanks for your help!


Robot Mitigation, IP blacklist and set_real_ip problem

There seems to be an issue with the IP blacklist and the http_realip_module I think.
I have a setup where I use senginx as a reverse proxy in front of some webservers. The machine is furthermore placed behind Cloudflare.
Cloudflare -> senginx -> webservers

My build info is as follows
./se-configure.sh --with-http_realip_module --with-ipv6

Giving me:
nginx version: senginx/1.6.2
built by gcc 4.8.2 (Ubuntu 4.8.2-19ubuntu1)
TLS SNI support enabled
configure arguments: --with-http_realip_module --with-ipv6  .....

Tailing the logs while doing an ab (Apache Bench) towards the server to trigger the robot_mitigation_blacklist failed_count gives me the correct IP of my test machine (<IP_ADDRESS>):
==> ../logs/proxy.log <==
<IP_ADDRESS> - - [26/May/2015:16:31:47 +0200] "GET / HTTP/1.1" 000 0 "-" "ApacheBench/2.3"

And after a while the IP is blacklisted:
==> ../logs/error.log <==
2015/05/26 16:31:47 [error] 1573#0: *6 ip_blacklist: Blocked IP address: "<IP_ADDRESS>", mode: local, while running ip_blacklist, client: <IP_ADDRESS>, server: my-server.com, request: "GET / HTTP/1.1", host: "www.my-server.com"

However after the IP is blacklisted I suddenly get requests that are not being resolved correctly by the http_realip_module. <IP_ADDRESS> is a Cloudflare server.
In my nginx.conf file I have the following config to get the correct IP from Cloudflare of the client accessing the site.
    ##
    # Cloudflare
    ##

    set_real_ip_from   <IP_ADDRESS>/21;
    set_real_ip_from   <IP_ADDRESS>/20;
    set_real_ip_from   <IP_ADDRESS>/22;
    set_real_ip_from   <IP_ADDRESS>/22;
    set_real_ip_from   <IP_ADDRESS>/22;
    set_real_ip_from   <IP_ADDRESS>/18;
    set_real_ip_from   <IP_ADDRESS>/18;
    set_real_ip_from   <IP_ADDRESS>/20;
    set_real_ip_from   <IP_ADDRESS>/20;
    set_real_ip_from   <IP_ADDRESS>/22;
    set_real_ip_from   <IP_ADDRESS>/17;
    set_real_ip_from   <IP_ADDRESS>/15;
    set_real_ip_from   <IP_ADDRESS>/12;
    set_real_ip_from   2400:cb00::/32;
    set_real_ip_from   2606:4700::/32;
    set_real_ip_from   2803:f800::/32;
    set_real_ip_from   2405:b500::/32;
    set_real_ip_from   2405:8100::/32;
    real_ip_header     CF-Connecting-IP;

The logs now appear as:
==> ../logs/access.log <==
<IP_ADDRESS> www.my-server.com - [26/May/2015:16:31:47 +0200] "GET / HTTP/1.1" 000 0 "-" "ApacheBench/2.3" "-"

Another problem is that it seems to take a lot of concurrent requests to the senginx machine to actually trigger the blacklist - seems like you have to do at least robot_mitigation_blacklist per second in order to get blacklisted?

Ok seems like it's just a log problem - the requests to my IP (<IP_ADDRESS>) are blocked and a 000 status code is returned to Cloudflare - so all seems to be working ok. Closing this issue.


Deploy latest Domain Proxy in FreedomFi Production environment

Work with @119Vik to see what is needed to be able to install latest version of Domain Proxy from Magma master in FreedomFi prod environment.

Guestimaing at 5.

There has been no activity in this task domain for a long time.
Task needs to be re-evaluated and planned.

We released it recently.

Done internally by the FreedomFi team


VS + Angular2 (4) + Angular CLI => Uncaught ReferenceError: p2 is not defined

An error in the TypeScript definitions

I've created boilerplate Angular2 application with Angular CLI:
npm install -g @angular/cli
ng new my-app

After that I referenced via NPM Phaser-CE, pixi.js and p2.
Part of my package.json
  "dependencies": {
    "@angular/animations": "^4.2.4",
    "@angular/common": "^4.2.4",
    "@angular/compiler": "^4.2.4",
    "@angular/core": "^4.2.4",
    "@angular/forms": "^4.2.4",
    "@angular/http": "^4.2.4",
    "@angular/platform-browser": "^4.2.4",
    "@angular/platform-browser-dynamic": "^4.2.4",
    "@angular/router": "^4.2.4",
    "core-js": "^2.4.1",
    "p2": "^0.7.1",
    "phaser-ce": "2.8.7",
    "pixi.js": "^4.5.5",
    "rxjs": "^5.4.2",
    "zone.js": "^0.8.14"
  },

I modified default app.component.ts in the following way:
import { Component } from '@angular/core';

import 'pixi.js';
import 'p2';
import * as Phaser from 'phaser-ce';

@Component({
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
    game: Phaser.Game;
    constructor() {
        this.game = new Phaser.Game(800, 600, Phaser.AUTO, 'content', {
            preload: this.preload,
            create: this.create
        });
    }
    preload() {
        this.game.load.image('logo', '../assets/logo.jpeg');
    }
    create() {
        var logo = this.game.add.sprite(this.game.world.centerX, this.game.world.centerY, 'logo');
        logo.anchor.setTo(0.5, 0.5);
    }
}

After that I started server with
ng serve
Everything compiled well. But when I open the browser I'm receiving an error:
Uncaught ReferenceError: p2 is not defined
    at Object.<anonymous> (phaser.js:91278)
    at Object.<anonymous> (phaser.js:106051)
    at Object.../../../../phaser-ce/build/phaser.js (phaser.js:106055)
    at __webpack_require__ (bootstrap c606ea185f3e012c4fb3:54)
    at Object.../../../../../src/app/app.component.ts (main.bundle.js:51)
    at __webpack_require__ (bootstrap c606ea185f3e012c4fb3:54)
    at Object.../../../../../src/app/app.module.ts (app.component.ts:13)
    at __webpack_require__ (bootstrap c606ea185f3e012c4fb3:54)
    at Object.../../../../../src/main.ts (environment.ts:8)
    at __webpack_require__ (bootstrap c606ea185f3e012c4fb3:54)

An error is caused by the next lines in phaser.js:
/**
* @author       Richard Davey<EMAIL_ADDRESS>* @copyright    2016 Photon Storm Ltd.
* @license      {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/

//  Add an extra properties to p2 that we need
p2.Body.prototype.parent = null;
p2.Spring.prototype.parent = null;

Can anyone point me what I miss?

Remove the p2 and pixi.js packages. See https://github.com/photonstorm/phaser-ce/blob/master/README.md#webpack.

@samme I did you said.
Now my imports looks like that:
import 'phaser-ce/build/custom/pixi';
import 'phaser-ce/build/custom/p2';
import * as Phaser from 'phaser-ce/build/custom/phaser-split';

And I got "ReferenceError: PIXI is not defined" in phaser-split.js.

@samme , I'm sorry! I didn't look carefully for expose-loader usage.
I've corrected import to:
import 'expose-loader?PIXI!phaser-ce/build/custom/pixi';
import 'expose-loader?p2!phaser-ce/build/custom/p2';
import 'expose-loader?Phaser!phaser-ce/build/custom/phaser-split';

and got all modules loaded well.
But I faced another problem - it's about typings for Phaser - they are not loaded automatically. Can someone point me how to include typings of Phaser?

If they're not found automatically you can use tsconfig.json.
I'll update https://github.com/photonstorm/phaser-ce/blob/master/typescript/README.md (#292).

See https://github.com/photonstorm/phaser-ce/blob/master/typescript/README.md.

I have created a very simple angular CLI and phaser-ce boilerplate here:
https://github.com/GrindheadGames/phaser-ce-angular-cli-boilerplate


[Feature Request] [NPY] Detect accidental cubic runtime cost due to numpy.trace

There is a very common mistake people make in numerical code that incurs an accidental cubic runtime cost: They implement np.trace(A @ B), which costs $O(n^3)$ instead of the equivalent np.tensordot(A.T, B) which costs $O(n^2)$, or np.einsum if batch dimensions are involved. (see Frobenius Inner Product)
GitHub is full of this issue, but I don't blame people, since book authors should take more care to point this out. This not just affects numpy, but basically all related numerical libraries (jax, torch, tensorflow, etc.)
Basically, one needs to look out for trace being used with a matrix multiplication inside. A simple check would look something like:
match node:
    case Call(
        func=Attribute(value=Name(id="np"), attr="trace"),
        args=[BinOp(op=MatMult()) | Call(func=Attribute(attr="dot"))],
    ):
        # use np.tensordot instead.

One can probably make a more clever version that also detect cases like np.trace(2*(A@B)).

Probably one should be a bit conservative here, since transposing can also incur a surprisingly large cost, and only flag cases where one doesn't need to transpose.
So, the bad cases one wants to find are:

Basic case: np.trace(A.T.dot(B)), np.trace(A.T @ B), np.trace(A.dot(B.T)), np.trace(A @ B.T) ⇝ use np.tensordot(A, B)
Basic case with scalar: np.trace(c*A.T.dot(B)) or np.trace(A.T.dot(c*B)), etc. ⇝ use c*np.tensordot(A, B)
More complex cases: such as this one np.trace(ct.T @ c0_inv @ ct @ c0_inv) are likely much harder to detect without also generating false positives.

The last one also does another sin, they invert the sigma_u matrix, which is usually bad practice. In this example, one can make the whole thing $O(n^2)$ by using Cholesky factorization instead of inverting and tensordot instead of trace.

  I'll open an issue.


Remove single merge restriction on target merging

This can result in multiple targets building the same code in BwX mode, but if that isn't desired a minimal target can be inserted to mimic the previous behavior.
This change makes working with SwiftUI Previews nicer, as you can create a demo application for each swift_library.

This can result in build errors in Xcode:

Multiple commands produce '/Users/brentley/Library/Developer/Xcode/DerivedData/bwb-abwjtbepqldofpcykwlqoicwalrf/Index/Build/Products/bazel-out/watchos-x86_64-min7.0-applebin_watchos-watchos_x86_64-dbg-ST-6e56652cb606/bin/examples/multiplatform/watchOSAppExtension/watchOSAppExtension.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule'
• Target 'watchOSAppExtension' (project 'bwb') has copy command from '/Users/brentley/Library/Developer/Xcode/DerivedData/bwb-abwjtbepqldofpcykwlqoicwalrf/Index/Build/Intermediates.noindex/bwb.build/bazel-out/watchos-x86_64-min7.0-applebin_watchos-watchos_x86_64-dbg-ST-6e56652cb606/bin/examples/multiplatform/watchOSAppExtension/watchOSAppExtension/Objects-normal/x86_64/watchOSAppExtension.swiftmodule' to '/Users/brentley/Library/Developer/Xcode/DerivedData/bwb-abwjtbepqldofpcykwlqoicwalrf/Index/Build/Products/bazel-out/watchos-x86_64-min7.0-applebin_watchos-watchos_x86_64-dbg-ST-6e56652cb606/bin/examples/multiplatform/watchOSAppExtension/watchOSAppExtension.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule'
• Target 'watchOSAppExtension.library' (project 'bwb') has copy command from '/Users/brentley/Library/Developer/Xcode/DerivedData/bwb-abwjtbepqldofpcykwlqoicwalrf/Index/Build/Intermediates.noindex/bwb.build/bazel-out/watchos-x86_64-min7.0-applebin_watchos-watchos_x86_64-dbg-ST-6e56652cb606/bin/examples/multiplatform/watchOSAppExtension/watchOSAppExtension.library/Objects-normal/x86_64/watchOSAppExtension.swiftmodule' to '/Users/brentley/Library/Developer/Xcode/DerivedData/bwb-abwjtbepqldofpcykwlqoicwalrf/Index/Build/Products/bazel-out/watchos-x86_64-min7.0-applebin_watchos-watchos_x86_64-dbg-ST-6e56652cb606/bin/examples/multiplatform/watchOSAppExtension/watchOSAppExtension.swiftmodule/x86_64-apple-watchos-simulator.swiftmodule'

I'm thinking about how to resolve this, possibly with VFS overlay magic, but I might have to revert this.


Examples in Python

[Do you will add examples in Python too? Do you need contribution help?]

Document Details
⚠ Do not edit this section. It is required for learn.microsoft.com ➟ GitHub issue linking.

ID: b36e374f-acd3-dd00-be33-e5ef8ab21aa7
Version Independent ID: cc638e10-5df8-3d41-fddf-711ca562ee34
Content: Tutorial - Build a serverless real-time chat app with client authentication
Content Source: articles/azure-web-pubsub/quickstart-serverless.md
Service: azure-web-pubsub
GitHub Login: @JialinXin
Microsoft Alias: jixin

Yes. It's in plan. Currently have a sample of simple notification scenario using Function Python. You can refer to this first.
https://learn.microsoft.com/en-us/azure/azure-web-pubsub/tutorial-serverless-notification?tabs=python

@JialinXin Thank you for the fast answer!

@JialinXin Do you need contribution? I didn't understood.

Thank you @DamyanBG ! Yes, we welcome contributions! You may have a try and let me know if there's any problem.

Thank you, I will try!

DamyanBG, Thanks for your feedback on doc enhancement and your contribution via PR.  JialinXin has approved the PR.  We will now close this thread.


Unable to install using Homebrew

Just download the Mac version and double clicked the file and allowed it to open from unidentified developers.
The YakYak screen shows just a blank white screen with nothing on it.

same here...

which version is installed with Homebrew?
I'm not sure who the maintaner of the package is, but latest version should be 1.4.0 (with a 1.4.1 pre-release)

It says Version 1.4.12. Do I still have to install Homebrew? I tried the Homebrew method of installation and then found you have a Mac installer package and tried that.
If you want me to try the Homebrew method, please provide more detailed instructions how.

1.4.12 means it still is using our framework versioning instead of the app itself
Can you please try to install via the official release
https://github.com/yakyak/yakyak/releases
Unzip and run YakYak

Tried exactly that. Downloaded the Mac OS version and tried installing. Nothing. Blank white screen.

Also with the 1.4.1 pre-release? This pre-releasewill show an error window with a link to open the inspector.
If you can, install this one, open the inspector (via the link) and take a screenshot of the "console tab"

1.4.1 pre-release should show an error window with a link to open the inspector.
Can you try that version, open the inspector and take a screenshot of the Console tab?
or just open the inspector with your current yakyak version (access via the menu) and take the screenshot

@NOTSOGEEKY ?


Create rutikakengal pr.md

Hi GSSOC Team !
This is the PR I have raised and its not been merged . Could you review and Merge it
@sanjay-kv @MastanSayyad
https://github.com/yatulearn/yatulearn/pull/464

This is level 2 PR @aslams2020

@MastanSayyad


tour: [ слез -> срез]

Context: https://go-tour-ru-ru.appspot.com/moretypes/15
Change the title above to describe your issue and add your feedback here, including code if necessary

This is fixed in the last version of the ru tour, AFAICT https://go-tour-ru-ru.appspot.com/moretypes/15, so I'm closing this issue.


Doc fixes

Fixes minor things in current 1.5.x docs.
Fixes #401
Closes #379

@JimBugwadia I'm having some git problems on my end right now. Can you go ahead and cherry pick this PR over to the release-1-5-0 branch so it refresh the site, please?

See: https://github.com/kyverno/website/pull/416


extensions/ext: Add VK_EXT_pipeline_properties device extension

Depends on #619, and the API here is at the same time a blocker for #619: it is being discussed within Khronos.

Finally putting https://github.com/krolli/vk-parse/pull/24 to use :)


Add a bot/PRcheck to verify that a contributor signed the CLA

As described in CONTRIBUTING.md each contributor should signed the Mattermost contribution license agreement to be add to the list of approved contributors.
Could be great to add a bot or a label which will block a PR to be merge until submitter signed the CLA.
Should look on project kubernetes/kubernetes where something like that is implemented.

Some information here : https://developer.github.com/v3/repos/statuses/

@pichouk We pointed this Mattermod to this repo as well, which should trigger a CLA note if the contributor hasn't signed it yet.

Quick and perfect :) Thanks !


Shipping instructions

This adds in an optional 'delivery instructions' field within the shipping selection in the checkout.
Although this could potentially be handled by an order attribute, I think this field is so commonly used/expected, and specific in purpose that it makes sense to include it as a core field - it then shows on order emails and screens next to the shipping method.
(fix other fixes as well)

Ronny and I had a long discussion last night about exactly this. And I am a little split in my mind here. I just added something similar, but called it (Additional information to "shop company name"). This can't be done hard-coded because the nature of the label text. It has to be an order attribute. Here is an example.

Your example is perfect for order attributes, and a great example of why they are needed.
My addition here is just a way for the field to be included 'natively'. It's off by default, and you can simply leave it off if you want to use attributes instead.
My thinking with this is that this field is so commonly offered on checkout screens, I thought it would make more sense to have it a single checkbox enable, rather than having to create a new attribute. It's also closely related to shipping, so it will appear directly after the shipping method name, rather than in a list of attributes (which may or may not relate to shipping).

OK, I see. If it comes after Shipping I see the difference. We made a lot on the "Order Attributes2" branch last night. And it is now running on a live shop site!


Differentiate days in chat logs

Currently there's no way to tell when one day starts and when another begins. I'd personally prefer an <hr> (or CSS equivalent) with the date (or days ago) in faded letters above it.
Example:
1 day ago

Message: hey

Duplicate of #89


[Draft] TEST: Run all tests through pytest

Description
Currently, unit tests execute through a mixture of built-in unittest and pytest.
From the commit history, it looks like initial tests were added using python's built-in unittest framework, and then subsequent tests were introduced using pytest.
Compared to unittest, pytest has a much nicer output format, offers many options for how to execute tests and how to see their outputs, and has plugins that allow it do extra things which the built-in cannot when desired (e.g. JSON outputs, test coverage reports, etc.).
This PR switches the automated scripts to execute all of the tests using pytest. This doesn't change what tests were executed - just uses pytest as the runner.
One challenge here is how each of these interprets the path from where modules are imported - here I'm trying to control these with the PYTHONPATH variable when pytest is called within shell scripts, but don't know if this will work out for all the variants under which tests are executed.

Checklist to comply with before moving PR from draft:
PR completeness and readability

[x] I have reviewed my changes thoroughly before submitting this pull request.
[ ] I have commented my code, particularly in hard-to-understand areas.
[ ] I have updated the documentation to reflect the changes or created a separate PR with update and provided its number in the description, if necessary.
[x] Git commit message contains an appropriate signed-off-by string (see CONTRIBUTING.md for details).
[x] I have added a respective label(s) to PR if I have a permission for that.
[x] I have resolved any merge conflicts that might occur with the base branch.

Testing

[x] I have run it locally and tested the changes extensively.
[ ] All CI jobs are green or I have provided justification why they aren't.
[ ] I have extended testing suite if new functionality was introduced in this PR.

Performance

[ ] I have measured performance for affected algorithms using scikit-learn_bench and provided at least summary table with measured data, if performance change is expected.
[ ] I have provided justification why performance has changed or why changes are not expected.
[ ] I have provided justification why quality metrics have changed or why changes are not expected.
[ ] I have extended benchmarking suite and provided corresponding scikit-learn_bench PR if new measurable functionality was introduced in this PR.

@Alexsandruss Would you perhaps have any pointers about why the failing CI job here:
https://github.com/intel/scikit-learn-intelex/actions/runs/11218859163/job/31183555329?pr=2090
.. might be failing to import daal4py._daal4py in the new pytest call that I added, while it succeeds in the other calls?

I've had to fight against pytest's package discovery recently and had to use --rootdir to get things to work properly (https://github.com/intel/scikit-learn-intelex/blob/main/.ci/scripts/run_sklearn_tests.py#L47). Maybe that could help you?  I believe your daal4py._daal4py is coming from the use of the $PYTHONPATH which is using the uninstalled repo daal4py folder to find daal4py, but can't find the compiled _daal4py.so file there.

I've had to fight against pytest's package discovery recently and had to use --rootdir to get things to work properly (https://github.com/intel/scikit-learn-intelex/blob/main/.ci/scripts/run_sklearn_tests.py#L47). Maybe that could help you? I believe your daal4py._daal4py error is coming from the $PYTHONPATH which is using the repo daal4py folder to find daal4py instead of the installed site-packages daal4py, because it can't find the compiled _daal4py.so file there.

Thanks for the tip. But that was actually for a different reason: some test files import other tests files - for example test_daal4py_spmd_examples.py imports test_daal4py_examples right here, as an absolute import instead of relative, so the folder with test files needs to be under sys.path for it to work:
https://github.com/intel/scikit-learn-intelex/blob/2f73b9de4a79205b67522f502ae140e6470871f3/tests/test_daal4py_spmd_examples.py#L22
But since now these tests should only be getting executed through pytest, I guess a better solution should be to use relative imports. I'm now trying that approach so let's see how the CI will end up working with it.

Looks like it was just a matter of deleting the __init__.py file in the tests folder. All CI jobs are executing them correctly now.

/intelci: run

/intelci: run