Measuring CPU load

Hi all,
I am new to  chrome-remote-interface. Is it possible to calculate the CPU usage (load)
of a  webpage?
Kind regards,
Karthik

Well you can profile the page loading and extract some stats from it, see this wiki and automated-chrome-profiling.
That's not exactly the CPU load as you would see in the OS task manager, if you really need to do that I guess you can always mix CDP commands and executions of, say, ps (on Linux) like this:
ps -p $PID -o pcpu=

Using the child_process module.

Actually, there is such thing, the "Performance monitor" drawer does exactly that. It uses the Performance.getMetrics method (you need to call Performance.enable() first).
It's not superclear what those values are but you'll need the ScriptDuration metric to estimate the CPU load of the JavaScript running in your page; take a look here to see how DevTools interpret them.
There are other *Duration metrics, probably (once processed) taking the sum will give you a more fair estimate of the CPU load if you want to take into account also the rendering phase.

Thank you @cyrus-and .


day2ops working group blog post

What are your changes?
What is the urgency level of this change?

[ ] Blocker
[x] High
[ ] Medium

I have completed these items:

[x] I have built locally and tested for broken links and formatting.
[x] If appropriate, I have added redirects.

If you included a comment with your commit, it appears here:

@mesosphere-ci test this please


Pass the Day instance as parameter of the onPickDate callback

Hello, thanks for sharing this great calendar !
I would like to know if it was possible to pass the clicked Day instance as param of the onPickDate callback.
I need to show a popup above the clicked day and so I need a ref to the Day instance which was clicked for positioning.
Thanks a lot !
(I'm forking your project to see if I can implement something useful )

       {           this.dayElement = dayElement;         }}       >         {day === null ? '' : day.date()}

@AlexGeb could you explain how did you add the ref to the outer element of the Day component. And can you show your example please?

Honestly I'm not a big fan of passing a Day reference to the onPickDate callback, as I'm not sure is good performance-wise.
I'll look into some alternatives, if any, and let you know!

@SagiSan, you can set the ref props of any element to a function which takes a ref to the element as input :
 { this.dayElement = dayElement;}}/>
At each render, the dayElement attribute of your component will be set, and then you can use it anywhere in your components methods (apart from the lifecycle hook methods that occur before first mounting).
@GiovanniFrigo I totally agree with you, I did it because I needed to position a popup and it was the first idea that came up.
Another idea is to add a props to the Calendar component, such as dayClickedPopup, which has to be set as a component, propagate this props down the tree and display it at a Day level, as soon as it is clicked or hovered.
I'm rather new to React so feel free to tell if it is a bad idea..


Fix toolbar and refactor positioning

This pull request was created after a discussion in issue #193.
Its goal is to fix #193, #190 and #143.

I will fix the linting errors quickly, I believe the test is failing due to the code not changing the style on the DOM node directly anymore.

HI Minivera , could you please fix the tests?

Oh sure, I though you might have wanted to fix them yourselves. I'll fix them right now, sorry about that.

this PR breaks https://github.com/globocom/megadraft/pull/192 and basically it breaks shouldDisplayToolbarFn completly, because you don't retrieve any arguments anymore
sorry, i haven't been around here for a while and i am late with the review.
I will open up a new issue


Windowless is broken on Linux and OpenXR

function lovr.conf(t)
	t.headset.drivers = {'openxr'}
	t.window = nil
end

lovr: /home/jakob/XR/lovr/deps/glfw/src/input.c:883: GLFWmousebuttonfun glfwSetMouseButtonCallback(GLFWwindow *, GLFWmousebuttonfun): Assertion `window != NULL' failed.
Aborted (core dumped)

Currently a window is required to create the OpenGL context.  Using EGL would fix this, but only for Linux.  The Vulkan branch has support for headless rendering (which I'm very excited about, I don't need that pesky window).


Version Numbers dont seem to be correct across repository. [Bug]

Describe the Bug
You've released as version 1.0, but the package.json still says 0.2.3, the Menus in Discord still say 0.2.17, etc.
To Reproduce
Look at the areas stated above, or any place the version number should be represented.
Expected Behavior
All version numbers should match the version I installed.
Discord Version
latest stable
Additional Context
This bug makes confirming issues very difficult.

Version in package.json is not for users. Release version refers to the installer since that is what is actually there (as can be seen in the installer UI). Versions in the menu are what is relevant for users.

Really? It's not for users, but it's still important to keep everything organized. And that's so confusing. If the installer needs its own version number, it needs its own repository. Use the version tags to label your code responsibly.

You can see how this is confusing right? I'm in "releases" for your codebase. They are all in line on the left. There are several differnt references you're making, they should ONLY refer to the listed repository we're looking at and working with.
And then why if it says 0.2.83 here, does my discord say 0.2.17
This should not be closed.

The installer does have its own repository but users are unaware of it. I would also prefer not to use releases of this repository for the installer but that workflow/architecture predates me. As you can see this is a fork and the weirdness was set in place before I forked. Normalizing all the version numbers and reworking how releases is used would require a massive rework of how BD itself works (everything currently points to the releases page for installing, and uses GitHub pages to load remotely as opposed to actually packaging and releasing the code). It would also cause a disruption to the users themselves and given the userbase's tendency to freak out over any little change, I don't really like that option.
If this project were wholly my own from the start I would definitely have no issue with keeping things consistent.
I am currently working on a rewrite where I should be able to do what you would like so I will reopen this. But unfortunately I wouldn't expect too much on this front other than a version change in package.json for now.

The whole point of forking is to make it better, and to fix those parts that are broken. create a new branch, recruit people to work on the issues with you. Offer contributors credit. Not just donors. And actually solve this issues, dont just bandage them. If i was still an engineer I'd help, but I've put that behind me, but I still know how the process works.
That all seems very roundabout, and users dont care about the "installer version number" one slight bit. We do need to make sure that our software matches documentation so that we can bugfix correctly.
Glad to hear you're working on it, dont do it all on your own if you dont have to, that's what pull requests are for, you still have control but people can contribute. And if you make a Trello roadmap, or even just do it here in Github it'll get done faster.
Thanks for reopening.

I agree with your sentiment about forking, but this project was made the "main version" of product as opposed to just a fork so breaking changes really need to be kept to a minimum. Contributors are always welcome but they seem to be few and far between on this project. Unfortunately the main idea was for this to be a "bandaged" hence the name, the rewrite is a real solution.
Normally I'd agree with you but people do seem to care in the Discord server oddly enough. The process for everything is definitely roundabout but again I didn't just want to break it for the thousands of people to get angry about. The minimal documentation does still match the codebase currently.
The rewrite has made good progress and is nearly done which is why I haven't made a roadmap as such but people are still welcome to contribute there as well. They've been more apt to contribute there since the codebase is readable and organized as opposed to this nasty spaghetti code.

Looking forward to it. Where is it?

development branch

It might be worth adding to the ReadMe so people know where to find it, to contribute. As well as maybe some contribution guidelines?

I honestly don't believe that would have any affect. Maybe if I have some free time, but I haven't had much time to work on it let alone do organizational things.

At long last, the version numbers are finally consistent between the repo and the releases


Docs: Add logspace/lgamma in rst and op_list.

Thanks for your contribution and we appreciate it a lot. :rocket::rocket:
1. Motivation
Add logspace/lgamma in rst and op_list.
2. Modification
docs/MLU-OPS-OpList.md
docs/design_docs/lgamma/lgamma.md
docs/user_guide/9_operators/index.rst

LGTM


Localization

Added variables to change text content in main parts of theme

Thanks for your work. But that's not how localization should be done in Hugo. See my comment in https://github.com/thegeeklab/hugo-geekdoc/issues/13 and https://gohugo.io/content-management/multilingual/.
I don't want to start adding this kind of localization, sorry.


Move Github action for keyword to the root

.github folder will be removed from the keyword example in the next release. The folder should be present in this repository, in the root and enable workflow for each example.
Easier to maintain, all in one place.

To be enabled, we will need additional work. Let's keep this opened for now, we will pick this up soon to make this green.


Proposal: Add paging configuration for the static page generation options

With large GraphQL documentation, the single raw HTML page would be over 10M, within the single HTML page. It works but consumes a large amount of memory to render it. We tested 6-7M single-page HTML content, consuming over 600MB in Chrome loading this page.
Add simply paging this generated HTML content, since we have the 1 file option. we should have options for grouped HTML files.
Thanks

Hmm, yeah, interesting idea. I'll have to think on it and what a default solution might look like.
For example, you'd probably want the entire API represented in the navigation panel while only rendering a portion of the API in the main panel...pagination feels clunky and very Web 1.0 to me...perhaps there's a sexier AJAX-like approach?


Async support

Having this library block makes it a bit frustrating to work with from within an async actix_web API. Sure, we can use it inside a web::block(), but currently even the builder code can't run in an async context, making dependency injection a bit tricky. Given that we're already using reqwest to interact with Jira, I think it wouldn't be too hard to interact with Jira asynchronously.
I'm not sure whether others have use cases that depend on blocking code, but if so, we could have both a Jira and an AsyncJira (perhaps gated by a crate feature). I wanted to get some feedback on the high level approach before possibly sending a PR--would having both an async client and a blocking client be preferred, or would you be open to making the entire library asynchronous and leaving it up to callers to provide a runtime (or are neither acceptable)?  Thanks!

I liked the approach from zbus moving from synchronous to asynchronous. They moved the library to asynchronous and introduced a blocking wrapper for the synchronous use case.
This should enable us to move to asynchronous while having minimal impact to synchronous implementations.


Add lazy way to SearchTarget to target any accessible file system item.

Add a routine or const like int.Max to SearchTarget that lets the user specify that they don't care at all, just feed found files to the coms base.
Example in Theory.
var Anyfile =  SearchTarget.AllFiles();

Done.
Ripped the /Anyfile flag settings from the console app to be the settings with SearchTarget.AllFiles as a static read only private variable exposed by a get property.
Example below.
OdinSearchHandler.AddSearchTarget(   SearchTarget.AllFiles   );

A unit test has been added also to test if the static construct that sets this is invoked and assigns it ok.
SearchTarget_AnyFileTest_TriggerAndCompare


Tag color conversion is wrong, need to fix

Is this still an issue?

Is this still an issue?

No longer an issue, let's code the name somewhat and then remove it.

Fixed


Turkey stuck in an endless war with a non-existent Cyprus

by respscorp
Turkey stuck in an endless war with a non-existent Cyprus

Don't see how this can happen. In event 8004110 CYP triggers the event where TUR declares war on them. So CYP has to exist.


Non-uniform d3.interpolateRgbBasis

I would be interested in passing non-uniformly spaced colors as input for the d3.interpolateRgbBasis. Is it on the roadmap for this package? Maybe I am missing something and it is already possible?
I would like to do something like:
d3.interpolateRgbBasis(["#000000", "#e60000", "#e6e600"], [0., 0.2, 1.])

Instead of the implicit default:
d3.interpolateRgbBasis(["#000000", "#e60000", "#e6e600"], [0., 0.5, 1.])

I would be happy to open a PR myself, given some directions, if that is something someone is interested in :)

Another way of framing the question would be to this interpolator with another that "warps" the domain: https://observablehq.com/d/f10b45253c5d3f62
Unless there's something I don't see, for the piecewise approach, finding the solution involves some sort of newton-raphson solver, as in https://observablehq.com/d/5d4f950dd5554b67 ; and the piecewise approach is not necessarily the best if we want a derivable solution.
So I'd rather "solve" this issue by publishing documentation on how to compose interpolators. But please feel free to send a PR if you have a better solution!


Implement Health Consideration for NPCs

About the PR
Implemented the TargetHealthCon consideration, which was never fully implemented.
Why / Balance
This consideration lets NPCs use the target's health in deciding which one to choose.
For example shooting the fully healthed enemy a few meters away might be more important than the dying one next to you, whom can be left to bleed out.
Also I'm planning on using this in my Medibot improvements.
Technical details
Optional MobState targetState may be passed to the TargetHealthCon consideration, by default it is Invalid.
Use either TryGetPercentageForState or TryGetIncapPercentage depending on whether we gave a targetState, to figure out how close we are to the selected damage threshold. That value is clamped to 0-1, which is what the next stage of target selection uses.
Currently this consideration is used by NearbyMeleeTargets, NearbyGunTargets, and OrderedTargets, even though it hadn't been implemented yet.
Most notable users of these compound tasks are Rat Servants, Holoclowns, and Holoparasites. Others would be NPC Salvagers, Spirates, and Syndicate Footsoldiers.
I have left the curve used to determine the importance of this consideration untouched.
Media

[x] I have added screenshots/videos to this PR showcasing its changes ingame, or this PR does not require an ingame showcase

old, the salvager attacks the 80 damage urist 3 tiles away:
https://github.com/user-attachments/assets/98858c73-eaa6-4ebf-b2b3-adb403315cd3
new, the salvager attacks the unharmed Urist 6 tiles away instead of 80damage Urist 3 tiles away.
https://github.com/user-attachments/assets/eccdaf8f-7399-45e8-b872-8ad7e46082f5
Breaking changes

Changelog

The old behavior seems better.
Someone who is badly injured is still someone who can fight back against you.

I don't really know what exactly it was made for, I didn't notice any comments in the commit which created it, and a quick search didn't find me any useful issues PRs.
I guess I could go and just nuke all the 6 usages of this consideration.


No Response or Updating

Hi, I have noticed as of a few hours ago all of my lights show "no response" or "updating". No actions were taken before the issue became prevalent. The accessories can still be controlled inside of the homebridge webpage with no issue. I have cloned and rebuilt the docker container running in DSM and the issue persists, the only curious thing I noticed was the line of "outputType": "AUTO_DETECT", is missing in every light configuration, and quotes around 23 in the apiPort line were missing. Are the aforementioned changes needed for the plugin to work properly? What might be causing this issue? I am running the plugin in a child bridge and have had no issues up to this point.
Environment:
DS2415+ DSM 7.1.1-42962 Update 1
Node.js 18.12.1
Homebridge UI version 4.50.2
Homebridge version 1.5.1

Hello!
let me investigate further. For sure the parsing issues should not be there. Let me take a closer look.
This happened to me a while back but when I upgraded my hubs this resumed to worked back again properly. When this happened I used to have a bridge box from Lutron and the issue was present there too.
Anyway, let me take a look and will get back to you ASAP in a few days.

Okay thanks so much for your prompt response. Should I fix the parsing issues or will this result in the accessory cache being erased requiring I reorganize the lights? Looking forward to your response ASAP so I can get my lights working again lol

I don’t think you will have a problem if you fix the parsing issue. However I can’t guarantee it for now since I am not home and can’t see my setup 😊 but will be there Sunday.If I was to make an educated guess you should be able to change anything. Just make a sensible backup of any setting file you change. The cache should be smart enough to prevent duplicates. Saludos!FLGOn Nov 26, 2022, at 1:07 AM, Graham Werle @.***> wrote:
Okay thanks so much for your prompt response. Should I fix the parsing issues or will this result in the accessory cache being erased requiring I reorganize the lights? Looking forward to your response ASAP so I can get my lights working again lol
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you commented.Message ID: @.***>

@gramster1  I checked the parsing HTML/Javascript script and in my computer all parses properly.The quotes are where they should, so I can say that the issues you are reporting are most likely due to the browser/os you are using. I will see if there's anything I should take care of in terms of specifying the format (UTF8) I should specify somewhere to force that encoding.
SO. YES you should add "" to the outputType field.
However.. I don't think this is the issue you are having. Have you change anything in your network? Say added a router, change ip address classes or something?
To me it seems more like a communication problem more than a parsing issue. I would fix the parsing anyway, you could remove the "outputType" field entirely since HomeKit does nothing that I can think of with that info. That was added later on a pull request. I will investigate if this serves a reason, In my setup I don't use that field. The isDimmable is more useful in terms of knowing if the fixture is dimmable or not.
I would also try resetting the bridges in my system, like Apple TVs/HomePods, etc.  It seems more likely that there's an issue there.
Please keep me posted if this fixes your issue so that I can keep investigating.

Thank you for the detailed response, after some more testing - restarting homebridge, rebuilding the container etc... The lights randomly started to work again, I have removed the outputType fields with no issues. I will keep you posted if the issue re-appears. Thanks for your promptness when issues arise!!


Linux ExitCode for wrong commandline

In linux (not tried on other platforms) the exitcode is "0" (Success, ok) also for a wrong paramaters.
Here is my quick modifcation, which allows me now to script arround xfreerdp.
 [tbasien@tab-ol7 FreeRDP-master]$ diff client/X11/cli/xfreerdp.c* 68,69d67
 <         // present a errorcode in command exit, if CLI is wrong
 <         if (status == COMMAND_LINE_STATUS_PRINT_HELP) return 200;

I saw, that freerdp V1 used 128 as commandline error,


Add merge request support for GitLab repositories

Resolves FILO-338
Added support for Merge Requests. Unfortunately no unit tests in this MR as there wasn't enough time to implement mocks even though I went ahead and did some development.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git checkout -- <file>..." to discard changes in working directory)

        modified:   cfg/types.go
        modified:   pkg/file/file.go
        modified:   pkg/git/git.go
        modified:   pkg/tuner/tuner.go

There is some minor formatting that you should correct.
I would suggest you copy the Seiso project's Makefile over here and remove the bits unneeded in this project. That's a quick thing to do.  After that it should be natural to run make or make fmt before pushing to a PR.

Introduced Makefile, formatted the code


changeData is not working properly with candlestick

G2 Version: 3.0.0 and 3.0.2-beta1
Platform: Chrome Version 62.0.3202.94
CodePen Link: https://codepen.io/karimhossenbux/pen/GObrwG?editors=0011

changeData() is not working properly when I try to update chandlestick chart.
There is a codepen for testing purpose. There is a setInterval which should update the data adding 2 more candles but nothing is happening.
setInterval(function () {
  // This will add 3 more green candles
  console.log('changeData')
  chart.changeData(updatedData)
}, 5000)

Am I doing something wrong? Or is this a bug?
Thank for helping and this awesome library!

doing dv.source(updatedData) in the setInterval update the chart, it that normal behaviour?

You drew the plot with kView, not chart, so changing the data for chart is meaningless.
try kView.changeData()

Thanks for you help!
I've tried with kView.changeData() but makes everything invisible. The tooltip hover is still working .

New codepen: https://codepen.io/karimhossenbux/pen/vWqboK?editors=0011

you should keep the data structure the same (the new data does not have range field).
simplest solution: kView.changeData(data) => dv.source(data)
setInterval(function () {
  // This will add 3 more green candles
  dv.source(updatedData);
  // kView.changeData(updatedData)
}, 5000)

Thanks! I'll will hack around that 👍


SlackVar for multi-depot example does not work as expected

The example below is a very simple vrp with capacity constraint, requiring one return journey to the depot. The truck should be able to travel to nodes 2 and 3 and accumulate a load of 20/25. It should then drop this at the depot, which has a demand of -25 and a SlackVar range of 0 25 before returning to node 4 and then back to the actual depot.
Example of a possible solution:
0 Load(0) ->  2 Load(10) ->  3 Load(20) ->  1 Load(0) ->  4 Load(20) ->  0 Load(20).
However the solver does not find this (or any) solution. The SlackVar at the dummy depot should allow the above route but it is not working expected.
Also note, if you set the capacity to 30 then it will solve the problem as it can now return to the dummy depot with the exact load required.
from __future__ import print_function
import math
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2

def euclid_distance(x1, y1, x2, y2):
    # Euclidean distance between points.
    dist = math.sqrt((x1 - x2)**2 + (y1 - y2)**2)
    return dist

def create_distance_matrix(locations):
    # Create the distance matrix.
    size = len(locations)
    dist_matrix = {}

    for from_node in range(size):
        dist_matrix[from_node] = {}
        for to_node in range(size):
            x1 = locations[from_node][0]
            y1 = locations[from_node][1]
            x2 = locations[to_node][0]
            y2 = locations[to_node][1]
            dist_matrix[from_node][to_node] = euclid_distance(x1, y1, x2, y2)
    return dist_matrix

def create_data_model():
    """Creates the data for the example."""
    data = {}
    # Array of distances between locations.
    _locations = [
        (0, 0),
        (0, 0),
        (-50, 50),
        (0, 100),
        (50, 50)]
    capacities = 25
    _distances = create_distance_matrix(_locations)
    demands = [
        0,
        -capacities,
        10,
        10,
        20]
    data["distances"] = _distances
    data["num_locations"] = len(_distances)
    data["num_vehicles"] = 1
    data["depot"] = 0
    data["demands"] = demands
    data["vehicle_capacities"] = capacities
    return data

def create_distance_callback(data):
    """Creates callback to return distance between points."""
    distances = data["distances"]

    def distance_callback(from_node, to_node):
        """Returns the manhattan distance between the two nodes"""
        return distances[from_node][to_node]
    return distance_callback

def create_demand_callback(data):
    """Creates callback to get demands at each location."""
    def demand_callback(from_node, to_node):
        del to_node
        return data["demands"][from_node]
    return demand_callback

def add_capacity_constraints(routing, data, demand_callback):
    """Adds capacity constraint"""
    capacity = "Capacity"
    routing.AddDimension(
        demand_callback,
        0,  # null capacity slack
        data["vehicle_capacities"],  # vehicle maximum capacities
        True,  # start cumul to zero
        capacity)
    # Add Slack for reseting to zero unload depot nodes.
    # e.g. vehicle with load 10/15 arrives at node 1 (depot unload)
    # so we have CumulVar = 10(current load) + -15(unload) + 5(slack) = 0.
    capacity_dimension = routing.GetDimensionOrDie(capacity)
    for node_index in [1]:
        index = routing.NodeToIndex(node_index)
        capacity_dimension.SlackVar(index).SetRange(0, data["vehicle_capacities"])

def print_solution(data, routing, assignment):
    """Print routes on console."""
    total_dist = 0
    for vehicle_id in range(data["num_vehicles"]):
        index = routing.Start(vehicle_id)
        plan_output = 'Route for vehicle {0}:\n'.format(vehicle_id)
        route_dist = 0
        route_load = 0
        while not routing.IsEnd(index):
            node_index = routing.IndexToNode(index)
            next_node_index = routing.IndexToNode(assignment.Value(routing.NextVar(index)))
            route_dist += routing.GetArcCostForVehicle(node_index, next_node_index, vehicle_id)
            route_load += data["demands"][node_index]
            plan_output += ' {0} Load({1}) -> '.format(node_index, route_load)
            index = assignment.Value(routing.NextVar(index))

        node_index = routing.IndexToNode(index)
        total_dist += route_dist
        plan_output += ' {0} Load({1})\n'.format(node_index, route_load)
        plan_output += 'Distance of the route: {0}m\n'.format(route_dist)
        plan_output += 'Load of the route: {0}\n'.format(route_load)
        print(plan_output)
    print('Total Distance of all routes: {0}m'.format(total_dist))

def main():
    """Entry point of the program"""
    # Instantiate the data problem.
    data = create_data_model()
    # Create Routing Model
    routing = pywrapcp.RoutingModel(
        data["num_locations"],
        data["num_vehicles"],
        data["depot"])
    # Define weight of each edge
    distance_callback = create_distance_callback(data)
    routing.SetArcCostEvaluatorOfAllVehicles(distance_callback)
    # Add Capacity constraint
    demand_callback = create_demand_callback(data)
    add_capacity_constraints(routing, data, demand_callback)
    # Setting first solution heuristic (cheapest addition).
    search_parameters = pywrapcp.RoutingModel.DefaultSearchParameters()
    search_parameters.first_solution_strategy = (
        routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC)
    # Solve the problem.
    assignment = routing.SolveWithParameters(search_parameters)
    if assignment:
        print_solution(data, routing, assignment)
    else:
        print('No solution has been found')

if __name__ == '__main__':
    main()

SlackVar does not seem to work at all. Below is a simple example with a depot and one node. They have demands of 0 and -5 respectively. Now set the SlackVar to any range, and it won't allow the solution 0Load(0) -> 1Load(-5) -> 0Load(-5). Of course, if you set the capacity slack from null (0) to 5, then it will work, but for this, no SlackVar is needed. In summary, SlackVar does not seem to affect the outcomes in any way.
`from future import print_function
import math
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2
def euclid_distance(x1, y1, x2, y2):
# Euclidean distance between points.
dist = math.sqrt((x1 - x2)**2 + (y1 - y2)**2)
return dist
def create_distance_matrix(locations):
# Create the distance matrix.
size = len(locations)
dist_matrix = {}
for from_node in range(size):
    dist_matrix[from_node] = {}
    for to_node in range(size):
        x1 = locations[from_node][0]
        y1 = locations[from_node][1]
        x2 = locations[to_node][0]
        y2 = locations[to_node][1]
        dist_matrix[from_node][to_node] = euclid_distance(x1, y1, x2, y2)
return dist_matrix

def create_data_model():
"""Creates the data for the example."""
data = {}
# Array of distances between locations.
_locations = [
(0, 0),
(0, 0)]
capacities = 25
_distances = create_distance_matrix(_locations)
demands = [
0,
-5]
data["distances"] = _distances
data["num_locations"] = len(_distances)
data["num_vehicles"] = 1
data["depot"] = 0
data["demands"] = demands
data["vehicle_capacities"] = capacities
return data
def create_distance_callback(data):
"""Creates callback to return distance between points."""
distances = data["distances"]
def distance_callback(from_node, to_node):
    """Returns the manhattan distance between the two nodes"""
    return distances[from_node][to_node]
return distance_callback

def create_demand_callback(data):
"""Creates callback to get demands at each location."""
def demand_callback(from_node, to_node):
del to_node
return data["demands"][from_node]
return demand_callback
def add_capacity_constraints(routing, data, demand_callback):
"""Adds capacity constraint"""
capacity = "Capacity"
routing.AddDimension(
demand_callback,
0,  # null capacity slack
data["vehicle_capacities"],  # vehicle maximum capacities
True,  # start cumul to zero
capacity)
# Add Slack for reseting to zero unload depot nodes.
# e.g. vehicle with load 10/15 arrives at node 1 (depot unload)
# so we have CumulVar = 10(current load) + -15(unload) + 5(slack) = 0.
capacity_dimension = routing.GetDimensionOrDie(capacity)
for node_index in [1]:
index = routing.NodeToIndex(node_index)
capacity_dimension.SlackVar(index).SetRange(0, 5)
def print_solution(data, routing, assignment):
"""Print routes on console."""
total_dist = 0
for vehicle_id in range(data["num_vehicles"]):
index = routing.Start(vehicle_id)
plan_output = 'Route for vehicle {0}:\n'.format(vehicle_id)
route_dist = 0
route_load = 0
while not routing.IsEnd(index):
node_index = routing.IndexToNode(index)
next_node_index = routing.IndexToNode(assignment.Value(routing.NextVar(index)))
route_dist += routing.GetArcCostForVehicle(node_index, next_node_index, vehicle_id)
route_load += data["demands"][node_index]
plan_output += ' {0} Load({1}) -> '.format(node_index, route_load)
index = assignment.Value(routing.NextVar(index))
    node_index = routing.IndexToNode(index)
    total_dist += route_dist
    plan_output += ' {0} Load({1})\n'.format(node_index, route_load)
    plan_output += 'Distance of the route: {0}m\n'.format(route_dist)
    plan_output += 'Load of the route: {0}\n'.format(route_load)
    print(plan_output)
print('Total Distance of all routes: {0}m'.format(total_dist))

def main():
"""Entry point of the program"""
# Instantiate the data problem.
data = create_data_model()
# Create Routing Model
routing = pywrapcp.RoutingModel(
data["num_locations"],
data["num_vehicles"],
data["depot"])
# Define weight of each edge
distance_callback = create_distance_callback(data)
routing.SetArcCostEvaluatorOfAllVehicles(distance_callback)
# Add Capacity constraint
demand_callback = create_demand_callback(data)
add_capacity_constraints(routing, data, demand_callback)
# Setting first solution heuristic (cheapest addition).
search_parameters = pywrapcp.RoutingModel.DefaultSearchParameters()
search_parameters.first_solution_strategy = (
routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC)
# Solve the problem.
assignment = routing.SolveWithParameters(search_parameters)
if assignment:
print_solution(data, routing, assignment)
else:
print('No solution has been found')
if name == 'main':
main()`

SlackVar does not seem to work at all. Below is a simple example with a depot and one node. They have demands of 0 and -5 respectively. Now set the SlackVar to any range, and it won't allow the solution 0Load(0) -> 1Load(-5) -> 0Load(-5). Of course, if you set the capacity slack from null (0) to 5, then it will work, but for this, no SlackVar is needed. In summary, SlackVar does not seem to affect the outcomes in any way.
from __future__ import print_function
import math
from ortools.constraint_solver import pywrapcp
from ortools.constraint_solver import routing_enums_pb2

def euclid_distance(x1, y1, x2, y2):
    # Euclidean distance between points.
    dist = math.sqrt((x1 - x2)**2 + (y1 - y2)**2)
    return dist

def create_distance_matrix(locations):
    # Create the distance matrix.
    size = len(locations)
    dist_matrix = {}

    for from_node in range(size):
        dist_matrix[from_node] = {}
        for to_node in range(size):
            x1 = locations[from_node][0]
            y1 = locations[from_node][1]
            x2 = locations[to_node][0]
            y2 = locations[to_node][1]
            dist_matrix[from_node][to_node] = euclid_distance(x1, y1, x2, y2)
    return dist_matrix

def create_data_model():
    """Creates the data for the example."""
    data = {}
    # Array of distances between locations.
    _locations = [
        (0, 0),
        (0, 0)]
    capacities = 25
    _distances = create_distance_matrix(_locations)
    demands = [
        0,
        -5]
    data["distances"] = _distances
    data["num_locations"] = len(_distances)
    data["num_vehicles"] = 1
    data["depot"] = 0
    data["demands"] = demands
    data["vehicle_capacities"] = capacities
    return data

def create_distance_callback(data):
    """Creates callback to return distance between points."""
    distances = data["distances"]

    def distance_callback(from_node, to_node):
        """Returns the manhattan distance between the two nodes"""
        return distances[from_node][to_node]
    return distance_callback

def create_demand_callback(data):
    """Creates callback to get demands at each location."""
    def demand_callback(from_node, to_node):
        del to_node
        return data["demands"][from_node]
    return demand_callback

def add_capacity_constraints(routing, data, demand_callback):
    """Adds capacity constraint"""
    capacity = "Capacity"
    routing.AddDimension(
        demand_callback,
        0,  # null capacity slack
        data["vehicle_capacities"],  # vehicle maximum capacities
        True,  # start cumul to zero
        capacity)
    # Add Slack for reseting to zero unload depot nodes.
    # e.g. vehicle with load 10/15 arrives at node 1 (depot unload)
    # so we have CumulVar = 10(current load) + -15(unload) + 5(slack) = 0.
    capacity_dimension = routing.GetDimensionOrDie(capacity)
    for node_index in [1]:
        index = routing.NodeToIndex(node_index)
        capacity_dimension.SlackVar(index).SetRange(0, 5)

def print_solution(data, routing, assignment):
    """Print routes on console."""
    total_dist = 0
    for vehicle_id in range(data["num_vehicles"]):
        index = routing.Start(vehicle_id)
        plan_output = 'Route for vehicle {0}:\n'.format(vehicle_id)
        route_dist = 0
        route_load = 0
        while not routing.IsEnd(index):
            node_index = routing.IndexToNode(index)
            next_node_index = routing.IndexToNode(assignment.Value(routing.NextVar(index)))
            route_dist += routing.GetArcCostForVehicle(node_index, next_node_index, vehicle_id)
            route_load += data["demands"][node_index]
            plan_output += ' {0} Load({1}) -> '.format(node_index, route_load)
            index = assignment.Value(routing.NextVar(index))

        node_index = routing.IndexToNode(index)
        total_dist += route_dist
        plan_output += ' {0} Load({1})\n'.format(node_index, route_load)
        plan_output += 'Distance of the route: {0}m\n'.format(route_dist)
        plan_output += 'Load of the route: {0}\n'.format(route_load)
        print(plan_output)
    print('Total Distance of all routes: {0}m'.format(total_dist))

def main():
    """Entry point of the program"""
    # Instantiate the data problem.
    data = create_data_model()
    # Create Routing Model
    routing = pywrapcp.RoutingModel(
        data["num_locations"],
        data["num_vehicles"],
        data["depot"])
    # Define weight of each edge
    distance_callback = create_distance_callback(data)
    routing.SetArcCostEvaluatorOfAllVehicles(distance_callback)
    # Add Capacity constraint
    demand_callback = create_demand_callback(data)
    add_capacity_constraints(routing, data, demand_callback)
    # Setting first solution heuristic (cheapest addition).
    search_parameters = pywrapcp.RoutingModel.DefaultSearchParameters()
    search_parameters.first_solution_strategy = (
        routing_enums_pb2.FirstSolutionStrategy.PATH_CHEAPEST_ARC)
    # Solve the problem.
    assignment = routing.SolveWithParameters(search_parameters)
    if assignment:
        print_solution(data, routing, assignment)
    else:
        print('No solution has been found')

if __name__ == '__main__':
    main()

CumulVar must be positive or zero, if you want ot use negative value you need to have positive SlackVar to compensate...

did you try the sample:
https://github.com/google/or-tools/blob/master/ortools/constraint_solver/samples/cvrp_reload.py
see #862

Above slackVar is set to the range of 0 and capacity (25). The vrp_reload example has the same issue.  A truck will only return the the dummy depots if it's capacity is exactly full. If you use the above locations, demands and capacity in the vrp_reload example it will also fail to find a route.

Ikillora... Mizux is correct, cumulvar cannot be negative is your example so the expected solution with Slack would be
0Load(0) -> 1Load(0) -> 0Load(0).
But the fact that this isn't working also shows that this slackVar method shown in vrp_reload does not work correctly. Mizux, would really appreciate your help on this issue.

@Mizux, what work is SlackVar doing in the routing.cc file and, specifically, in the FeasibleRoute function (provided below)?
bool FeasibleRoute(const std::vector<int>& route, int64 route_cumul,
                 int dimension_index) {
const RoutingDimension& dimension = *dimensions_[dimension_index];
std::vector<int>::const_iterator it = route.begin();
int64 cumul = route_cumul;
while (it != route.end()) {
  const int previous = *it;
  const int64 cumul_previous = cumul;
  gtl::InsertOrDie(&(new_possible_cumuls_[dimension_index]), previous,
                   cumul_previous);
  ++it;
  if (it == route.end()) {
    return true;
  }
  const int next = *it;
  int64 available_from_previous =
      cumul_previous + dimension.GetTransitValue(previous, next, 0);
  int64 available_cumul_next =
      std::max(cumuls_[dimension_index][next], available_from_previous);

  const int64 slack = available_cumul_next - available_from_previous;
  if (slack > dimension.SlackVar(previous)->Max()) {
    available_cumul_next =
        available_from_previous + dimension.SlackVar(previous)->Max();
  }

  if (available_cumul_next > dimension.CumulVar(next)->Max()) {
    return false;
  }
  if (available_cumul_next <= cumuls_[dimension_index][next]) {
    return true;
  }
  cumul = available_cumul_next;
}
return true;
}

@Mizux Hey, do you have any more input on this? We are still blocked by this issue. I've tested on every available example using capacity slack and they all have the same issue. The truck will only return to dummy depot when the capacity of the node matches the load in the truck exactly.
in the cvrp_reload.py example, removing the following line has no effect. And If you increase the capacity to 17 it will start dropping nodes.
capacity_dimension.SlackVar(index).SetRange(0, vehicle_capacity)
I hope you can help with this, thanks!

@quinlivanb
there is another way to model that:
instead of setting 0 slack in the dimension and providing a range of slack for dummy node,
we can set max slack in the dimension, and set 0 slack for non-dummy nodes.
if you update the add_capacity_constraints to this, it works:
def add_capacity_constraints(routing, data, demand_callback):
    """Adds capacity constraint"""
    capacity = "Capacity"
    routing.AddDimension(
        demand_callback,
        data["vehicle_capacities"],  # null capacity slack
        data["vehicle_capacities"],  # vehicle maximum capacities
        True,  # start cumul to zero
        capacity)
    # Add Slack for reseting to zero unload depot nodes.
    # e.g. vehicle with load 10/15 arrives at node 1 (depot unload)
    # so we have CumulVar = 10(current load) + -15(unload) + 5(slack) = 0.
    capacity_dimension = routing.GetDimensionOrDie(capacity)
    for node_index in range(routing.nodes()):
        index = routing.NodeToIndex(node_index)
        if node_index in [1]:
            continue
        capacity_dimension.SlackVar(index).SetValue(0)
        routing.AddVariableMinimizedByFinalizer(capacity_dimension.CumulVar(index))

you may also need to update print_solution function
Output:
Route for vehicle 0:
 0 Load(0) ->  4 Load(20) ->  1 Load(-5) ->  2 Load(5) ->  3 Load(15) ->  0 Load(15)
Distance of the route: 380m
Load of the route: 15

Total Distance of all routes: 380m

Downside of this way of modeling:
Sometimes you may see vehicle visiting dummy node/reloading when it may not  be required. However, it is not very frequent.

Guys, any updates on this?

Poking around, perhaps this line is the problem (https://github.com/google/or-tools/blob/master/ortools/constraint_solver/routing.cc#L5616)
    if (slack_max == 0) {
      slacks_[i] = solver->MakeIntConst(0);
    } else {
      slacks_[i] = solver->MakeIntVar(0, slack_max, slack_name);
      transit_expr = solver->MakeSum(slacks_[i], transit_expr);
    }

So in the original way, slack_max is zero in the definition of the dimension.  So there are two issues.  First, the slack is never taken into account in the transit_expr.  And second, according to expressions.cc, line 2576 or so, calling "SetRange" on a IntConst variable doesn't quite do what its name might imply:
class IntConst : public IntVar {
public:
IntConst(Solver* const s, int64 value, const std::string& name = "")
: IntVar(s, name), value_(value) {}
~IntConst() override {}
...
void SetRange(int64 l, int64 u) override {
if (l > value_ || u < value_) {
solver()->Fail();
}
}

In the rearranging way suggested by @270ajay the slack_max is not zero, so the slacks_[i] array are all IntVar's with a range from 0 to max, which ends up being a ` DomainIntVar`, not `IntConst`, *and* the transit expression actually cares about the value of the slack variable.  The implementation of SetRange for DomainIntVar actually *does* do what you think it does.

So I think this is a bug.  Not sure how to fix it though, other than to change the example to be like @270ajay suggestion?

Note that you can't just say
if (slack_max == 0) {
    slacks_[i] = solver->MakeIntVar(0, slack_max, slack_name);
    transit_expr = solver->MakeSum(slacks_[i], transit_expr);
}

because MakeIntVar right away has the optimization that any range of 0 is immediately an IntConst value:
IntVar* Solver::MakeIntVar(int64 min, int64 max, const std::string& name) {
  if (min == max) {
    return MakeIntConst(min, name);
  }
  if (min == 0 && max == 1) {
    return RegisterIntVar(RevAlloc(new ConcreteBooleanVar(this, name)));
  } else if (CapSub(max, min) == 1) {
    const std::string inner_name = "inner_" + name;
    return RegisterIntVar(
        MakeSum(RevAlloc(new ConcreteBooleanVar(this, inner_name)), min)
            ->VarWithName(name));
  } else {
    return RegisterIntVar(RevAlloc(new DomainIntVar(this, min, max, name)));
  }
}

Which again means you can't go back in after the fact and change the min and max of this constant value.

Hello guys, any news about this?
I have a slightly different use-case where I need recharge when the vehicle cumulative distance exceeds some threshold (so the capacities are defined over the arcs rather than the nodes).
https://github.com/google/or-tools/issues/1624

Are there any updates on how to deal with the problem?

Hi, are there any updates on this issue?

@quinlivanb
there is another way to model that:
instead of setting 0 slack in the dimension and providing a range of slack for dummy node,
we can set max slack in the dimension, and set 0 slack for non-dummy nodes.
if you update the add_capacity_constraints to this, it works:
def add_capacity_constraints(routing, data, demand_callback):
    """Adds capacity constraint"""
    capacity = "Capacity"
    routing.AddDimension(
        demand_callback,
        data["vehicle_capacities"],  # null capacity slack
        data["vehicle_capacities"],  # vehicle maximum capacities
        True,  # start cumul to zero
        capacity)
    # Add Slack for reseting to zero unload depot nodes.
    # e.g. vehicle with load 10/15 arrives at node 1 (depot unload)
    # so we have CumulVar = 10(current load) + -15(unload) + 5(slack) = 0.
    capacity_dimension = routing.GetDimensionOrDie(capacity)
    for node_index in range(routing.nodes()):
        index = routing.NodeToIndex(node_index)
        if node_index not in [1]:
            capacity_dimension.SlackVar(index).SetValue(0)
        routing.AddVariableMinimizedByFinalizer(capacity_dimension.CumulVar(index))

you may also need to update print_solution function
Output:
Route for vehicle 0:
 0 Load(0) ->  4 Load(20) ->  1 Load(-5) ->  2 Load(5) ->  3 Load(15) ->  0 Load(15)
Distance of the route: 380m
Load of the route: 15

Total Distance of all routes: 380m

Downside of this way of modeling:
Sometimes you may see vehicle visiting dummy node/reloading when it may not be required. However, it is not very frequent.

This workaround worked for me in java, although I had to increase the distance between depots to avoid the mentioned downside.

Thank you for your quick response. I also saw this one, but I hoped there is something new available.
Based on your experience, what is a good distance value between dummy nodes and the rest of the nodes?

That depends really. I am still testing and instead of distances i have time windows. For now i have set it so that going from a depot to another depot will hit one of my time window constraints. For more info see [https://developers.google.com/optimization/routing/vrptw]

Any update on this?
For the time being, I am just adding some offset to the vehicle capacity compared to the depot capacity... And this works but, the amount of offset is just intuitive.

Updating my previous comment, the link should now be https://github.com/google/or-tools/blob/master/ortools/constraint_solver/routing.cc#L5797
This just came up again in the response to issue #1891 and on the follow-up on the mailing list.
I think maybe the code should fail rather than succeeding when trying to call SetRange(a,b) on an IntConst.
At  https://github.com/google/or-tools/blob/master/ortools/constraint_solver/expressions.cc#L2571, maybe the code should be
  void SetRange(int64 l, int64 u) override {
      solver()->Fail();
  }

Why?  Because if you call set range on an IntConst, the caller probably thinks that the full range is available, but instead it will just be the single value.
Or promote the IntConst to IntVar
But silently succeeding is leading to mystery bugs


More details about Django MVT

More details about Django MVT

[ ] I have read freeCodeCamp's contribution guidelines.
[ ] My pull request has a descriptive title (not a vague title like Update index.md)
[ ] My pull request targets the master branch of freeCodeCamp.
[ ] None of my changes are plagiarized from another source without proper attribution.
[ ] My article does not contain shortened URLs or affiliate links.

If your pull request closes a GitHub issue, replace the XXXXX below with the issue number.
Closes #XXXXX

Closed and Reopened this PR to attempt to resolve a specific Travis build failure.

Thank you for opening this pull request.
This is a standard message notifying you that we’ve reviewed your pull request and have decided not to merge it. Your content appears to be taken directly from https://www.tutorialspoint.com/django/django_overview.htm without paraphrasing and citing the source.
Thank you and happy coding.


Add device type model

Change the device type in all models to the new resource references (device_type endpoint)
Change-type: minor
Signed-off-by: Trong Nghia Nguyen<EMAIL_ADDRESS>

LGTM
Feel free to self-certify regardless of my comments :+1:

@balena-ci I self-certify!


[Freshness] US-1953530: Refresh top articles by PV - .NET and Languages Content (2)

Created this PR for user story-1953530's next 10 articles. Validated the content for freshness and accuracy.
User story link: https://dev.azure.com/mseng/TechnicalContent/_workitems/edit/1953530/

Please note: This PR is still a work in progress. It's not ready for review. I'll mark it as "Ready for review" once all the updates are done.
Thank you!

Hello @mcleblanc,
I've completed my work on the next 10 articles and created this pull request for your final review/approval. If you have questions or feedback, please add it as a comment in the PR. The standard review period is 10 business days. :)
User story link: https://dev.azure.com/mseng/TechnicalContent/_workitems/edit/1953530
Thank you,
Pooja

Hello @tdykstra,
Thank you for you feedback. I have implemented them. Could you please have a look at the changes and provide your final approval/feedback for sign-off?
Best regards,
Pooja

Hello @tdykstra,
Thank you for the approval. Could you please have a look at the latest changes and provide your approval for sign-off?
Best regards,
Pooja

Hello @mcleblanc @adegeo @gewarren @IEvangelist,
Could you please have a look at the changes and provide your final approval/feedback for sign-off?
Best regards,
Pooja

Could you please have a look at the latest changes and provide your approval for sign-off?

The latest changes look good. But all of the conversations need to be resolved before we can merge the PR. You can just go through and click the Resolve Conversation button for each one if there's nothing more to be done.  We should also address the comments from @adegeo before merging.

Hello @mcleblanc @adegeo @gewarren @IEvangelist,
Could you please have a look at the changes and provide your final approval/feedback for sign-off?
Best regards,
Pooja


Reduce Binary sizes

There are a lot of things we can do in the longer term to help this. We can split out the crates into multiple separate crates like psbt, interpreter, descriptor and policy. This would reduce the compilation time and memory usage by offering flexibility.
As pointed by benma , this is because we use a lot of generics. In particular, almost every single function is being monomorphized for each Ctx.
There are 4 types of Contexts (Bare, Legacyp2sh, Segwitv0, Taproot) that are compiled for each descriptor method. One idea might be to define Terminal without the Context. Guard Miniscript with appropriate Context while in the constructor Miniscript::from_ast. This should significantly reduce the code duplication and have a good impact on binary sizes.
Originally posted by @sanket1729 in https://github.com/rust-bitcoin/rust-miniscript/issues/584#issuecomment-1657796630

Using a third party tool cargo-bloat, indeed monomorphization is the cause for this.
sanket1729:~/rust-miniscript/examples$ cargo bloat --release --example parse -n 100 --filter=miniscript --full-fn
    Finished release [optimized] target(s) in 0.02s
    Analyzing target/release/examples/parse

File .text     Size      Crate Name
0.2%  1.5%   9.9KiB miniscript miniscript::miniscript::astelem::<impl miniscript::expression::FromTree for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::from_tree::hf7cabd7b5ae86e5f
0.2%  1.4%   9.7KiB miniscript miniscript::miniscript::astelem::<impl miniscript::expression::FromTree for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::from_tree::h252a38afb9bfe9a7
0.2%  1.4%   9.5KiB miniscript miniscript::miniscript::astelem::<impl miniscript::expression::FromTree for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::from_tree::hc8530801dfa8e9a7
0.2%  1.4%   9.5KiB miniscript miniscript::miniscript::astelem::<impl miniscript::expression::FromTree for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::from_tree::h1e2d92ae3f2f5e67
0.1%  0.8%   5.7KiB miniscript miniscript::descriptor::tr::Tr<Pk>::script_pubkey::h411db1856768cd27
0.1%  0.6%   4.1KiB miniscript miniscript::miniscript::astelem::<impl miniscript::miniscript::decode::Terminal<Pk,Ctx>>::encode::hc780c981e4af3066
0.1%  0.6%   4.1KiB miniscript miniscript::miniscript::astelem::<impl miniscript::miniscript::decode::Terminal<Pk,Ctx>>::encode::ha6bb98535a3f1d23
0.1%  0.6%   4.1KiB miniscript miniscript::miniscript::astelem::<impl miniscript::miniscript::decode::Terminal<Pk,Ctx>>::encode::h1b1c4ea55afdf05a
0.1%  0.6%   4.1KiB miniscript miniscript::miniscript::astelem::<impl miniscript::miniscript::decode::Terminal<Pk,Ctx>>::encode::h1048523d61cd6482
0.1%  0.5%   3.4KiB miniscript <miniscript::miniscript::types::extra_props::ExtData as miniscript::miniscript::types::Property>::type_check::he0e005cc44ffaef5
0.1%  0.5%   3.4KiB miniscript <miniscript::miniscript::types::extra_props::ExtData as miniscript::miniscript::types::Property>::type_check::he0bb0bb03a8c988f
0.1%  0.5%   3.4KiB miniscript <miniscript::miniscript::types::extra_props::ExtData as miniscript::miniscript::types::Property>::type_check::hbbe183b46053f973
0.1%  0.5%   3.4KiB miniscript <miniscript::miniscript::types::extra_props::ExtData as miniscript::miniscript::types::Property>::type_check::h55cf55507009c200
0.1%  0.5%   3.3KiB miniscript <miniscript::miniscript::types::extra_props::ExtData as miniscript::miniscript::types::Property>::threshold::h39405ea660688245
0.0%  0.4%   2.7KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Debug for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::hfddb3b009d985bde
0.0%  0.4%   2.7KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Debug for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::hec23b10ddd3645d9
0.0%  0.4%   2.7KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Debug for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::h9565457e0b0a55fb
0.0%  0.4%   2.7KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Debug for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::h70d98cbd16a857a4
0.0%  0.4%   2.6KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Display for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::hd6a050c95d1e7fe8
0.0%  0.4%   2.6KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Display for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::ha71ff389c9451f69
0.0%  0.4%   2.6KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Display for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::h3746c006146980ea
0.0%  0.4%   2.6KiB miniscript miniscript::miniscript::astelem::<impl core::fmt::Display for miniscript::miniscript::decode::Terminal<Pk,Ctx>>::fmt::h0e36d10483a7a138
0.0%  0.3%   2.3KiB miniscript <miniscript::descriptor::sh::Sh<Pk> as miniscript::expression::FromTree>::from_tree::h3c9003188cff6c2f
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::hd7747b9cffabb885
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::hcbfa9735205d40e0
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::hcbdb9973dc3d68f2
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::hb542b64ed9dfb13a
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::h52e2a33bf426f7a2
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::h4632dba594469034
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::h2d918fc43f86a047
0.0%  0.3%   2.3KiB miniscript <miniscript::miniscript::types::Type as miniscript::miniscript::types::Property>::type_check::h2b30d3216ca1a7e1
0.0%  0.3%   1.9KiB miniscript miniscript::descriptor::tr::parse_tr_tree::h5af334089dd0a672
0.0%  0.3%   1.7KiB miniscript miniscript::expression::Tree::from_slice_delim::h90458f5ec70f5178
0.0%  0.2%   1.7KiB miniscript <miniscript::Error as core::fmt::Display>::fmt::h956f32630aa2fbc9
0.0%  0.2%   1.6KiB miniscript miniscript::descriptor::sortedmulti::SortedMultiVec<Pk,Ctx>::from_tree::hc38bac7d923f53d7
0.0%  0.2%   1.6KiB miniscript miniscript::descriptor::sortedmulti::SortedMultiVec<Pk,Ctx>::from_tree::h818f876f47b01283
0.0%  0.2%   1.5KiB miniscript <miniscript::descriptor::segwitv0::Wsh<Pk> as miniscript::expression::FromTree>::from_tree::h92504036f8ccce01
0.0%  0.2%   1.3KiB miniscript <miniscript::miniscript::types::extra_props::ExtData as miniscript::miniscript::types::Property>::and_or::h7952c25db21933df
0.0%  0.2%   1.3KiB miniscript miniscript::descriptor::tr::Tr<Pk>::parse_tr_script_spend::h34f82b5731bf960d

Removing monomorphization for the script context would be very welcome, I hope you can work on it soon.
Any thoughts about removing the Ctx type param in favor of dynamic dispatch, or maybe even passing the context as a simple enum argument?

Any thoughts about removing the Ctx type param in favor of dynamic dispatch

Let's see how much mileage we could get out of reducing monomorphization by moving it to the edges. Dynamic dispatch on every single descriptor-related function would be a pretty heavy price to pay I think.
I'm also not totally sure, technically, if we could do it. If all our uses of Ctx are done by calling functions on the Ctx itself that's straightforward but if we've got impl blocks on e.g. Descriptor<Ctx> for specific Ctx values that would require some refactoring.

@sanket1729 do you plan to pick this up? It would be very helpful now that minitapscript was merged to Bitcoin Core. I already use the Segwitv0 context and want to also use the Taproot context, but it adds too much binary code while I would expect the difference to be quite minimal.

@benma, I will take a stab at this today.

@sanket1729 how did it go? :smile:

@benma, not good. This was more invasive than I anticipated. I am still working on it.
@apoelstra, this is what I am attempting at a high level.

Change all the internal functions from Minsicript<Pk, Ctx> to MsUnchecked.  Introduce APIs to convert from MsUnchecked<Pk> to Miniscript<Pk, Ctx>.
Our type checking currently is dependent on ScriptContext (some fragments are allowed in some contexts, different resource limit constraints, x-only, compressed etc). Instead of having a Ctx generic parameter, we will use a ScriptContext enum parameter to help with type checking.
Where required introduce context specific functions. For example,

#[derive(Clone)]
pub struct MsUnChecked<Pk: MiniscriptKey> {
    /// A node in the AST.
    pub node: Terminal<Pk>,
    /// The correctness and malleability type information for the AST node.
    pub ty: types::Type,
    /// Additional information helpful for extra analysis.
    pub ext: types::extra_props::ExtData,
}

#[derive(Clone)]
pub struct Miniscript<Pk: MiniscriptKey, Ctx: ScriptContext> {
    /// A node in the AST.
    pub inner: MsUnChecked<Pk>,
    /// Context PhantomData. Only accessible inside this crate
    phantom: PhantomData<Ctx>,
}

/// APIs that stay the same. Inside the same impl block Miniscript<Pk, Ctx>
impl Miniscript<Pk, Ctx> {
    fn encode(&self) -> Script {
       self.inner.encode()
    }
}

/// Special purpose APIs that are different for each context.
impl Miniscript<Pk, SegwitV0> {
   fn script_size(&self) -> usize {
      self.inner.script_size(Ctx::Segwitv0) // script_size would be function in MsUnchchecked that takes paramter instead of generic parametrization .
   }
}

@apoelstra, any comments on this approach?

@sanket1729 that sounds great! The hardest part (aside from this probably touching every single LOC in the library :)) sounds like the conversions. But maybe if our public API consists only of wrapper types, and all the recursive types stay as MsUnchecked and therefore don't need to be converted, it could work out.
Also cc #484 ... I think we're blocked on Rust language stuff to be able to move to a flat representation but wanted to remind people of that issue nonetheless. Since we're thinking about changing data representations.

Thanks for your hard work, just adding my experience here: I recently updated BDK in my project and the update also bumped rust-miniscript from v9.0.2 to v10.0.0. Between these two versions the code size for miniscript went from 72.0KiB to 129.7KiB!
Maybe before doing more "invasive" work just looking at the diff between these two versions could bring pretty big improvements..

@sanket1729 is there a way forward here? Would appreciate it. I am still kind of blocked from using additional contexts due to the binary bloat it incurs.


ComboBox popup location is not correct for the first time

Thanks for the great project, I love this project very much!
ComboBox popup is not showing in the correct location for the first time, please see my scrrenshot below, there was a big gap between ComboBox selector and the popup.

When I clicked the selector for the second time, it just show in the correct location.

Updated
It seems that this issue only occurred when there's not enough space at the bottom of the window, and it will pop up to the top of the CombBox, it also occurred for the first time show.

Sorry, but it looks like JavaFX bug to me. There're many like this one JDK-8170972, JDK-8146180. Could you please check it with default Modena theme?

This is a JavaFX bug, I can reproduce it with Modena theme. Unfortunately, this haven't been fixed with OpenJFX 17.0.7, and it seems this was not fixed with OpenJFX 21-ea+24 either.
Please close this issue as it was not AtlantaFX bug, sorry for the inconvenience.


Replace fmt.Errorf w/ errors.New where applicable [phab:D316]

Created by schroederc at 2015-06-04 19:16:41:

shahms accepted this revision at 2015-06-04 19:29:36

schroederc closed via commit e9077c4ad798ce80cfa8ba8430a8e906fbc24225 at 2015-06-04 20:39:01


[bugfix] fix OpenAPI method filtering predicate

Description
Now, this is embarrassing. I was testing code for #744 on different env from where it was committed, and I somehow lost return.
Contribution Checklist:

[x] The pull request only addresses one issue or adds one feature.
[x] The pull request does not introduce any breaking changes
[ ] I have added screenshots or gifs to help explain the change if applicable.
[x] I have read the contribution guidelines.
[x] Create an issue and link to the pull request.

No worries @aviskase :)
Merged !


WAI-ARIA

Although you develop a great product --- I see you're still implementing invalid ARIA attributes. For example for the carousel

Required children not present role="option". But if you add this child element it can contain no active elements. So remove role listbox and wrap the carousel in a role region with an aria-label or aria-labelledby. No other aria is required. Additionally the carousel should pause on focus and mouseover.
You use role button on the anchors but they are not triggered by the spacebar as expected for a button element, only enter key.
There are other issues in relation to accessibility for most of the functionality.
Just saying :-)

We are open for PRs to improve our accessibility do not hesitate @Decrepidos 👍

role="listbox" has already been removed in https://github.com/twbs/bootstrap/pull/22405
more tweaks are planned for this component. admittedly, the carousel is the worst offender at this point (mainly because there's no absolutely "correct" way of doing a carousel, since it's a widget that doesn't immediately map to an equivalent native widget nor ARIA pattern)

i'll close this issue for now, but rest assured that all of the current shortcomings of the carousel are on my radar to be tackled :)

Thanks for the reply and update 😁


Fix async start bug(OUI), fix junk records(failover dhcp cluster)

When Glass starting, OUI base not loaded, cause concurency. Therefore the vendor is not defined.

When you have failover dhcp cluster, there is many junk records.

Nice one. Works great. Shame nobody is maintaining this repo.


Addressing #8

Using system execution status to test whether a system command exists. Fixes issue https://github.com/kul-forbes/nmpc-codegen/issues/8.
Note: I should have created the issue in this repository. Sorry about that.

You can't use contains, it's only supported in most recent version. It used to be contains and was changed to support older Matlab versions.

@Zilleplus OK, I changed it back to available = ~isempty(strfind(cmdout,pattern));

thanks, i merged it.


Update block generation constants in wallet_bumpfee

Remove early block generation by RBF node (introduced earlier in 1.21 cycle).
Increase block generation values from original test, to meet Dogecoin coinbase maturity requirements.

Alternative to #2115

@rnicoll  I like the updates. Is there an easier way to contact you ? To discuss development stages & make this easier to communicate ?

@carloviscusi GitHub is generally good, because I don't want to end up as a communication hub. If you're looking for tasks we need help with, please see https://github.com/dogecoin/dogecoin/projects/4 . https://github.com/dogecoin/dogecoin/pull/2111 (the contributions guide) might also be helpful

Closing & reopening to trigger Travis

Hey Ross, is this still an issue? If it's still timing out I can take a look at it as well.


redo bank system

at the moment, it's a mess. needs revamping.
it was originally done by @CnRXoMoX

done in 6340082aa37f824e3b34903a71d45a0e45bb1512

done in 6340082aa37f824e3b34903a71d45a0e45bb1512


feat(banner): add the hb.header.banner.navbar_opacity parameter

Only works if transparentize_navbar_bg is false, default to 0.8.

/CC @pleasantone, FYI, there is some changes on banner you may want to know.
With new releases of banner, the opacity will be 0.8 by default when transparentize_navbar_bg is false.

If you don't want this, please set hb.header.banner.navbar_opacity as 1.

Thanks for the warning!


Dashboard module for Offline

Missing this module.

We'll make sure to include it when we make the new dashboard for OWF!


Minecraft PE 1.0.0 worlds are not supported

There are empty world after opening MCPE 1.0.0 world

As mentionned int MCEdit title bar, the compatibility for PE is limited to 0.11.
Actually, you can load PE 0.11 worlds, but saving them may cause MCEdit crashes, and, possibly, save corruption.
We regret this, but we currently lack information about this game data format (and testers).
You may want to send us your world, so we can see what happens, but I can't offer any warranty we can fix the issue, badly...
You can also send us the log file (located in your MCEdit install folder), and a copy or screenshot of the program console messages (the black window which pops up when your start MCEdit).

Here's a world. The new 256 building height limit is causing problems.
https://www.dropbox.com/s/2g0t6cs5yz6fvac/IaEDAEKL0QM%3D.zip?dl=0

I should add that an older world will open but any chunk that has been edited by 1.0 appears blank.

I'd like to volunteer as a tester. I have pe and basic development knowledge (spent all day yesterday trying to get leveldb-mcpe running on genisys, no luck, seems to only compile on Windows :/ )

@LaChal maybe you want to look at what PM&MiNet did for 1.0.0. The format is more like anvil now.

Thank you for your information :smile:
The PE support could be recompiled on Windows and Linux, and we can open and see parts of the world.
We're now fighting with the subchunk format data and access.

Here is some information about our progress: https://github.com/Khroki/MCEdit-Unified/issues/676#issuecomment-279105921

More advancement has been done on this topic.
PE 1.0 (and 1.1) shall be supported now.
If you still have issues, just reopen. (And search in the other issues, even closed.)


Refactoring teletraan auto scaling code

Refactoring auto scaling related code to use one aws auto scaling client.
@sbaogang @yujunglo

Thanks for refactoring!


Broadcast error when viewing ome-zarr data

7d288e5c37a2c46c3ca3f4c31d8a3f51a4603797 / #1673 broke viewing ome-zarr multiscale data. I'm not sure yet what exactly is broken. Reproducible example (requires pip install ome-zarr):
import napari

with napari.gui_qt():
    v = napari.Viewer()
    v.open('https://s3.embassy.ebi.ac.uk/idr/zarr/v0.1/6001240.zarr')

Results in:
Traceback (most recent call last):
  File "/home/jni/miniconda3/envs/all/lib/python3.8/site-packages/vispy/app/backends/_qt.py", line 825, in paintGL
    self._vispy_canvas.events.draw(region=None)
  File "/home/jni/miniconda3/envs/all/lib/python3.8/site-packages/vispy/util/event.py", line 455, in __call__
    self._invoke_callback(cb, event)
  File "/home/jni/miniconda3/envs/all/lib/python3.8/site-packages/vispy/util/event.py", line 473, in _invoke_callback
    _handle_exception(self.ignore_callback_errors,
  File "/home/jni/miniconda3/envs/all/lib/python3.8/site-packages/vispy/util/event.py", line 471, in _invoke_callback
    cb(event)
  File "/home/jni/projects/napari/napari/_qt/qt_viewer.py", line 673, in on_draw
    layer._update_draw(
  File "/home/jni/projects/napari/napari/layers/base/base.py", line 771, in _update_draw
    level, corners = compute_multiscale_level_and_corners(
  File "/home/jni/projects/napari/napari/layers/utils/layer_utils.py", line 268, in compute_multiscale_level_and_corners
    level = compute_multiscale_level(
  File "/home/jni/projects/napari/napari/layers/utils/layer_utils.py", line 231, in compute_multiscale_level
    locations = np.argwhere(np.all(scaled_shape > shape_threshold, axis=1))
ValueError: operands could not be broadcast together with shapes (2,4) (2,)

Ok good to know, thanks!! I can look into tomorrow

@sofroniewn here's a reproducible example with just numpy:
import numpy as np
import napari

r0 = np.random.random((1, 2, 236, 275, 271))
r1 = np.random.random((1, 2, 236, 137, 135))

with napari.gui_qt():
    v = napari.view_image([r0, r1])


[E2E_baseline] Torchbench detectron2 series models accuracy test with AssertionError: get_event_storage() has to be called inside a 'with EventStorage(...)' context!

🐛 Describe the bug
Those detectron2 series models accuracy crash with AssertionError: get_event_storage() has to be called inside a 'with EventStorage(...)' context!

Model
Precision
Mode

detectron2_fasterrcnn_r_101_c4
fp32/bf16/fp16
training

detectron2_fasterrcnn_r_101_dc5
fp32/bf16/fp16
training

detectron2_fasterrcnn_r_101_fpn
fp32/bf16/fp16
training

detectron2_fasterrcnn_r_50_c4
fp32/bf16/fp16
training

detectron2_fasterrcnn_r_50_dc5
fp32/bf16/fp16
training

detectron2_fasterrcnn_r_50_fpn
fp32/bf16/fp16
training

detectron2_maskrcnn_r_101_c4
fp32/bf16/fp16
training

detectron2_maskrcnn_r_101_fpn
fp32/bf16/fp16
training

detectron2_maskrcnn_r_50_fpn
fp32bf16/fp16
training

Versions
Pytorch: git clone -b e2e-baseline https://github.com/etaf/pytorch-inductor-xpu pytorch
Test script: inductor_xpu_test.sh

Close it as we have refreshed baseline


Position of modal in mobile

Please see modal.
I think margin top need to be change.

Thanks for reporting this. I will find a way to solve this viewport problem

If scroll down, the button show up?

@PH7-Jack
Yes with scroll I can see buttons.

It is now fixed

Closing, if the bug persists, comment to reopen


PHP Agent

Hi.
I can see commits about a future PHP Agent ...
Is there some work in progress for this agent (specifications, experimental code) ?
I realy need this agnet and I'd like to contribute ..
What about writing a thrift driver for this Php Agent https://github.com/patrickallaert/php-apm ?
Thanks.
Oliver

Hi.
The PHP agent is being prepared. Please wait.

Glad to hear Php Agent is on the way.
Could you tell us more about the roadmap ?
Do you need testers ?
Thanks
Olivier

Hi,
Could you please tell us more about php agent (status / roadmap)
Thanks
Olivier

Hello, @ofauchon
Actually, pinpoint php agent is going to be released in anytime soon.
We are in the discussion on where to release the project.
By the way, I think agent tests will be needed for the team that is leading the project.
Hope that you can help them with it in the future.
I'll make sure you get the notice when the agent is open.

hi~
Could you tell me how it is going~
Thanks

@xujunhai
It's getting ready to be open-sourced right now.
The exact date didn't come out yet. But I think it will be open in 1,2 weeks or so.
Currently, besides the opening schedule, Pinpoint PHP-Agent team and @ofauchon is contacting each other for the testing of the agent.

@RoySRose
Thank you , i'm looking forward to it.

Hi
Do you have news for the release, please ?
Olivier

Hi RoySRose,
We are trying to the last step which make users compile our agent easily.
If anybody is interest of our agent, please leave message here. We'll send him a pre-release agent.

@chenguoxi1985
i'm interest in it, can you send me a copy of the agent.
Thanks

@ChenGXQQ
I'm also interested in the agent. Can you send me a copy of the agent?Thank you very much!

@yhy-git Hi, the agent is public now. Please see here: https://github.com/naver/pinpoint-c-agent

Has someone managed to make php monitoring work? has performed the procedure


Remove https restriction for notifications

Notifications should also work on localhost, but since mailpit doesn't rely on the browser to check whether notifications are supported or not but instead does its own https verification, the option does not show up in the UI. Would be nice to remove this artifical restriction, happy to contribute! :)

Hi @jonaskuske. Actually the HTTPS requirement for notifications is a browser restriction, not a Mailpit one. I simply detect the HTTPS state to show/hide the subscription button (to the notifications) to prevent user confusion and browser warnings.
Where did you get your "should also work on localhost" information from?

On MDN itself! The page you linked has a link to secure contexts right at the top, which says this:

to show/hide the subscription button (to the notifications) to prevent user confusion and browser warnings

Makes absolute sense! I thought this would work just the same without the https check, as Notification.permission === "denied" on insecure contexts. However, turns out this is only the case on Chrome and Safari, in Firefox it is "default", so permission state isn't enough to determine support there. You can replace the https check with the well-supported property isSecureContext, though:
this.notificationsSupported = window.isSecureContext
  && ("Notification" in window && Notification.permission !== "denied");

You're absolutely correct, I did not realise localhost was exempt from HTTPS! Thanks, I've merged your PR. Now I need to make a couple of minor adjustments to related things (including URl displayed in the CLI and in-browser new mail notifications). I appreciate the info and effort, thank you.

I have just released this as part of v1.6.11 - sorry it took so long, I had a very busy week!


Extend ZFS documentation: Snapshots, sanoid

Adds the missing sections on snapshots and using sanoid to create and manage them. This should complete the ZFS documentation for now.

This is awesome, thank you. I wonder if it's worth seeing if we can do some sort of recommended Sanoid configuration that could configure an automated setup if people choose to use it...

What we could certainly consider is a standard media ZFS dataset ("share") for Plex/Emby/Jellyfish which then would then come with a set of Sanoid configuration lines. I'll open a new issue for that.


Merge MakeLists

Lin + Win

Fixed with: https://github.com/crezefire/cxp/commit/632d417f40f269484d021e538fed72127e0e1760
Works on Linux, might need to simplify things a bit more


SA1513 triggered in switch statement used as part of an operation

Hi,
I get SA1513 triggered in the case below. I'm asked by StyleCop to add a line after final bracket of the switch statement, but I'm expecting the rest of the operation to be inline after the bracket. Here's an example below reproduced in .NET Core 3.1 or .NET 5. Assuming Foo is an enum
    internal static int FooTest(Foo foo, int a)
        => foo switch
        {
            Foo.Bar => 1,
            Foo.Buzz => 2,
            _ => throw new InvalidOperationException(),
        } << a;

forces me to write:
    internal static int FooTest(Foo foo, int a)
        => foo switch
        {
            Foo.Bar => 1,
            Foo.Buzz => 2,
            _ => throw new InvalidOperationException(),
        }

        << a;

Similar issue happens with semicolon.
Having code like this:
throw result switch
{
	null => new Exception("b"),
	_ => new Exception("a"),
};

StyleCop (1.2.0-beta.321) suggest following fix:
throw result switch
{
	null => new Exception("b"),
	_ => new Exception("a"),
}

;

Similar issue happens with semicolon.
Having code like this:
throw result switch
{
	null => new Exception("b"),
	_ => new Exception("a"),
};

StyleCop (1.2.0-beta.321) suggest following fix:
throw result switch
{
	null => new Exception("b"),
	_ => new Exception("a"),
}

;

I get SA1513 triggered in the case below. (switch expression as part of binary expression)

At this time, I'm not planning to make a change for this case. My current recommendation is to assign the result of the switch expression to a local variable, and use that local variable in the expression. This may be altered in the future if particular non-problematic cases are identified, but each one would need to demonstrate clear and widespread wins for readability.

Similar issue happens with semicolon.

This one is a bug to fix.

I get SA1513 triggered in the case below. (switch expression as part of binary expression)

At this time, I'm not planning to make a change for this case. My current recommendation is to assign the result of the switch expression to a local variable, and use that local variable in the expression. This may be altered in the future if particular non-problematic cases are identified, but each one would need to demonstrate clear and widespread wins for readability.

Similar issue happens with semicolon.

This one is a bug to fix.

@sharwell, does it make sense to have an extra option (for example in stylecop.json) that would control the mandatory blank line between cases in switch?
Motivation - there is a feeling that when there is no empty line between cases in switch, this is already a fairly familiar and widespread style, which is also used in the examples of the Microsoft documentation. In truth, though, Microsoft's examples don't use curly braces because they are optional for a switch. However, it was great to be able to customize this behavior.

I'm getting the same issue as @karol-gro posted.
And this is perfectly fine code and nothing extraordinary. While the assign a variable workaround works, it makes code harder to read

@philippdolder we switched to preview version of nuget package and it worked. The newest stable version is from 2019 and beta is 2 months old, so it's the only way to use StyleCop with any newer C# feature

@karol-gro thank you. I'll consider that

What about if the condition in the switch expression contains a multiline body? Surely this makes the code less readable because the condition is separated further away from the outcome.
Satisfies rule
public class Test
{
    private readonly int thisIsAReallyLongMemberNameAndItIsReallyReallyLongEvenLongerThanYouMayThink = 1;

    private const int HighlyUnexpectedLargerThanLifeInteger = 2;

    private string TestMe()
    {
        return this switch
        {
            {
                thisIsAReallyLongMemberNameAndItIsReallyReallyLongEvenLongerThanYouMayThink:
                HighlyUnexpectedLargerThanLifeInteger
            }

                => "extremely unusual result",
            _ => "expected result"
        };
    }
}

Expected to satisfy rule too but does not
        return this switch
        {
            {
                thisIsAReallyLongMemberNameAndItIsReallyReallyLongEvenLongerThanYouMayThink:
                HighlyUnexpectedLargerThanLifeInteger
            } => "extremely unusual result",
            _ => "expected result"
        };

@DrummingBeb since it looks like a defect, I'd suggest putting it in separate issue

I ran into this issue with a statement like this:
    public bool Test(int a, int b) => a switch
        {
            _ => true,
        } // <- SA1513 triggers here
        && b switch
        {
            _ => true,
        };


delete_nth.py Time Complexity

Is the time complexity of the naive method also linear time instead of quadratic ?

Suppose the input array is a sequence from 1 to n without duplicates, and the value for n is 2.
Since each value appears only once, when the for is processing the last value of the input the ans.count(num) will compare n-1 times, this yields the n^2


DataverseToSQL Template issue - Lookup size exceeded

Hi.
Following this documentation: https://docs.microsoft.com/en-us/power-apps/maker/data-platform/azure-synapse-link-pipelines
There is an error on the Lookup activity (LookupModelJson) when I run the Pipeline. The error reads:
Operation on target LookupModelJson failed: ErrorCode=UserErrorComputePluginFailure,'Type=Microsoft.DataTransfer.Common.Shared.HybridDeliveryException,Message=The size of lookup activity result exceeds the limitation 4194304.,Source=,''Type=Microsoft.DataTransfer.Execution.Core.ExecutionException,Message=The size of lookup activity result exceeds the limitation 4194304.,Source=Microsoft.DataTransfer.TransferTask,'
The Issue I have is that it seems the Lookup activity has a limit of

5000 rows (not applicable in this instance as only 1 row is returned)
supports up to 4 MB in size (our file is 4.12MB)

In my case the data is from D365 and we will be loading 500+ tables so I don't see how we can use this pipeline activity as is.
The suggested workaround for the pipeline activity limitation is to batch the records - but it won't work in this case because it is a JSON blob failing on size rather than #records.
Side note: My workaround, for now, is to use a Copy activity(which does not have the size limit of 4mb) and move the model.json file into an Azure SQL database table, interrogate the data using OPENJSON, JSON_VALUE, JSON_QUERY and FOR JSON PATH to produce the same output required for this template, but filtered with a TOP X command. (I will use OFFSET and FETCH later on once I'm happy the solution works to batch load it).
My current working SQL query is this one (without the OFFSET and FETCH) - hope it helps someone with the same issue until it's resolved:
--
`  DECLARE @modelJson  varchar(max);
DECLARE @SQL2  varchar(max);
DECLARE @SQL3  varchar(max);
SELECT @modelJson = [ModelJson] FROM [Config].[CDMModelData] --New table created to store json data "as is" into 1 column called ModelJson.
SELECT @SQL2 = [value] FROM  OPENJSON(@modelJson) e WHERE [key] = 'entities'
SELECT @SQL3= (SELECT TOP 5  --top 5 was added in just to test the Output and filters, but needed in this instance to overcome the size limitation of the lookup activity
JSON_VALUE(e.value,'$.name')  as name
,JSON_QUERY(e.value,'$.attributes')  as attributes
,JSON_QUERY(e.value,'$.partitions')  as [partitions]
FROM OPENJSON(@SQL2) e
FOR JSON PATH )
SELECT @SQL3 AS JSONfile --this is to avoid random output column name`

Hi @WPelserDatacom
Large model.json can cause failure https://docs.microsoft.com/en-us/azure/data-factory/control-flow-lookup-activity#supported-capabilities
Work around:

Use separate Synapse Links for different set of entities/tables. ADF pipelines should point to same destination Azure SQL DB.
Copy model.json to SQL DB. https://github.com/MicrosoftDocs/powerapps-docs/issues/3625

Closing issue.


Adapt to RawVal -> Val renaming

Just adapting the SDK to https://github.com/stellar/rs-soroban-env/pull/862
(Also re-resolving Cargo.lock since we have to for k256 and it's not a bad time to give it a general bump)

Looks like it is complaining about MPL-2.0.


Remove Covid19 vaccinations button from HIA UM landing page

As Project Coordinator
I want to remove the Covid19 vaccinations button from the landing page
Because it's not as relevant anymore and because the same information is still accessible through the Covid category that is part of each district

@JLijftogt Does this also apply to all the different covid-specific Offer-fields?
It would really 'clean things up' if we removed all those as well.

@elwinschmitz The whole sheet for Covid19 vaccinations can be removed (I'd like to save it on Teams though, so we can still access it and its structure if ever needed again). It should stay as a category (i.e. as part of Utrecht) and sub-category (i.e. as part of Amsterdam) in all cities.


Enable Tracing only on first retry

Is your feature request related to a problem? Please describe.
When we run suite with more than 100 testcases, tracing.zip takes up space. For testcases that are passed, we will not be using the tracing anyways
Describe the solution you'd like
A better way would be to add an option to enable trace only if the tests failed and it is retried like we already have in Playwright - trace: 'on-first-retry'

Browser library doesn’t know is the execution first one or a retry one. For the library it’s a an execution as any other one. Therefore for the library, we can’t detect such state.
But you as a user can most likely set a variable from command line when rerunning is done and based on the variable enable or disable trace.

Also I have heard that people do similar things by using a listener.


Add hot-keys for functionality

Porting over from old repo...

This should some low hanging fruit. Not super hard to implement. @sstrubberg do you have any ideas on what shortcuts to add?
Should probably add a list of available shortcuts with the options menu (or someplace else) for reference.

Added in v2.3.0
You can find the list under settings. Here is what we went live with for now.


make two IOCs - with PVI and GUI

Create an ADSimDetector and ADAravis IOC for bl45p with HDF5 and PVA plugins (At least).
To use only auto-generated Support YAML and the Aravis one to use autogenerated IOC yaml (from existing bl45p-iocs builder XML)
work with Gary to add PVI and GUI to both

@GDYendell  I should be ready with these for step 3 a by Thurs at current estimates.

I now have a fully working Aravis IOC running in K8S on bl45p with all the new changes to structure and schema in place.
It came out looking OK (this works with the existing edm screens for bl45p)
# yaml-language-server: $schema=https://github.com/epics-containers/ioc-adaravis/releases/download/23.9.1/adaravis.ibek.ioc.schema.json

ioc_name: bl45p-ea-ioc-01
description: Sample and overview cameras IOC for BL45P
# TODO update the schema to remove generic_ioc_image - this is handled in helm chart
# 'outside' and is not an ibek thing anymore
generic_ioc_image: ghcr.io/epics-containers/ioc-adaravis-linux-runtime:23.9.1

entities:
  - type: epics.EpicsCaMaxArrayBytes
    max_bytes: 6000000

  - type: ADAravis.aravisCamera
    CLASS: AVT_Mako_G234B
    PORT: DET.DET
    P: BL45P-EA-MAP-01
    R: ":DET:"
    ID: <IP_ADDRESS>
    PV_ALIAS: "0" # TODO this ARG should have default

  - type: ADCore.NDPvaPlugin
    PORT: DET.PVA
    PVNAME: BL45P-EA-MAP-01:PVA:OUTPUT
    P: BL45P-EA-MAP-01
    R: ":PVA:"
    NDARRAY_PORT: DET.DET
    BLOCK: 1 # TODO remaining ARGS should have defaults
    PRIORITY: 0
    STACKSIZE: 0
    NDARRAY_ADDR: 0

  - type: ADCore.NDFileHDF5
    PORT: DET.HDF5
    P: BL45P-EA-MAP-01
    R: ":HDF5:"
    NDARRAY_PORT: DET.DET
    BLOCK: 1
    NDARRAY_ADDR: 0

  - type: ADAravis.aravisCamera
    CLASS: AVT_Mako_G234B
    PORT: DIFF.DET
    P: BL45P-EA-DIFF-01
    R: ":DET:"
    ID: <IP_ADDRESS>
    PV_ALIAS: "0"
  - type: ADCore.NDPvaPlugin
    PORT: DIFF.PVA
    PVNAME: BL45P-EA-DIFF-01:PVA:OUTPUT
    P: BL45P-EA-DIFF-01
    R: ":PVA:"
    NDARRAY_PORT: DIFF.DET
    BLOCK: 1
    PRIORITY: 0
    STACKSIZE: 0
    NDARRAY_ADDR: 0

  - type: ADCore.NDFileHDF5
    PORT: DIFF.HDF5
    P: BL45P-EA-DIFF-01
    R: ":HDF5:"
    NDARRAY_PORT: DIFF.DET
    BLOCK: 1
    NDARRAY_ADDR: 0

The above was my original milestone for starting work with Gary on PVI/GUI.
However. Making it has made me see areas that need tidying up and I'd like to take a few more days to make the framework more robust and understandable before explaining it to Gary. See https://github.com/epics-containers/ibek/issues/114#issuecomment-1738595868
(Or we could get cracking on PVI and do the tidying later.)

We have enough examples of working IOCs to close this.


Added AzDO PR Extension for VS Code

Added Azure DevOps Pull Requests Extension for VS Code as described in #580

@katyamust Please review

Thanks for reviewing. The linting check fails due to incorrectly classifying a link as dead in another file. I don't have permission to re-run the check or merge the PR.


Unfolds All Code on Save

Issue Type: Bug
Not sure why this has happened however out of the blue Visual Studio Code is now unfolding all code every time the file is saved. I have tried uninstalling/reinstalling and removing extensions though nothing has worked.
All code is unfolded every single time the file is saved and results in a lot of lost time.
VS Code version: Code 1.48.2 (a0479759d6e9ea56afa657e454193f72aef85bd0, 2020-08-25T10:13:11.295Z)
OS version: Windows_NT x64 10.0.19041

System Info

Item
Value

CPUs
Intel(R) Core(TM) i7-8700K CPU @ 3.70GHz (12 x 3696)

GPU Status
2d_canvas: enabledflash_3d: enabledflash_stage3d: enabledflash_stage3d_baseline: enabledgpu_compositing: enabledmultiple_raster_threads: enabled_onoop_rasterization: disabled_offprotected_video_decode: unavailable_offrasterization: enabledskia_renderer: disabled_off_okvideo_decode: enabledviz_display_compositor: enabled_onviz_hit_test_surface_layer: disabled_off_okwebgl: enabledwebgl2: enabled

Load (avg)
undefined

Memory (System)
15.86GB (10.46GB free)

Process Argv

Screen Reader
no

VM
0%

Extensions (3)

Extension
Author (truncated)
Version

fold-unfold-all-icone
Fer
0.0.2

go
gol
0.16.2

mark-jump
spy
0.9.0

For what language is that? Can you add a small code sample? Do you have format on save enabled?

Hi the language is GO/GOLANG, it was working perfectly for months and then it started happening. Eventually I did a clean install of Windows 10 and it was fixed. However it is now happening again for some unknown reason.
I don't change anything, install any new extensions or anything similar and out of the blue it just unfolds all on save. I do not have FORMAT ON SAVE enabled.
some code is belo
`func drawcredits() { // MARK: drawcredits
altcloudson = true
rl.DrawRectangle(0, 0, monw, monh, rl.Black)
rl.DrawRectangle(0, 0, monw, monh, rl.Fade(creditscolor, creditsfade))
if framecount%3 == 0 {
for a := 0; a < 20; a++ {
rl.DrawPixel(rInt(50, monw-50), rInt(50, monh-50), rl.Black)
rl.DrawRectangle(rInt(50, monw-50), rInt(50, monh-50), 2, 2, rl.Black)
}
}
if creditsfadeon {
	creditsfade -= 0.04
	if creditsfade <= 0.0 {
		randomcolors()
		creditscolor = randomcolorslice[0]
		creditsfadeon = false
	}
} else {
	creditsfade += 0.04
	if creditsfade >= 1.0 {
		randomcolors()
		creditscolor = randomcolorslice[0]
		creditsfadeon = true
	}
}

rl.DrawText("these links all helped make this game possible:", 100, 150, 40, rl.White)

rl.DrawText("raylib.com", 150, 250, 40, rl.White)
rl.DrawText("golang.org", 150, 300, 40, rl.White)
rl.DrawText("opengameart.org", 150, 350, 40, rl.White)
rl.DrawText("itch.io", 150, 400, 40, rl.White)
rl.DrawText("kenney.nl", 150, 450, 40, rl.White)
rl.DrawText("planets - opengameart.org/content/20-planet-sprites", 150, 500, 40, rl.White)

}`

I can reproduce.
From debugging I see that the go extension now also registers a folding range provider.
However that provider doesn't work well with incomplete code. It then returns no folding ranges, what results in all folded ranges to go way.
E.g. no ranges returned for that code:
package main
w
import (
	"fmt"
	"io"
	"net/http"

	"github.com/microsoft/vscode-remote-try-go/hello"
)

func handle(w http.ResponseWriter, r *http.Request) {
	io.WriteString(w, hello.Hello())
}

Can you file the issue against the go extension? https://github.com/golang/vscode-go
Thanks a lot!


dependabot stopped to open PRs

As I haven't seen any pull requests from dependabot for quite some time, I checked its log and it contains many errors, one for each outdated dependency. For example:
2023/03/21 09:50:18 ERROR <job_630314515> Error processing crossterm (Dependabot::SharedHelpers::HelperSubprocessFailed)
updater | 2023/03/21 09:50:18 ERROR <job_630314515> error: failed to load manifest for dependency `uu_arch`
updater |
updater | Caused by:
updater |   failed to load manifest for dependency `uucore`
updater |
updater | Caused by:
updater |   failed to load manifest for dependency `uucore_procs`
updater |
updater | Caused by:
updater |   failed to read `/home/dependabot/dependabot-updater/dependabot_tmp_dir/src/uucore_procs/Cargo.toml`
updater |
updater | Caused by:
updater |   No such file or directory (os error 2)

According to its PRs, it opened the last PRs at the end of January.

oh, fun error

a bug upstream?

Maybe it's https://github.com/dependabot/dependabot-core/issues/5864? I'm not sure.

Renovate works (too) well:
https://github.com/uutils/coreutils/issues/4598

I love that dashboard :)


Flutter + CanvasKit crashes when loading webp images

Experimenting with WASM compiled CanvasKit.
Have images in assets/ + pubspec.yaml
Have a full screen app with background and carousel of images.

flutter run -d chrome --release --dart-define=FLUTTER_WEB_USE_SKIA=true

Expected: Flutter renders
Outcome: White screen when using webp. Fully rendered when switched to png or jpg.

Hi @jtmcdole
can you please provide your updated  flutter doctor -v
and your flutter run --verbose?
Also, to better address the issue, would be helpful
if you could post  a minimal code sample
or the steps to reproduce the problem.
Thank you

/cc @hterkelsen

I'll try to repro here at home; this was at work on a freshly updated, external flutter-dev checkout.

It seems like Skia already supports decoding webp, it's just not exposed in CanvasKit.
@kjlubick how difficult do you think this would be to add to CanvasKit's image decoding support?

This was fixed in CanvasKit upstream: https://skia-review.googlesource.com/c/skia/+/262928
Once CanvasKit 0.11 is released I'll update the flutter engine and this should be fixed


[CONTP-222] fix check-cmd

What does this PR do?

CONTP-222
Fix agent check xxx failure after previous PR
Motivation

The config scheduler in autodiscovery is now async after this pr. However, agent check xxx in cli mode is expecting the configs returns from AD immediately after addScheduler (see comment here).
Race conditions:

A scheduler named "check-cmd" is registered in a go routine, which is assumed to catch up all scheduled configs immediately 	go ac.AddScheduler("check-cmd", schedulerFunc(func(configs []integration.Config) {

On the other hand, in controller, configs to be scheduled might not be actually scheduled here yet

If no scheduled config is found, an error is reported

2024-06-10 05:11:10 UTC | CORE | INFO | (pkg/aggregator/aggregator.go:744 in run) | Stopping aggregator
Error: no valid check found

Fix:
Retrieve all the configs whose desirable state is scheduled from configStateStore (source of truth).
Additional Notes

Possible Drawbacks / Trade-offs

Getting all configs from configStateStore might cause double scheduling issue. But we limit the usage to agent check cli only (exit after checks are found), so no side affect on running agent.
Describe how to test/QA your changes

Run agent check disk, no error is reported and metrics like system.disk.utilized should be dumped

/merge