Add envoy clusters/listeners to sidecar

Please provide a description for what this PR is for.
And to help us figure out who should review this PR, please
put an X in all the areas that this PR affects.
[ ] Configuration Infrastructure
[ ] Docs
[ ] Installation
[ ] Networking
[ ] Performance and Scalability
[ ] Policies and Telemetry
[ ] Security
[ ] Test and Release
[ ] User Experience
[X] Developer Infrastructure

[APPROVALNOTIFIER] This PR is NOT APPROVED
This pull-request has been approved by: Nino-K
To complete the pull request process, please assign nmittler
You can assign the PR to them by writing /assign @nmittler in a comment when ready.
The full list of commands accepted by this bot can be found here.

Needs approval from an approver in each of these files:

pkg/OWNERS

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Nino-K: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

istio-unit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-unit-tests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

istio-unit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-unit-tests-master

istio-pilot-multicluster-e2e-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-pilot-multicluster-e2e-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

istio-unit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-unit-tests-master

istio-pilot-multicluster-e2e-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-pilot-multicluster-e2e-master

istio-racetest-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-racetest-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

/test istio-unit-tests-master

/test istio-racetest-master

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: Nino-K, nmittler
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

pkg/OWNERS [nmittler]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

istio-pilot-multicluster-e2e-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-pilot-multicluster-e2e-master

e2e-mixer-no_auth-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test e2e-mixer-no_auth-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

istio-pilot-multicluster-e2e-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-pilot-multicluster-e2e-master

e2e-mixer-no_auth-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test e2e-mixer-no_auth-master

istio-unit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-unit-tests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

istio-pilot-multicluster-e2e-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-pilot-multicluster-e2e-master

e2e-mixer-no_auth-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test e2e-mixer-no_auth-master

istio-unit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-unit-tests-master

istio-racetest-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-racetest-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

/test e2e-mixer-no_auth-master

[APPROVALNOTIFIER] This PR is APPROVED
This pull-request has been approved by: howardjohn, Nino-K, nmittler
The full list of commands accepted by this bot can be found here.
The pull request process is described here

Needs approval from an approver in each of these files:

pkg/OWNERS [nmittler]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

/retest

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

istio-pilot-multicluster-e2e-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-pilot-multicluster-e2e-master

istio-unit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-unit-tests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

@Nino-K: The following tests failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

istio-pilot-multicluster-e2e-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-pilot-multicluster-e2e-master

istio-unit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test istio-unit-tests-master

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.

/retest

@Nino-K: The following test failed, say /retest to rerun them all:

Test name
Commit
Details
Rerun command

integ-new-install-k8s-presubmit-tests-master
fec34a4b30ea6938d7c0040e78a695adbd8e0995
link
/test integ-new-install-k8s-presubmit-tests-master

Instructions for interacting with me using PR comments are available here.  If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here.


Adds the transformFiles API for tree transformations

The transformFiles function will take on some of the responsibilities of the existing emitter, and integrates it with our new visitor pattern.
This function takes in an array of Transformer callbacks, which have the following signature (found in types.ts):
export type Transformer = (context: TransformationContext) => (node: SourceFile) => SourceFile;

The TransformationContext is allocated at the start of transformFiles, and each Transformer is called sequentially with this context to initialize each transformer. The result of each initialization is a callback that will be used to transform each SourceFile.
The TransformationContext provides the following information/capabilities to a Transformer:

Access to compiler options.
Access to the emit resolver.
The ability to generate unique names for nodes.
The ability to hoist variable and function declarations (such as temporary variables, or hoisting declarations in SystemJS).
The ability to explicitly enter and exit a lexical environment (used to track hoisted declarations).
The ability to associate additional transformation- and emit-specific information and flags to a node.
Hooks to perform certain just-in-time substitutions during the final print phase of the tree transforming emitter.

While TransformFlags provides us the ability to quickly make decisions about whether (and how) to transform a node, there are some transformations that would still require a full walk of the tree. This includes situations such as renaming block-scoped let/const declarations. As we do not want to do a full walk of the tree for every transformation phase, we save these final transformations until the last possible moment before we emit. We can do this by using the identifierSubstitution and expressionSubstitution hooks provided on the TransformationContext. The final print phase will then evaluate these substitutions on a just-in-time basis immediately before printing the node.
The following example builds on the examples in #6892 and #6983:
function createES7Transformer(context: TransformationContext) {
  const {
    startLexicalEnvironment,
    endLexicalEnvironment
  } = context;

  let currentSourceFile: SourceFile;

  // hook substitutions
  const previousIdentifierSubstitution = context.identifierSubstitution;
  context.identifierSubstitution = substituteIdentifier;

  const previousExpressionSubstitution = context.expressionSubstitution;
  context.expressionSubstitution = substituteExpression;

  function transformSourceFile(node: SourceFile) {
    const savedSourceFile = currentSourceFile;
    const visited = visitEachChild(node, visitor, /*environment*/ context);
    currentSourceFile = savedSourceFile;
    return visited;
  }

  function visitor(node: Node) {
    if (node.transformFlags & TransformFlags.ES7) {
      // This node is an ES7 node and needs a specific transformation
      return visitorWorker(node);
    }
    else if (node.transformFlags & TransformFlags.ContainsES7) {
      // This node contains an ES7 node somewhere in its subtree, so we must walk the subtree
      // NOTE: Added third argument to the following call to support entering and exiting
      //       lexical environments.
      return visitEachChild(node, visitor, /*environment*/ context);
    }
    else {
      // Neither this node, nor its subtree, require any transformation, so we can simply
      // reuse the node and its subtree and avoid a costly walk
      return node;
    }
  }

  function visitorWorker(node: Node) {
    ...
  }

  ...

  function substituteIdentifier(node: Identifier) {
    // Evaluate any previous substitutions
    node = previousIdentifierSubstitution ? previousIdentifierSubstitution(node) : node;
    // Perform any other substitution we may need.
    // NOTE: You cannot rely on `parent` pointers on nodes created during transformation.
    // NOTE: You may be able to use `getOriginalNode` on a node to get to its representation in
    //       the original source tree.
    return node;
  }

  function substituteExpression(node: Expression) {
    // Evaluate any previous substitutions
    node = previousExpressionSubstitution ? previousExpressionSubstitution(node) : node;
    // Perform any other substitution we may need.
    // NOTE: You cannot rely on `parent` pointers on nodes created during transformation.
    // NOTE: You may be able to use `getOriginalNode` on a node to get to its representation in
    //       the original source tree.
    return node;
  }
}

Related Pull Requests:

#6892 - Adds the visitor API foundation for tree transformations.
#6983 - Adds the Transform Flags concept for tree transformations.
#6986 - Adds the transformFiles API for tree transformations.
#6987 - Adds a simplified pretty printer for tree transformations.

Paging for review: @mhegazy, @ahejlsberg, @yuit, @DanielRosenwasser, @RyanCavanaugh, @vladima


Rename SeedInfectionsExponential For Clarity

This PR seeks to rename the class SeedInfectionsExponential so that users of MSR do not take exponential here to mean involving Exponential distributions but instead take exponential to mean relating to an exponential growth model.

SeedInfectionsExponentialGrowth

Okay, will do.


Can't seem to use SafariViewController

Seems like i've set everything right but when trying to access the SafariViewController using the following
                 if #available(iOS 9.0, *) {             oauthswift.authorize_url_handler = SafariURLHandler(viewController: self)         } else {             oauthswift.authorize_url_handler = AuthWebViewController()         }
I get the following error in the console
2016-07-07 17:51:35.047 OAuthSwiftExample[402:76129] Warning: Attempt to present <SFSafariViewController: 0x14d49b10> on <OAuthSwiftExample.Auth: 0x14e39250> whose view is not in the window hierarchy!

I think that this error indicate that we try to present the safari controller using self as parent (the one passed into SafariURLHandlerinit) but this selfcontroller is not displayed (or not into hierarchy) when you doing authentification
Maybe I have a temporary fix that could work for you (even if I think you use the wrong controller when doing init)
Try to edit SafariURLHandler class into OAuthSwiftURLHandlerType.swift
When controller is used, replace by UIViewController. topViewController(controller) or UIApplication.topViewController?

Hi there i'm not too sure i understand where to make the edits on which line in this class... Also the class that i'm calling this on is the rootviewcontroller as well reckon this could be the issue?

yes the controller passed must be the one currently displayed when launching authentification

Ahh right okay so could you possible hint at which line to change since i'm a bit confused as to what i have to edit in that class

I talk first about a fix in oauthswift code and I think I say the file name and class
But to really fix your problem, it is in your code when you doing oauthswift.authorize_url_handler = SafariURLHandler(viewController: self) }
Do it into the view controller which launch the authentification, not appdeletage or something like that

Hmmm see i've not done in the app delegate i've actually done it on the class which i want it do the app authentication on, as you can see below in my authentication class
`    func doOAuthSoundCloud(consumerKey: String, consumerSecret: String) {
    let oauthswift = OAuth2Swift(
        consumerKey:    consumerKey,
        consumerSecret: consumerSecret,
        authorizeUrl:   authorizeUrl,
        accessTokenUrl: accessToken,
        responseType:   "code"
    )

    oauthswift.authorize_url_handler = SafariURLHandler(viewController: self)
    //oauthswift.authorize_url_handler = AuthWebViewController()

//        if #available(iOS 9.0, *) {
//
//        } else {
//
//        }
    // Add safari and webview so it authenticated in app
    // Clean up code in model classes and root view controller

    let state: String = generateStateWithLength(20) as String
    oauthswift.authorizeWithCallbackURL( NSURL(string: callBackUrl)!, scope: "", state: state, success: {
        credential, response, parameters in
        // self.showTokenAlert(serviceParameters["name"], credential: credential)
        self.testSoundCloud(oauthswift,credential.oauth_token)
        }, failure: { error in
            print(error.localizedDescription)
    })
}`

and in my view controller when i want to login
`//
//  ViewController.swift
//  OAuthSwiftExample
//
//  Created by Tunde Adegoroye on 07/07/2016.
//  Copyright © 2016 Tunde Adegoroye. All rights reserved.
//
import UIKit
class ViewController: RootViewController {
@IBOutlet weak var loginBtn: UIButton!

override func viewDidLoad() {
    super.viewDidLoad()
    // Do any additional setup after loading the view, typically from a nib.

    // Do verification here

}

override func didReceiveMemoryWarning() {
    super.didReceiveMemoryWarning()
    // Dispose of any resources that can be recreated.
}

@IBAction func loginBtnDidTouch(sender: AnyObject) {
            authMethods.doOAuthSoundCloud("xxxxxxxx", consumerSecret: "xxxxxxxxxxx")
}

}
`

Move authentication to the correct class and it's now working.


FlexibleSpaceBar should not include transparent widgets

This is important because the title or background widgets may include an animation which will only stop if the widget is deactivated or disposed.
Fixes #3297

@vlidholt

LGTM


Unexpected time alignment in subquery

What did you do?
Assume we have following queries and we only have data points between 2023-02-22T07:43:56Z and 2023-02-22T07:44:56Z:

name
query
start
end
step
type

A
sum(rate(exec_total{job="job-gg"}[15s]))
2023-02-22T07:43:56Z
2023-02-22T07:44:56Z
3s
range_query

B
max_over_time(sum(rate(exec_total{job="job-gg"}[15s]))[1m:3s])
-
2023-02-22T07:44:56Z
-
instant_query

The query A will yield a max value different from the query B, this result doesn't make sense to end users.
What did you expect to see?
The max values should be the same.
What did you see instead? Under which circumstances?
The query A will yield a max value different from the query B, this result doesn't make sense to end users.
The reason is Prometheus will do some calculation internally and the subquery in B get a different timestamp:
> query A
|---- AggregateExpr: sum(rate(exec_total{job="job-gg"}[15s]))   ==>>  (2023-02-22 07:43:56Z ~ 2023-02-22 07:44:56Z) / 3s
· · · |---- Call: rate(exec_total{job="job-gg"}[15s])   ==>>  (2023-02-22 07:43:56Z ~ 2023-02-22 07:44:56Z) / 3s

> query B
|---- Call: max_over_time([1m])   ==>>  (2023-02-22 07:44:56Z ~ 2023-02-22 07:44:56Z) / 3s
· · · |---- SubqueryExpr: sum(rate(exec_total{job="job-gg"}[15s]))[1m:3s]   ==>>  (2023-02-22 07:44:56Z ~ 2023-02-22 07:44:56Z) / 3s
· · · · · · |---- AggregateExpr: sum(rate(exec_total{job="job-gg"}[15s]))   ==>>  (2023-02-22 07:43:57Z ~ 2023-02-22 07:44:56Z) / 3s
· · · · · · · · · |---- Call: rate(exec_total{job="job-gg"}[15s])   ==>>  (2023-02-22 07:43:57Z ~ 2023-02-22 07:44:56Z) / 3s

However, we can do some alignment to resolve this:
> query A
|---- AggregateExpr: sum(rate(exec_total{job="job-gg"}[15s]))   ==>>  (2023-02-22 07:43:57Z ~ 2023-02-22 07:44:57Z) / 3s
· · · |---- Call: rate(exec_total{job="job-gg"}[15s])   ==>>  (2023-02-22 07:43:57Z ~ 2023-02-22 07:44:57Z) / 3s

> query B
|---- Call: max_over_time([1m])   ==>>  (2023-02-22 07:44:57Z ~ 2023-02-22 07:44:57Z) / 3s
· · · |---- SubqueryExpr: sum(rate(exec_total{job="job-gg"}[15s]))[1m:3s]   ==>>  (2023-02-22 07:44:57Z ~ 2023-02-22 07:44:57Z) / 3s
· · · · · · |---- AggregateExpr: sum(rate(exec_total{job="job-gg"}[15s]))   ==>>  (2023-02-22 07:43:57Z ~ 2023-02-22 07:44:57Z) / 3s
· · · · · · · · · |---- Call: rate(exec_total{job="job-gg"}[15s])   ==>>  (2023-02-22 07:43:57Z ~ 2023-02-22 07:44:57Z) / 3s

System information
No response
Prometheus version
2.41.0-rc.0

Prometheus configuration file
No response
Alertmanager version
No response
Alertmanager configuration file
No response
Logs
No response

More background: https://www.robustperception.io/promql-subqueries-and-alignment/

More background: https://www.robustperception.io/promql-subqueries-and-alignment/

Too complex for me(complexity should be transparent to users). But I am sure that the performance issue doesn't apply to instant queries.

Hello from the bug scrub!
Sub-queries are indeed hard. We believe that #9114 is indeed helpful in resolving this issue, but as you can see, it's a hard PR to get right. We are still hoping somebody will tackle it in the not too far future. In any case, we are closing this issue as we are already tracking progress in the PR.


Local override

One of the features requested by Holly was a predictable process for getting new content from partners to show up in the site. Given the irregularity of the Getty publishing, and the issues with partner metadata that sometimes prevents linking correctly, I think we should have a local override file that lets us link partner IIIF manifests to DCL numbers.
Ideally, this would be updated by Marquand staff (Airtable, Google spreadsheet, etc.) and pulled into the application by IT staff at regular intervals.

In the current workflow, we download the Getty Portal, winnow out the non-Cicognara records, and convert the remaining records to TEI documents: a TEI header with the bibliographic data + a  element for the IIIF manifest. In this capacity, the TEI documents are little more than bibliographic records expressed in a well-known and well-documented bibliographic format. Then we construct a teiCorpus for each Catalogo item, with header data coming from the Catalogo  and the  components coming from the Getty documents (associated via dclnum).  These Item-level TEI documents are used to construct the static site and the new Fuse index.
I propose we treat these item-level components as we do the encoded Catalogo: as first-class objects, maintained under version control and curated and edited as the Catalogo is.  Our staff can easily be taught to update these files to correct errors in the partner data, and new records can be appended to the Item documents when they are added to the Getty Portal (this seldom happens in practice).


Fix bug when getting target element from URL hash

What
Update the accordion component to only look for a target element within the module itself, not the entire document.
Why
This fixes a bug when anchor_navigation is set to true and an ID is passed in for an element that exists on the page, but is not contained within the accordion component.
For example: https://www.gov.uk/guidance/how-to-publish-on-gov-uk/creating-and-updating-pages#section-title
Further Info
Fixes: https://github.com/alphagov/govuk_publishing_components/issues/2086
Trello: https://trello.com/c/q5P6u7id/1507-ps-17-accordion-anchor-link-navigation-breaks-with-invalid-anchor
Using querySelector when the ID contains a colon
There was also a need to escape the colon character when using querySelector, for example $this.module.querySelector('#fnref:1') would throw an error [^1]
[^1]: Bugzilla - querySelector doesn't work if the ID contains a colon (:)

Amended note in the Changelog


[FSR-04M] Inexistent Error Accounting

FSR-04M: Inexistent Error Accounting

Type
Severity
Location

Mathematical Operations

FeeSplitter.sol:L123

Description:
The FeeSplitter::distribute function will disburse an EIP-20 balance among multiple recipients, however, it will not account for the remainder of the distributions that may result due to using Floor based rounding arithmetic.
Impact:
A non-zero EIP-20 balance should exist within the FeeSplitter solely when it is sensible to invoke the FeeSplitter::distribute function, aiding off-chain software in integrating with the contract.
Example:
function distribute() external {
    FeeSplitterStorage storage $ = _getFeeSplitterStorage();
    address token = $.token;
    uint256 splitTotal = $.splitTotal;
    uint256 amount = IERC20($.token).balanceOf(address(this));
    uint256 totalDistributed = $.totalDistributed;
    if (splitTotal != 0) {
        FeeReceiver[] storage feeReceivers = $.feeReceivers;
        for (uint256 i = feeReceivers.length; i != 0;) {
            unchecked {
                --i;
            }
            (address feeReceiver, uint96 split) = _unsafeFeeReceiverAccess(feeReceivers, i);
            uint256 splitAmount = amount.mulDiv(split, splitTotal, Math.Rounding.Floor);
            if (splitAmount != 0) {
                totalDistributed += splitAmount;
                IERC20(token).safeTransfer(feeReceiver, splitAmount);
            }
        }
    }
    _updateCheckpoints(totalDistributed);
}

Recommendation:
We advise the code to distribute the remaining amount in the final iteration of the feeReceivers, ensuring that no non-zero remainder exists within the contract after a distribution.

I don't think this is a problem. The potential remaining amount can only be dust, and it will roll over into the next distribution. Rather than picking one lucky dust winner, I'd rather keep it a fair distribution.


Audio issue

Hey! Really cool work, I am trying to fiddle around with the siri functionality but I seem to be getting no audio with your current setup. Im getting an exception  "exception: 'AudioData' object has no attribute 'data'"
Any ideas there?!

No Idea, but really interested in this issue. Maybe CarPlay is based on the Airplay2 Protocol.

No Idea, but really interested in this issue. Maybe CarPlay is based on the Airplay2 Protocol.

So the exception: 'AudioData' object has no attribute 'data'" might be due to something else (possibly a control signal from siri, say) - haven't completely reverse engineered the audio protocol yet, and it gets a little flakey with siri and phone calls. Are you hearing nothing at all? Could be worth running alsamixer and checking that you've got an appropriate default device.

So the exception: 'AudioData' object has no attribute 'data'" might be due to something else (possibly a control signal from siri, say) - haven't completely reverse engineered the audio protocol yet, and it gets a little flakey with siri and phone calls. Are you hearing nothing at all? Could be worth running alsamixer and checking that you've got an appropriate default device.


Add title-attribute to sw-cms-list-item.html.twig

1. Why is this change necessary?
It happens that you have layouts with similar names. In the standard installation there are, for example, two layouts named "Default shop page layout with contact form" and "Default shop page layout with newsletter form". These layouts seem identical on first sight, because they're shortened by "...". To let the user know which layout he's about to choose, we can add a simple title-attribute which appears on hover.
2. What does this change do, exactly?
It adds a title-attribute to the div element that contains the name of the layout.
3. Describe each step to reproduce the issue or behaviour.
Go to shopping experiences and scroll down, until you see the mentioned layouts.

4. Checklist

[ ] I have written tests and verified that they fail without my change
[X] I have squashed any insignificant commits
[ ] I have created a changelog file with all necessary information about my changes
[ ] I have written or adjusted the documentation according to my changes
[ ] This change has comments for package types, values, functions, and non-obvious lines of code
[X] I have read the contribution requirements and fulfil them.

Hey @phillipmohr, thanks for creating this PR : )
Before we can continue with it, we do require an short changelog.

Hello,
thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-15510
Please use this issue to track the state of your pull request.

Hello,
thank you for creating this pull request.
I have opened an issue on our Issue Tracker for you. See the issue link: https://issues.shopware.com/issues/NEXT-15516
Please use this issue to track the state of your pull request.

@phillipmohr?

This PR was closed due to inactivity. If this change is still important to you, feel free to create a new pull request.
For more information about our contribution guidelines, see https://docs.shopware.com/en/shopware-platform-dev-en/contribution/contribution-guideline


[Notion] End Date Support

Extension
https://www.raycast.com/notion/notion
Description
It would be great if dates could be optionally split into separate inputs for start / end date support.
I often have schedule fields that use a both start and end options to define the range, for instance, project duration, phases, etc.
Who will benefit from this feature?
Anyone who uses end date functionality of Notion.
Anything else?
No response

optionally split into separate inputs for start / end date support

This is a good idea, but it would make the page form have an extra line that sometimes is unnecessary. I do have a possible solution in mind though

@raycastbot reopen this issue


Unable to create TFLite LSTM Model with SND format (time_major = true)

1. System information

TF Version - 2.4.1

I am trying to create model with return_sequences set to false and time_major set to true.
Unable to create TF model with these parameters.
Could you tell me what was the mistake in the code, what are the ytest and ytrain dimensions to create the TF model.
In this model , Time steps = 5 , Batch Size - 2, No.of features = 20  and LSTM layer has 128 internal units.
2. Code
`import numpy as np
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
model = keras.Sequential()
model.add(layers.LSTM(input_shape=(None,20),units= 128, time_major=True, return_sequences=False))
model.summary()

model.compile(optimizer='adam',
              loss='sparse_categorical_crossentropy',
              metrics=['accuracy']);

x_test = np.zeros([5,2,20], dtype=np.float32);
x_train = np.zeros([5,2,20], dtype=np.float32);

y_test =  np.zeros([2,128], dtype=np.float32);
y_train = np.zeros([2,128], dtype=np.float32);

model.fit(x_train, y_train, epochs=5)
model.evaluate(x_test, y_test)

`

Once it is created, could you confirm the steps of conversion to TFLite . Is the below metioned steps correct
`run_model = tf.function(lambda x: model(x))
BATCH_SIZE = 1
STEPS = 2
INPUT_SIZE = 20
concrete_func = run_model.get_concrete_function(
    tf.TensorSpec([ STEPS, BATCH_SIZE, INPUT_SIZE], model.inputs[0].dtype))

model directory.
MODEL_DIR = "keras_lstm_new"
model.save(MODEL_DIR, save_format="tf", signatures=concrete_func)

converter = tf.lite.TFLiteConverter.from_saved_model(MODEL_DIR)
tflite_model = converter.convert()

with open('lstmmodelnew.tflite', 'wb') as f:
  f.write(tflite_model) `

Could you elaborate more on how the above script did not work for you?
Please consider using TF 2.5 and the Select TF option. https://www.tensorflow.org/lite/guide/ops_select

Could you confirm whether this does not work for v2.4.
I used google collab and just run the steps i mentioned,

@pranathibl,
There are 2 parts in your question:

Couldn't build the Model : I've executed your code and it is raising errors related to Shape (Cardinality). Please file an issue in Stack Overflow, as it is neither a bug nor a feature request.
Couldn't convert that model to TF Lite: Once the error in 1 is resolved, Please follow the steps mentioned in the documentation of Select Tensorflow Operators, and let us know if you need help.

Created issue in stack overflow - https://stackoverflow.com/questions/67857868/unable-to-create-tflite-model-with-time-major-format

Any update ?

@pranathibl,
Closing this issue as it is not a bug or feature request and as it has been asked in Stack Overflow. Thanks!

I need an example to build TFLite LSTM model with format(SND). Do you have ?

Any update

Hi @pranathibl
As per the documentation, if the time _major=True , the inputs and outputs will be in shape [timesteps, batch, feature] whereas in the False case, it will be [batch, timesteps, feature] .
Please find the working gist here with time_major=True and converted into TF Lite.
Thanks.


Bug: Grid doesn't resize properly when window resizes

Steps

Create a grid with a row and column floated right.
Resize the window horizontally

Expected
When the window resizes the column floated to the right should stay in the window view.
Result
The Right floated column gets cut off.
Here is what is looks like before the resize:

And here it is after the resize.

Testcase
http://codepen.io/anon/pen/LRQGpP?editors=0010
More info
I was able to use largeScreen and Width to make things a little better but it wasn't smooth (column cut off until it reached smaller size then jumped back in).

Hey @keeslinp thanks for the report! This project only handles generating valid SUI markup and this sounds like an issue with the CSS - the container width is handled by CSS media queries from SUI core.
That being said, I looked at your test case and I think you're issue is that the button has a certain width, and at some screen size the width of the button is bigger than the width of the column, so it extends outside it. I resized to just before the button gets cut off and you can see the button starting to break outside of the column padding:

Also, floated='right' floats the column, not the content. You can see when the column is wider than the button, the button is aligned left within the column:

Hope this helps! Going to close this since it's not an issue with this project.

You can also add celled to the Grid to see the column issue more clearly: http://codepen.io/levithomason/pen/ORQrQx

Thanks guys. I appreciate your help :).


Listerine tactic

@mheiber @Nielius this is the listerine tactic I was talking about on the social call.

Made a huge improvement.
By making listerine composable with auto, which just requires breaking up the exists and conj and disj a bit more, you get a super powerful tactic. listerine; auto.
See the diffs on the proofs here:
https://github.com/awalterschulze/regex-reexamined-coq/pull/81/commits/7328877408a3cd9ef41636f4230e9c5f3c2ac517

We discussed this all on the twitch stream https://www.twitch.tv/videos/642908332


NVDA is sometimes unable to gain focus

NVDA is (quite infrequently) unable to focus on the control with keyboard focus in VS code when alt tabbing into it from another application. What fixes it is pressing alt+f to bring upu the file menu, then pressing escape.
When this occurs, Code is completely unuseable with NVDA (pressing tab and arrow keys doesn't do anything)

This just happened to me. Whenever this occurs, it's persistent (alt-tabbing away and coming back won't fix the problem), and normal commands like ctrl+a to select text will work, but are not registered by NVDA. Alt+f1 does say that its detected a screen reader.

cc @jcsteh
When my focus is on Vs Code and this occurs, restarting NVDA produces the following error:
ERROR - virtualBuffers.VirtualBuffer._loadBuffer (14:46:54.456):
Traceback (most recent call last):
  File "virtualBuffers\__init__.pyc", line 375, in _loadBuffer
WindowsError: [Error 1702] The binding handle is invalid

Possibly nvaccess/nvda#5758. This will occur if Code is focused when NVDA starts. If that's the case, restarting NVDA while focused in an app which does not use a web control will work around it. For example, start Notepad, restart NVDA and then alt+tab back into Code. Does that resolve the problem?

@jcsteh yeah, that error might be a separate issue from this, since it does occur in normal usage without me having to resart NVDA - maybe me seeing the invalid binding handle was just coincidental. When this invalid binding handle occurs and when I use that workaround, I'm still unable to do anything in Vs Code. Using object navigation also doesn't workk - it doesn't see anything inside the window. This is what NVDA+f1 says
Developer info for navigator object:
name: u'\u25cf Untitled-1 - Visual Studio Code'
role: ROLE_WINDOW
states: STATE_FOCUSABLE
isFocusable: True
hasFocus: False
Python object: <NVDAObjects.Dynamic_Ia2WebGenericWindowIAccessible object at 0x04DD0810>
Python class mro: (<class 'NVDAObjects.Dynamic_Ia2WebGenericWindowIAccessible'>, <class 'NVDAObjects.IAccessible.ia2Web.Ia2Web'>, <class 'NVDAObjects.IAccessible.GenericWindow'>, <class 'NVDAObjects.IAccessible.IAccessible'>, <class 'NVDAObjects.window.Window'>, <class 'NVDAObjects.NVDAObject'>, <class 'baseObject.ScriptableObject'>, <class 'baseObject.AutoPropertyObject'>, <type 'object'>)
description: None
location: (0, 22, 1280, 668)
value: None
appModule: <'appModuleHandler' (appName u'code', process ID 8600) at address 4df2050>
appModule.productName: u'Visual Studio Code'
appModule.productVersion: u'1.12.2'
TextInfo: <class 'displayModel.DisplayModelTextInfo'>
windowHandle: 3933174L
windowClassName: u'Chrome_WidgetWin_1'
windowControlID: 0
windowStyle: 399441920
windowThreadID: 9380
windowText: u'\u25cf Untitled-1 - Visual Studio Code'
displayText: u''
IAccessibleObject: <POINTER(IAccessible2) ptr=0x5dc114 at 4d02da0>
IAccessibleChildID: 0
IAccessible event parameters: windowHandle=3933174, objectID=-4, childID=0
IAccessible accName: u'\u25cf Untitled-1 - Visual Studio Code'
IAccessible accRole: ROLE_SYSTEM_WINDOW
IAccessible accState: STATE_SYSTEM_FOCUSABLE, STATE_SYSTEM_VALID (1048576)
IAccessible accDescription: None
IAccessible accValue: None
IAccessible2 windowHandle: 3933174
IAccessible2 uniqueID: -1
IAccessible2 role: ROLE_SYSTEM_WINDOW
IAccessible2 states: IA2_STATE_OPAQUE (1024)
IAccessible2 attributes: u''

@jcsteh when this occur, NVDA's ignoring correct focus events being sent for some reason. This is the log for the events in the order that Code sends out:
time = 15:27:38:039 type = EVENT_OBJECT_FOCUS name = ? Untitled-1 - Visual Studio Code - Insiders role = window state = [normal, opaque] miscData = hwnd=80A20 ;objectId=-4; childId=0; threadId=4604; windowClass=Chrome_WidgetWin_1;
time = 15:27:38:039 type = EVENT_OBJECT_FOCUS name = ? Untitled-1 - Visual Studio Code - Insiders role = document state = [opaque, focusable, readOnly] miscData = hwnd=40D4A ;objectId=-4; childId=-8; threadId=4604; windowClass=Chrome_RenderWidgetHostHWND;
time = 15:27:38:039 type = EVENT_OBJECT_FOCUS name = Explorer (Ctrl+Shift+E) - 1 unsaved file role = pushButton state = [opaque, focused, focusable] miscData = hwnd=40D4A ;objectId=-4; childId=-26; threadId=4604; windowClass=Chrome_RenderWidgetHostHWND;

When I continue tabbing around, it continues to send the focus events I'd expect.
This is the code I have in the app module to see what NVDA sees:
class AppModule(appModuleHandler.AppModule):
    def event_gainFocus(self, obj, nextHandler):
        ui.message("focusing on")
        ui.message(obj.name)
        ui.message(str(obj.role))
        ui.message(obj.windowClassName)

I only hear NVDA announcing the Chrome_WidgetWin_1 window getting focus, but not the other events.
Any idea why NVDA might be doing this?
I also tried triggering the onFocus event on obj = api.getDesktopObject().objectWithFocus() which works to an extent.
For e.g, if focus was previously in an edit field, I can still edit text fine, or use the arrow keys to move about in browse mode. However, enough things break due to the ignoring of focus events that restarting is still required often.

Honestly, I don't know. You'd need to dig into the various places where NVDA could filter events and add some specific debug logging:

Raw win events are received in IAccessibleHandler.winEventCallback. You could log all EVENT_OBJECT_FOCUS events right near the top to make sure NVDA is getting them.
It could be rejected by eventHandler.shouldAcceptEvent, which is called by IAccessibleHandler.pumpAll. You could do logging at various stages (before shouldAcceptEvent, after it, at various points during it) to see where it gets dropped.
Failing that, other places in IAccessibleHandler where you might want to shove some debug logging include processFocusWinEvent and processFocusNVDAEvent. There might also be other places in pumpAll where a focus event could get rejected, but that's far less likely.

@jcsteh thanks for the pointers. I guess there's no facility for logging these without actually modifying NVDA's source code?

Not at present. It'd be nice to have, but it's difficult to do without
being ridiculously verbose, since you need to log the possibilities in so
many places.

My first question is why this is the case. The fact that it isn't a descendant of the foreground is very odd. That rule is there to stop events from apps in the background from impacting performance. If it isn't a descendant of the foreground, what's the foreground? And why did it change?
Is this only for the events when you alt+tab back in, or is this for all focus events, even after you've alt+tabbed back there? I think the former from reading earlier comments, but am not entirely sure. If the latter, it's possible Windows just handles the foreground change a little too late.
As for hacking around this in an app mod, I think you might be able to use eventHandler.requestEvents to get all events for that process and class, if that's possible. Not in front of PC, and believe it or not, I can't remember what arguments that function takes even though I wrote it. :(

@jcsteh it not only ignores the initial focus events when alt-tabbing back in, but all subsequent events as well. I think this might be related to the fact that the tree is annoyingly buggy - you can only walk to the root from the document in one direction, but you can't walk back down from the foreground window to the document, at least using object navigation. I've seen cases where objects show up in the console when they don't in object nav. Strangely, pressing alt+f to go to the file menu does have focus announced correctly and when escaping, it works properly again.
Another thing I'm not sure is related, I saw the following warning as Code was initializing, just after receiving multiple events from objects with Window class: Chrome_RenderWidgetHostHWND
DEBUGWARNING - NVDAObjects.IAccessible.IAccessible._get_IAccessibleRole (16:05:42.387):
accRole failed: (-2147024809, 'The parameter is incorrect.', (None, None, None, 0, None))

The foreground window handle doesn't change before and after this starts happening.
Something else I just noticed. If you start the program, switch to other windows and switch back, this bug doesn't happen. If you move focus to the desktop (e.g windows+d), then switch back to VS Code (whether immediately or after going to other applications first), this bug occurs reliably for me.

@jcsteh eventHandler.requestEvents(eventName=None, processId=None, windowClassName=None) lets you ask that a single event type get accepted, but right now, it will ignore all other events, not just the focus. Is there a way for me to specify that all events, except the ones that are normally filtered out like hide, show, reorder,  etc should be processed, without stating every event type?

Does the document's window handle change?
Is the document's window even valid any more (winUser.isWindow)? I wonder
if the document's HWND gets changed but accessibility reports the wrong
window or something weird like that.
Does restarting NVDA fix this?
No, you can't do a catch all for eventHandler.requestEvents. It was never
really designed to be used in this hammer-like fashion. :)

@jcsteh restarting NVDA doesn't help. By document if you mean the things that fire focus events, then I can take a look.
Hm, so that means short of an upstream fix (probably Electron or maybe Chromium?) the only way to fix this properly is to add another special cased exception to that function, if no additional APIs are used.
I guess callbacks that the app module would implement have been considered but weren't implemented due to e.g performance reasons? I hate changing it here though, since every event processed passes through here.
Is there a way for me to know the name of the .exe that generated the event to only apply this to Code itself? Don't want to accidentally break other Electron apps.

@jcsteh winUser.isWindow still returns 1 even when it breaks.
I can add more logging to figure out what the ancestors of the document is when NVDA rejects its event. Are there convenience functions for doing this?

@jcsteh winUser.isWindow still returns 1 even when it breaks.
The foreground window is set correctly for the events, but is not a parent of the offending object when it breaks.
Window class: Chrome_RenderWidgetHostHWND, eventName: gainFocus
window handle is descendant of foreground window: 1, root owner of window handle is descendant of foreground: 1, foreground window handle: 7210056, foreground class name: Chrome_WidgetWin_1
DEBUG - eventHandler.logRecursiveAncestors (21:03:07.984):
parents of this object:
window class: Chrome_WidgetWin_1, handle: 7210056, control ID: 0
window class: #32769, handle: 65552, control ID: 0

When it breaks:
Window class: Chrome_RenderWidgetHostHWND, eventName: gainFocus
window handle is descendant of foreground window: 0, root owner of window handle is descendant of foreground: 0, foreground window handle: 7210056, foreground class name: Chrome_WidgetWin_1
parents of this object:
window class: Chrome_WidgetWin_0, handle: 13894624, control ID: 0
window class: #32769, handle: 65552, control ID: 0

Have you seen this before in other apps? The spottify one doesn't seem to be as broken as this is.

@jcsteh how does the detection of live regions work, in terms of the events that it uses to detect changes? NVDA is not reading new terminal text when this happens (I assume a live region is being used)
The workaround I used is to force NVDA to process almost all events even if it breaks.
        eventsToRequest = { v for k, v in IAccessibleHandler.winEventIDsToNVDAEventNames.items() }
        # NVDA normally ignores these events in EventHandler.shouldAcceptEvent to prevent flooding
        eventsToRequest.remove("reorder")
        eventsToRequest.remove("show")

The window class is still the same when using the terminal, so I'm not sure why this wouldn't work for it.

The live region code is in-process C++ code. The foreground check is
hard-coded for that case, since we obviously can't make it query Python in
a performant way.

@alexandrudima does Code do anything unusual when using Electron? Haven't seen this happening in other electron apps.

@Neurrone Not that I know of.
@bpasero are you aware of us doing anything funny when focus is gained via alt-tab ?

I did a bit more digging, and this doesn't happen in the issue reporter window (help -> report issue), but the code for that window is likely a lot simpler.

@alexandrudima no, not to my knowledge. At least I do not think we have code that does something specific when window focus is gained that could have an impact on NVDA.
@Neurrone do you see this with other Electron applications (like Slack or Atom for example)?

@bpasero just tried Atom, it doesn't happen at all there. I haven't tried others like Spotify, but have never heard of it happening there.
Perhaps it might not be code that does something on focus, but the way that the windows were initialized?

@Neurrone do you see the same in this other version of  VSCode that is using a different Electron version: https://az764295.vo.msecnd.net/exploration/163e64ca7bbd0a69c727cfd9f5610e7546207a71/VSCode-win32-x64-1.24.0-exploration.zip ?

@bpasero still happens for me using this version.

@alexandrudima when will Electron 3 be tested for insider builds? Wondering if the much more recent version of Chrome would have a fix for this.

@Neurrone
We are building exploration builds that use a much newer version of Electron (our UI framework). I wonder if this issue reproduces with one of these builds, could you try? Download:

macOS: Download
Linux: Download
Windows: Download

@bpasero still happens for me :(. I can reproduce very easily.

Same there, Win 10 64-bit, latest NVDA. The steps are maybe strange, but work and are as follows:

Open vs code
Open current firefox
Return to vs code, focus is lost
No idea what firefox (or all the mozilla apps) have to do with this and they're not alone in the camp of troublemakers, but they're the ones i identified with certainty.

I can duplicate this issue sporadically on my machine.  Maybe 1 in 20 or less.  I also use desktop Skype (also Electron), and haven't seen it there, but I don't use Skype heavily enough to guarantee that it's not triggering because all I use it for is phone calls.  That said, I do use the desktop Slack app (Chromium, not Electron) on a daily basis for at least the last 4 months and haven't seen something like this once ever.
I believe @Neurrone is getting it 100% of the time. I'm not sure what's different in our setups.  On mine, alt-tabbing between Firefox and VSCode was how I triggered it the first few times, but then I was able to see it without Firefox open, so I doubt it's that specific combination.
It'd be good to figure out if this is VSCode, Electron, something in the accessibility API itself, or something the screen readers all get wrong.

Just saw anotherr report of this in the NVDA issue tracker.
I'm wondering if this can be looked at. Though only some users are affected, the program is virtually unuseable if you are.

@bpasero  Are there any plans to look in to this problem? other then that i love vscode. i have a suspicion that it is dificult to track this issue to the root of the problem.

@jcsteh  @Neurrone  interesting things hapining  when using f1 to search for settings nvda gets back the focus around the aplication accept the actual code editor window. test your selfs press f1 type something and then nvda starts to speek something up and you can use tab key to navigate around the aplication

it is possable to reed the code  in browsing view how ever when ever you go back to focus view it is gon even if you go back to the brows view.

hi I  know i posted to many comments how ever i found a working method how to get the focus back without exiting the aplication.
please make sure that you are on the vscode window
instructions
press ctrl pluss home and then press enter
and it should go back to focus.
it should be done automatikly how ever it works. nvda is just not refocusing for some reason.

I suspect this might be a problem with Electron; I think I might have seen this before in Cypress. I'll need to have it happen again to confirm.

@Neurrone  there is defintlly wrong something with electron, how ever skype seams to work fine and it is writne in electron, so it leavs the problem in vscode rather then  eelectron. .

@snufas what are you doing in Skype that works but does not work in VSCode?

You never get the lost focus issue in Skype 8.x, however Vs code is frequent enough to be sometimes annoying.

@bpasero I don't think that Skype is doing anything special. It also never happens to me on Skype; so my guess is that Code is doing something that most other apps are not that is exposing this bug in Electron.
I'm not sure how to go about finding the root cause of the editor window not being a child of the foreground window; it might require help from someone on the Electron or Chromium teams.

I'm not sure how to go about finding the root cause of the editor window not being a child of the foreground window

It is interesting that you mention this because I remember there where fixes around the window ordering on Windows to enable smooth scrolling for high precision touch devices. But Skype should by now be on the same version off Electron that we are in (Electron 3).

@bpasero  The problem is that when nvda  loses focus on code editing window it does not reed any menus in vscode eather.  when i manage to get the focus back on code editor window it still does not read the menu items at a top.  other interesting point is that nvda does not lose the focus if you are just using alt tab how ever if you use windows d shortkut to go to the desktop it loses the focus immediately.  I say it is something wrong in screenreader mode in vscode, because without a screanreder mode enabled the code edditor  is not accessible at all.  I wonder how come everything works at a start and then  doesn’t  work after windows d shortkut is used. Something hapins in the bacground that  brakes something.   I really hope some developer of vscode could  fix this.

@snufas any difference if you configure "window.titleBarStyle": "native"?

@bpasero  i am not sure what you meen by  "window.titleBarStyle": "native" i am asooming that is related to the vscode settings. i didin't played much with json settings in vscode.

Please do.

Hope this can be prioritized for fixing due to its extremely high impact. Just heard from someone that was experiencing this issue again.
I've just created an add-on with the workaround I mentioned for this issue. Source code is at https://github.com/Neurrone/Nvda-Vs-Code-Focus-Workaround.
Until I can sort out why appveyor isn't generating github releases, use this link to download the add-on.

Thank you, thank you, thank you so much.
Sent from my iPhone
On May 18, 2019, at 10:56 AM, Dickson Tan <notifications<EMAIL_ADDRESS>wrote:
Hope this can be prioritized for fixing due to its extremely high impact. Just heard from someone that was experiencing this issue again.
I've just created an add-on with the workaround I mentioned for this issue. Source code is at https://github.com/Neurrone/Nvda-Vs-Code-Focus-Workaround.
Until I can sort out why appveyor isn't generating github releases, use this link to download the add-onhttps://ci.appveyor.com/project/Neurrone/nvda-vs-code-focus-workaround/builds/24640369/artifacts.
—
You are receiving this because you commented.
Reply to this email directly, view it on GitHubhttps://github.com/microsoft/vscode/issues/28316?email_source=notifications&email_token=AGJYQW6QJ4PYVCVOXQAXYJDPWAKINA5CNFSM4DOUJUL2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGODVWQCSA#issuecomment-493683016, or mute the threadhttps://github.com/notifications/unsubscribe-auth/AGJYQW2DFVMUNT54L3CNR5LPWAKINANCNFSM4DOUJULQ.

Trying to narrow down the cause of this issue.
After commenting out the domContentLoaded handler in src\vs\workbench\electron-browser\main.ts which creates the various parts of the UI by running this.workbench.startup(), this issue is still occuring. So at least none of the code that creates the various UI components is causing this, leaving code that runs before this point.

@bpasero @deepak1556 reading the above discussion I could not figure out if it is an electron issue
@bpasero might you have some ideas / pointers I could look into experiment with to try to get this fixed

@Neurrone
there is a strange thing though,  if nvda lost the focus i can go to the very end of the code and press enter and focus comes back  to the code window, but not the menu windows.   i wonder what hapins in  the vs code that gets back the focus partially  though.

Can you try to reproduce with our nightly insider builds? You can give our preview releases a try from: https://code.visualstudio.com/insiders/

I am getting this error when trying llatest nightly   build:
The setup files are corrupted. Please obtain a new copy of the
program.

Saw the notifications of this.  Figured it might be worth chiming in again to note that I have in the past seen this bug but have recently been doing development of my own Electron app across multiple machines and haven't seen it in my code.  Things I've used, usually in isolation at least for this stage of the project:

React
aria-live, aria-posinset, aria-setsize, aria-expanded, and the treeview roles in combination.
Tabindex on weird elements (i.e. a p tag, which seemed like a good idea at the time).
React, and whatever react does to the DOM.
Some very heavy DOM manipulations as a stress test.

The only bug I found so far in the stack accessibility-wise is that you can't do ole="treeview" without tabindex` or something between NVDA and Chrome will eliminate the treeview from virtual navigation.  Which would seem to maybe be related, but I doubt it.
I'm doing some pretty complex custom controls basically, and given the fear around this issue popping up that I got from a lot of people, it so far hasn't.  SO I'm assuming that there's probably some very complicated sort of thing between all 3 pieces that's not playing nice--but between my own development and Slack working, Electron alone doesn't seem to be enough to trigger it.
As a last note, however, electron's accessibility tree seems slightly odd. You can go up to the ancestors with NVDA object nav, but going back down isn't symmetric.  So there is at least something odd, just perhaps not broken odd.
I'm developing some custom data editing stuff that should exercise most of the rest of Aria, etc, over the next few months. If I end up reproducing this I'll try to remember that this issue exists.

@snufas that is weird and should not happen, here is a direct link for just the archive without setup: https://az764295.vo.msecnd.net/insider/7f53e50cbf316dff94fbbe5406d8f352dac99a6b/VSCode-win32-x64-1.36.0-insider.zip

@bpasero  the setup you provided worked,  saime problem though.  this needs to be investigated , because even blind people want to code and this issue persists  for a while now.   it would be nice if someone  who have contacts and influence would solve this problem with nvda developers.  people can comment as long as they want and nothing would hapin if there is nno action taken. I am not that advanced yet to do troubleshooting for this issue.

Understood, thanks for trying 👍

for nvda screen reader   users i found a temporary  solution how to solve this problem. it is not related to the vs code it self so to avoid losing focus just move vscode to the separate desktop for example you can use desktop 3 for vscode and nothing else and when you want to work with other applications use ctrl+win+left arrow to switch  between desktops.  it is not perfect but better then nothing. i used to  lose focus when win+d command is used. but when the instance of vs code is in the  separate window it does not affect  vscode if it is located in other desktop.

@Neurrone
I know you can reproduce this semi-reliably (or could). Can you confirm @snufas's solution? I could only ever reproduce it 1 in 20 or less and don't have the same machine configuration as last time I tried to do so.
I know I'm not actively working on this but "works reliably when switching virtual desktops" is this side of plausible so I  want to make sure someone who can repro sees it.
@snufas and anyone else blind who might find this:
notepad++ works reliably as long as you don't use the 64-bit version (there's an outstanding bug being fixed in the next NVDA release). You may be able to switch to that instead, plus a command line for building/running.

@camlorn
so are you suggesting to use notepad++   instead vs code???  that is not a very good idea it does not have saime features it is just bearly better then actual notepad, just with more functions.  virtual desktops works quite whell how ever the code terminal is not accesible at all.  i am using cmd as my terminal  instead powershell  but it opens in saime window,  as a usual terminal does not in the usual cmd window.
@bpasero
i wonder can i make to open the code in the cmd console window   rather then the usual terminal window?  when i run the code?
i have the folowing string in my json
"terminal.integrated.shell.windows": "C:\WINDOWS\System32\cmd.exe"

I use Notepad++ professionally. I may try VSCode seriously one day but haven't so far had the need and people tend to stick religiously to their editors (plus, this issue does occur for me enough to be annoying, just not enough that I can quickly test).  Ymmv but there is at least a way to get your job done in a professional context if necessary, and that's worth having documented.
I don't want to take this issue any more off topic. If people need help I may be able to do so, but my time is limited; contact me privately but be aware that I may be slow to respond and may not be able to invest a lot of time in it.

I'm no longer able to replicate this issue, I think something either in NVDA or Code changed within the last month or so that might have fixed it. I'm using the latest insider build.

@Neurrone cool, we updated Electron from 3 to 4, maybe that had an impact? Ok to close?

yes the issue has been fixed.  thanks.

Awesome this got fixed 🎉


can not work on windows 10

Please provide us with the following information:

OS?

Windows 10

Versions.

angular-cli: 1.0.0-beta.19-3
node: 6.8.1
os: win32 x64

Repro steps.

it's created by cli

The log given by the failure.

<EMAIL_ADDRESS>scripts.postinstall success, use 211ms
All packages installed (1165 packages installed from npm registry, use 2m, speed 64.16kB/s, json 1414(8.62MB), tarball 0B)                             9465ms building modules         7ms add11641ms1709ms asset48ms emittingHash: 8fa4df10bec17af6f64f
Version: webpack 2.1.0-beta.25
Time: 13405ms
Asset       Size  Chunks             Chunk Names
main.bundle.js    2.48 MB    0, 2  [emitted]  main
styles.bundle.js    10.4 kB    1, 2  [emitted]  styles
inline.js    5.53 kB       2  [emitted]  inline
main.map    2.58 MB    0, 2  [emitted]  main
styles.map    14.7 kB    1, 2  [emitted]  styles
inline.map    5.59 kB       2  [emitted]  inline
index.html  474 bytes          [emitted]

ERROR in multi main
Module not found: Error: Can't resolve 'webpack-dev-server/client?http://localhost:4200/' in 'C:\Users\Daniel-PC\Documents\angular2_wordspace\testcli\node_modules.npminstall\angular-cli\1.0.0-beta.19-3\angular-cli\models' @ multi main
Child html-webpack-plugin for "index.html":
Asset     Size  Chunks       Chunk Names
index.html  2.81 kB       0
webpack: bundle is now VALID.
I skip npm installation when run "ng new xxx"
and also run "npm install " in the target folder

Thanks! We'll be in touch soon.

Dupe of https://github.com/angular/angular-cli/issues/2891


Two links in CONTRIBUTING document are broken

Version:
Platform:
Subsystem:

Type: Bug

Severity: Low
Description:
Two links in CONTRIBUTING.md are broken.
Steps to reproduce the error:

Open your browser
Navigate to CONTRIBUTING.md
Click on link standard IPFS Community contributing guidelines -> broken
Click on link IPFS JavaScript Community contributing guidelines -> broken

Fix at https://github.com/libp2p/js-libp2p/pull/403


Syntax highlighting

It’s probably worth having separate issues for subtasks of the main issue.  I’ll transfer info from the main issue here.

@ErikSchierboom Outlined the basic ask here
@razetime pointed at a codemirror plugin we might be able to use wholesale.

@ErikSchierboom - Is there any doc you can link to to show exactly where these hooks are?
Searches under exercism/ for “syntax” and “highlighting” turned up nothing.  Search for “codemirror” turned just this wren related project.  A search for “editor” resulted only in that same link.

@gitonthescene The highlightjs configuration is in the config.json file. It is mentioned as part of the "Prepare for launch" document which is linked to in https://github.com/exercism/bqn/issues/1.
The codemirror plugin loading is done here: https://github.com/exercism/website/blob/main/app/javascript/components/misc/CodeMirror/languageCompartment.ts

@ErikSchierboom - Awesome!  Thanks very much.

@ErikSchierboom - FWIW, it looks like searching at the org level defaults to looking for repository names.  I needed to switch to the Code tab to find the info you linked.  Thanks again.

Am I right to read this as meaning the language must be registered at highlight.js since it’s a required field?

No, it could also be a highlightjs plugin, it doesn't have to be registered anywhere (well, except for NPM).

just FYI, it's possible to reuse codemirror highlighting to highlight static text (outside of codemirror editor), example code here.

@andreypopp - This sounds like how Exercism itself should be set up rather than requiring two different methods.
@ErikSchierboom

What do you mean?

@ErikSchierboom - I’m not sure where the confusion is.  Instead of using highlight.js in the linked file we could just use the codemirror plugin as suggested in the code that @andreypopp linked above.
Is there any reason not to use the codemirror plugin for stand-alone highlighting?
Obviously allowing this doesn’t preclude using highlight.js when it has ben configured.  But reusing the codemirror highlighting ensures consistency in addition to being less work.

@iHiD Is it really that much overhead over loading highlight.js?  Again, using the same component ensures consistency.

The overhead would be loading codemirror. But yes, turning every place that solutions are rendered on the site into JavaScript components rather than just HTML would be a big increase. Consider that we have pages everywhere of dozens of solutions: https://exercism.org/profiles/ErikSchierboom/solutions - all of the rendering for those would move client-side, and thus would be slower, would be worse for SEO, etc.

all of the rendering for those would move client-side, and thus would be slower

Not really, the snippet of code I've linked above can be run on server at the time of static site generation, you'd need to change callback to produce HTML strings instead of build DOM nodes. That way there won't be any codemirror code loaded at runtime.

Not really, the snippet of code I've linked above can be run on server at the time of static site generation

Yes, but we're running Ruby, not JavaScript on our backend. We could shell out to Nodejs to run code, but that would also mean getting a performance hit.
While we appreciate your thoughts on this, we won't be replacing highlightjs with codemirror. Highlightjs has worked great for us, is more performant than codemirror and supports more languages.

not really pushing on anything, just tried to provide factually correct  information about what codemirror highlighting infra is :) sorry for the noise

No problem. Thanks.

@ErikSchierboom So it looks like we have a published codemirror plugin to register.  Is there anything we should do to test the plugin once it's been added.

We'll add the track to the website, but still inactive. That way you'll be able to test the track without any students being able to access the track. I'll let you know when I've had time to do so.

Super.  Thanks very much.

started a highlightjs plugin. React with a thumbs up to this message if you'd like contributor access.

@gitonthescene See https://github.com/exercism/website/pull/3165

@ErikSchierboom Thanks for doing this.  I’m traveling at the moment but will have a look at what’s up when I’m back.

so. both codemirror and a highlightjs plugin are complete. Do I have to get an npm package in?

have published it at https://www.npmjs.com/package/highlightjs-bqn. Hopefully it works correctly with the highlightjs node plugin.

@razetime Seems to be working. I've opened a PR: https://github.com/exercism/website/pull/3397
You'll need to update the config.json to change the highlightjs language to bqn.

PR has been merged!


Use String.split if the separator is only one character long

Using String.split if the separator is only one character long (normal character or a backslash followed by a special character) is very fast as it is not treated internally as a regular expression but if the separator is a real regular expression it will internally compile the regular expression at each call which has a significant cost in term of performances.  In that case we are supposed to use a field private static final of type Pattern which is possible because a Pattern is Immutable/thread safe and use this field to call split(input) instead of doing input.split(regexp).
So for example in my laptop calling 1 M times split("\s") takes more than 20 seconds and doing the same thing with a pre-created Pattern object takes 9.4 seconds which represents a performance improvement of more than 50 %.

@yegor256 please dispatch this issue

@essobedo since there is no milestone yet I set it to "1.0"

@essobedo thanks for this report, I added 15 mins to your account, in transaction 77676303

@dalifreire this ticket is yours now, please proceed, and keep in mind this. Any technical questions you should ask right here; The budget of this issue is 30 mins, which is exactly how much will be paid when the task is done (see this for explanation)

@davvd Could you better explain what must be done? My task must be find and replaces all occurrences (all the takes project) of the string.split("x") by a Pattern field type?

@dalifreire You are supposed to identify all the places in the code where we use String.split(regexp) with regexp that is at least 2 character long knowing that backslash followed by a special character is still considered as 1 character long. So for example String.split(" ") is OK as it is one character long, String.split(".") is OK as it is a backslash followed by a special character which is dot in this case but String.split("\s") is KO as it is at least two character long. Once you identified all the places, you will need to replace them with a private static final field. Is it clear now?

@essobedo Thanks, it's clear now.

@essobedo @davvd Fixed!
I have a question.. We have a code formatter template for eclipse (we can avoid a lot of qulice checkstyle rules problems)??

@dalifreire Your PR still violates some qulice checkstyle rules. Here you can find a link with the settings of Yegor for Intellij.

@essobedo Thanks! I'll verify the checkstyle rules.

@essobedo Please, could you take a look again? Thanks!

@dalifreire sounds good now

@davvd Please, see PR #619

@davvd Please, see PR #619

@dalifreire I will take a look, thanks

@davvd The PR #619 was merged, can you close the issue?

@davvd The PR #619 was merged, can you close the issue?

@dalifreire I'm not the author of the ticket, please close OP to close it

@dalifreire I close it

@ypshenychka please, review this issue for QA compliance, as per par.24

@davvd Quality is good.

@davvd Quality is good.

@ypshenychka thanks a lot

@dalifreire 10 mins was added to the account of @ypshenychka (for QA review), in transaction 79248795
Many thanks! 30 mins were added to your account in Transaction ID 79248825 (task took 265 hours and 48 mins)
+30 to your rating, your total score is +90


chore(release): v1.0.1 🎉

:robot: I have created a release beep boop
1.0.1 (2024-05-26)
Bug Fixes

pkg: publish under @ehmpathy namespace (f39132c)

This PR was generated with Release Please. See documentation.

:robot: Release is at https://github.com/ehmpathy/as-command/releases/tag/v1.0.1 :sunflower:


Query in download CSV not rendered #1623

Fix query text rendering in CSV downloads by updating write_output to include the query in headers and data, and modifying set_long_wide_format to handle queries in wide format, resolving issue #1623.

 Such code. Much wow.


多gpu训练时出现除数为0的现象

作者您好，首先非常感谢您的杰出工作。
在训练的过程中，我遇到单gpu训练正常，但是多gpu训练会出现除数为0的现象。我阅读这部分代码，并没有发现代码逻辑错误，可以帮忙看看是怎么回事吗？
非常感谢感谢感谢！
2022-10-25 09:26:02,847 - clrnet.utils.recorder - INFO - epoch: 0  step: 1  lr: 0.000600  loss: 12.9223  cls_loss: 5.2943  reg_xytl_loss: 3.2206  seg_loss: 2.6702  iou_loss: 1.7371  stage_0_acc: 93.5330  stage_1_acc: 95.6814  stage_2_acc: 96.4410  stage_3_acc: 96.3216  data: 2.2079  batch: 17.4761  eta: 22 days, 11:16:44
Traceback (most recent call last):
File "main.py", line 75, in
main()
File "main.py", line 39, in main
runner.train()
File "/opt/data/private/Algorithm/lane-detection/clrnet/clrnet/engine/runner.py", line 101, in train
self.train_epoch(epoch, train_loader, tb_writer)
File "/opt/data/private/Algorithm/lane-detection/clrnet/clrnet/engine/runner.py", line 63, in train_epoch
output = self.net(data)
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/mmcv/parallel/data_parallel.py", line 42, in forward
return super().forward(*inputs, **kwargs)
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 167, in forward
outputs = self.parallel_apply(replicas, inputs, kwargs)
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/nn/parallel/data_parallel.py", line 177, in parallel_apply
return parallel_apply(replicas, inputs, kwargs, self.device_ids[:len(replicas)])
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 86, in parallel_apply
output.reraise()
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/_utils.py", line 429, in reraise
raise self.exc_type(msg)
ZeroDivisionError: Caught ZeroDivisionError in replica 0 on device 0.
Original Traceback (most recent call last):
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/nn/parallel/parallel_apply.py", line 61, in _worker
output = module(*input, **kwargs)
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/data/private/Algorithm/lane-detection/clrnet/clrnet/models/nets/detector.py", line 33, in forward
output = self.heads(fea, batch=batch)
File "/opt/data/private/conda_env/envs/clrnet/lib/python3.8/site-packages/torch/nn/modules/module.py", line 889, in _call_impl
result = self.forward(*input, **kwargs)
File "/opt/data/private/Algorithm/lane-detection/clrnet/clrnet/models/heads/clr_head.py", line 275, in forward
return self.loss(output, kwargs['batch'])
File "/opt/data/private/Algorithm/lane-detection/clrnet/clrnet/models/heads/clr_head.py", line 454, in loss
cls_acc.append(sum(cls_acc_stage) / len(cls_acc_stage))
ZeroDivisionError: division by zero

Maybe you are using a small batch size, and all samples in this batch have no postive samples.
You can try:
cls_acc.append(sum(cls_acc_stage) / (len(cls_acc_stage))+1e-6).

Hello, thanks for your great work. Here, when dealing with small batch size, cls_acc.append(sum(cls_acc_stage) / (len(cls_acc_stage))+1e-6) still not work, and I think you mean this cls_acc.append((sum(cls_acc_stage) + 1e-6) / (len(cls_acc_stage) + 1))

Hello, thanks for your great work. Here, when dealing with small batch size, cls_acc.append(sum(cls_acc_stage) / (len(cls_acc_stage))+1e-6) still not work, and I think you mean this cls_acc.append((sum(cls_acc_stage) + 1e-6) / (len(cls_acc_stage) + 1))

Hello, thank you for your answer. I have modified it according to your answer, and there is no ZeroDivisionError: division by zero error when batch=4. However, the accuracy values of stage_0_acc, stage_1_acc, and stage_2_acc during the training process have changed from around 97% to around 74/85/88. What impact will this have?


React Component - integration

How can I integrate this with React?
Do I have to create custom react component?
Regards,
Jure

You need to render an element with a ref that you can use to get a reference to the dom element and mount the chart.

I did a custom react component for now. Just for test, but it seems ok for now.
Obviously, I will need to add some props and state.
`import * as React from 'react';
import { createChart } from 'lightweight-charts';
export class LightweightChart extends React.PureComponent {
static defaultProps = {
	containerId: 'lightweight_chart_container',
};

chart = null;

componentDidMount() {

    const chart = createChart(this.props.containerId, { width: 800, height: 600 });
    this.chart = chart;

    const lineSeries = chart.addLineSeries();

    lineSeries.setData([
        { time: '2019-04-10', value: 60.01 },
        { time: '2019-04-11', value: 80.01 },
    ]);

    const barSeries = chart.addBarSeries({
        thinBars: false,
    });

    // set the data
    barSeries.setData([
        { time: "2019-04-10", open: 141.77, high: 170.39, low: 120.25, close: 145.72 },
        { time: "2019-04-11", open: 145.72, high: 147.99, low: 100.11, close: 108.19 },
             ]);
}

componentWillUnmount() {
	if (this.chart !== null) {
		this.chart.remove();
		this.chart = null;
	}
}

render() {
	return (

	);
}

}
`
Do you see any problems with that?

Personally I don't code React apps that way. I always keep the state outside of the component. That said, your approach is fine, except that personally I would use a ref instead of a static id.

Yes, I noticed that while reading your "refs" link. Since I don't need more than one for now, I'll keep it simple ;)
How do you mean state outside component? You make extra component for the state or you keep it in parent component?
Thanks for your help!

@jurepetrovic were you able to resolve this issue? Still having this issue: lightweight-charts.esm.production.js:7 Uncaught (in promise) Error: Value is null

Yes, it worked with code above. Then I just included  component where needed.

Yea this is not a solution as it creates another chart upon introducing state data.

I tackled this issue by using hooks in 2 separate useEffects as such :
import React from 'react';
import { createChart } from 'lightweight-charts';

let chart
let candlestickSeries

export default ({lastCandle}) => {
    const myRef = React.useRef()
    // console.log('candles' , lastCandle)
    React.useEffect(() => {
         chart = createChart(myRef.current, { width: 1000, height: 800 });
        chart.applyOptions({
            timeScale: {
                rightOffset: 45,
                barSpacing: 15,
                lockVisibleTimeRangeOnResize: true,
                rightBarStaysOnScroll: true,
            },
            priceScale: {
                position: 'right',
                // mode: 1,
                autoScale: false,
                // invertScale: true,
                alignLabels: true,
                borderVisible: false,
                borderColor: '#555ffd',
                scaleMargins: {
                    top: 0.65,
                    bottom: 0.25,
                },
                crosshair: {
                    vertLine: {
                        color: '#6A5ACD',
                        width: 0.5,
                        style: 1,
                        visible: true,
                        labelVisible: false,
                    },
                    horzLine: {
                        color: '#6A5ACD',
                        width: 0.5,
                        style: 0,
                        visible: true,
                        labelVisible: true,
                    },
                    mode: 1,
                },
                grid: {
                    vertLines: {
                        color: 'rgba(70, 130, 180, 0.5)',
                        style: 1,
                        visible: true,
                    },
                    horzLines: {
                        color: 'rgba(70, 130, 180, 0.5)',
                        style: 1,
                        visible: true,
                    },
                },

            },
        });
         candlestickSeries = chart.addCandlestickSeries({
            upColor: '#0B6623',
            downColor: '#FF6347',
            borderVisible: false,
            wickVisible: true,
            borderColor: '#000000',
            wickColor: '#000000',
            borderUpColor: '#4682B4',
            borderDownColor: '#A52A2A',
            wickUpColor: "#4682B4",
            wickDownColor: "#A52A2A",
        });
    }, []);

    React.useEffect(() => {
         candlestickSeries.update(lastCandle);
    }, [lastCandle]);

    return (
        <>

        </>
    );
}

Here's the simplest implementation I could come up with using hooks.
`import React, { useEffect } from 'react';
import { createChart } from 'lightweight-charts';
function Chart() {
const ref = React.useRef();
useEffect(() => {
const chart = createChart(ref.current, { width: 400, height: 300 });
const lineSeries = chart.addLineSeries();
lineSeries.setData([
{ time: '2019-04-11', value: 80.01 },
{ time: '2019-04-12', value: 96.63 },
{ time: '2019-04-13', value: 76.64 },
{ time: '2019-04-14', value: 81.89 },
{ time: '2019-04-15', value: 74.43 },
{ time: '2019-04-16', value: 80.01 },
{ time: '2019-04-17', value: 96.63 },
{ time: '2019-04-18', value: 76.64 },
{ time: '2019-04-19', value: 81.89 },
{ time: '2019-04-20', value: 74.43 },
]);
}, []);
return (
<>

</>
);
}
export default Chart;`

Here's a fairly good react wrapper: https://github.com/Kaktana/kaktana-react-lightweight-charts#readme

Anyone figured out how to do it using auto height and auto width ? Thanks

Here's the simplest implementation I could come up with using hooks.
import React, { useEffect } from 'react';
import { createChart } from 'lightweight-charts';

function Chart() {
  const ref = React.useRef();

  useEffect(() => {
    const chart = createChart(ref.current, { width: 400, height: 300 });
    const lineSeries = chart.addLineSeries();
    lineSeries.setData([
      { time: '2019-04-11', value: 80.01 },
      { time: '2019-04-12', value: 96.63 },
      { time: '2019-04-13', value: 76.64 },
      { time: '2019-04-14', value: 81.89 },
      { time: '2019-04-15', value: 74.43 },
      { time: '2019-04-16', value: 80.01 },
      { time: '2019-04-17', value: 96.63 },
      { time: '2019-04-18', value: 76.64 },
      { time: '2019-04-19', value: 81.89 },
      { time: '2019-04-20', value: 74.43 },
    ]);
  }, []);

  return (
    <>

    </>
  );
}

export default Chart;

For anyone having problem with duplicated chart when saving, just add a return inside useEffect
useEffect(() =>  {
  //... code

    return () => {
      chart.remove()
    }
}, [])

Anyone figured out how to do it using auto height and auto width ? Thanks

In my case I just omit the "with" to get 100%

Anyone figured out how to do it using auto height and auto width ? Thanks

@IbrahimSam96
In my case I just omit the "with" to get 100%

Thanks for your response! Here is another way doing it by attaching an event listener "resize" and removing it in the useEfect clean up.
const  LivePortfolioGraph = (props) => {

const [width, setWidth] = useState(0);
const [zobe, setZobe] = useState([]);

useEffect( ()=> {

const handleResize = _debounce(() => {chart.applyOptions({width: props.g.current.clientWidth,   });  } ,100 );

window.addEventListener("resize", handleResize);

const chart = createChart(props.g.current, {
        width: width,
        height: 450,
        layout: {
            textColor: '#d1d4dc',
            backgroundColor: '#131722',
        },
        rightPriceScale: {
            scaleMargins: {
                top: 0.3,
                bottom: 0.25,
            },
        },
        timeScale: {
            visible: true,
        },
        crosshair: {
            vertLine: {
                width: 5,
                color: 'rgba(224, 227, 235, 0.1)',
                style: 0,
            },
            horzLine: {
                visible: false,
                labelVisible: true,
            },
        },
        localization: {
            priceFormatter: price => {
            const nf = new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' })
             return   nf.format(price)
            },

        },
        grid: {
            vertLines: {
                color: 'rgba(42, 46, 57, 0)',
            },
            horzLines: {
                color: 'rgba(42, 46, 57, 0)',
            },
        },
});

var areaSeries = chart.addAreaSeries({
topColor: 'rgba(38, 198, 218, 0.04)',
bottomColor: 'rgba(38, 198, 218, 0.04)',
lineColor: 'rgba(38, 198, 218, 1)',
lineWidth: 2,
crossHairMarkerVisible: false,
});

// Clean Up
return () => {
window.removeEventListener('resize', handleResize);

}

}, [zobe])

return (

)

}

export default LivePortfolioGraph;

Here's the simplest implementation I could come up with using hooks.
import React, { useEffect } from 'react';
import { createChart } from 'lightweight-charts';

function Chart() {
  const ref = React.useRef();

  useEffect(() => {
    const chart = createChart(ref.current, { width: 400, height: 300 });
    const lineSeries = chart.addLineSeries();
    lineSeries.setData([
      { time: '2019-04-11', value: 80.01 },
      { time: '2019-04-12', value: 96.63 },
      { time: '2019-04-13', value: 76.64 },
      { time: '2019-04-14', value: 81.89 },
      { time: '2019-04-15', value: 74.43 },
      { time: '2019-04-16', value: 80.01 },
      { time: '2019-04-17', value: 96.63 },
      { time: '2019-04-18', value: 76.64 },
      { time: '2019-04-19', value: 81.89 },
      { time: '2019-04-20', value: 74.43 },
    ]);
  }, []);

  return (
    <>

    </>
  );
}

export default Chart;

Anyone managed to get this working in typescript?  For me it doesn't like the fact that ref.current is of type undefined:
Argument of type 'undefined' is not assignable to parameter of type 'string | HTMLElement'.  TS2345

    30 |
    31 |   useEffect(() => {
  > 32 |     const chart = createChart(ref.current, { width: 400, height: 300 })
       |                               ^
    33 |     const candlestickSeries = chart.addCandlestickSeries()
    34 |     candlestickSeries.setData(candleData)
    35 |   }, [])

@jopfre Thanks for https://github.com/tradingview/lightweight-charts/issues/200#issuecomment-748493961! I was running into bugs with the React wrapper https://github.com/Kaktana/kaktana-react-lightweight-charts that I'm not encountering with your approach.

Here's the simplest implementation I could come up with using hooks.
Thanks for this @jopfre !

I'm still getting an error...how do we then use this in another component's render function?
render() {
        return (
            <>
                {TvChart(React.useRef())}
            </>
        );
    }

??
TIA!

I noticed that useEffect isn't getting called after the first render.
Is anyone else seeing this?
Problem here is the chart isn't receiving updated params when the state changes in the parent component.

import React from "react";
import { createChart } from 'lightweight-charts';

class ChartWrapper extends React.Component {
    state = {
    }

    constructor(props) {
        super(props);
        this.chartDiv = React.createRef();
    }

    componentDidMount() {
        this.chart = createChart(this.chartDiv.current, {
            width: 800, height: 400,
            timeScale: {
                timeVisible: true,
                secondsVisible: false,
            },
            watermark: {
                visible: true,
                fontSize: 34,
                color: 'rgba(0, 0, 0, 0.25)',
            },
        });

        window.addEventListener("resize", this.resizeHandler);
        this.resizeHandler();
    }

    componentDidUpdate() {
        this.addPriceData(this.chart, this.props.priceData, this.props.tradeData)

        // "Setting state" for the chart
        var options = {
            watermark: {
                text: this.props.waterData
            }
        }
        this.chart.applyOptions(options)
    }

    render() {
        return (

        );
    }

    // ------------------------------------------------------------------------
    resizeHandler = () => {
        this.chart.resize(this.chartDiv.current.parentNode.clientWidth, this.chartDiv.current.parentNode.clientHeight);
    }

    addLineData(chart, data) {
        const lineSeries = chart.addLineSeries();
        lineSeries.setData(data)
        console.log('added data to chart', data)
        return lineSeries
    }

    addPriceData(chart, data, tradeData) {
        if (!data) {
            return
        }

        if (data[0].value) {
            const lineSeries = this.addLineData(chart, data)
            this.addTradeMarkers(lineSeries, tradeData)
        } else if (data[0].open) {
            const lineSeries = chart.addCandlestickSeries();
            lineSeries.setData(data)
            this.addTradeMarkers(lineSeries, tradeData)
        }
    }

    addTradeMarkers(series, tradeData) {
        if (!series || !tradeData) {
            return
        }

        var markers = []
        tradeData.forEach((trade) => {
            if (trade.action === 'sell') {
                markers.push({ time: trade.time, position: 'aboveBar', color: '#e91e63', shape: 'arrowDown', text: 'Sell ' + trade.quantity });
            } else {
                markers.push({ time: trade.time, position: 'belowBar', color: '#2196F3', shape: 'arrowUp', text: 'Buy ' + trade.quantity });
            }
        })
        series.setMarkers(markers);
    }
}

export default ChartWrapper

useEffect(() => {
const chart = createChart(ref.current, { width: 400, height: 300 });
const lineSeries = chart.addLineSeries();
lineSeries.setData([
{ time: '2019-04-11', value: 80.01 },
{ time: '2019-04-12', value: 96.63 },
{ time: '2019-04-13', value: 76.64 },
{ time: '2019-04-14', value: 81.89 },
{ time: '2019-04-15', value: 74.43 },
{ time: '2019-04-16', value: 80.01 },
{ time: '2019-04-17', value: 96.63 },
{ time: '2019-04-18', value: 76.64 },
{ time: '2019-04-19', value: 81.89 },
{ time: '2019-04-20', value: 74.43 },
]);
}, []);

I was able to get this working in TS by wrapping everything in the useEffect with a ref.current null check
useEffect(() => {
    if (ref.current) {
      const chart = createChart(ref.current, { width: 400, height: 300 });
      const lineSeries = chart.addLineSeries();
      lineSeries.setData([
        { time: '2019-04-11', value: 80.01 },
        { time: '2019-04-12', value: 96.63 },
        { time: '2019-04-13', value: 76.64 },
        { time: '2019-04-14', value: 81.89 },
        { time: '2019-04-15', value: 74.43 },
        { time: '2019-04-16', value: 80.01 },
        { time: '2019-04-17', value: 96.63 },
        { time: '2019-04-18', value: 76.64 },
        { time: '2019-04-19', value: 81.89 },
        { time: '2019-04-20', value: 74.43 },
      ]);
    }
  }, [ref]);

Here's the simplest implementation I could come up with using hooks.
import React, { useEffect } from 'react';
import { createChart } from 'lightweight-charts';

function Chart() {
  const ref = React.useRef();

  useEffect(() => {
    const chart = createChart(ref.current, { width: 400, height: 300 });
    const lineSeries = chart.addLineSeries();
    lineSeries.setData([
      { time: '2019-04-11', value: 80.01 },
      { time: '2019-04-12', value: 96.63 },
      { time: '2019-04-13', value: 76.64 },
      { time: '2019-04-14', value: 81.89 },
      { time: '2019-04-15', value: 74.43 },
      { time: '2019-04-16', value: 80.01 },
      { time: '2019-04-17', value: 96.63 },
      { time: '2019-04-18', value: 76.64 },
      { time: '2019-04-19', value: 81.89 },
      { time: '2019-04-20', value: 74.43 },
    ]);
  }, []);

  return (
    <>

    </>
  );
}

export default Chart;

Anyone managed to get this working in typescript? For me it doesn't like the fact that ref.current is of type undefined:
Argument of type 'undefined' is not assignable to parameter of type 'string | HTMLElement'.  TS2345

    30 |
    31 |   useEffect(() => {
  > 32 |     const chart = createChart(ref.current, { width: 400, height: 300 })
       |                               ^
    33 |     const candlestickSeries = chart.addCandlestickSeries()
    34 |     candlestickSeries.setData(candleData)
    35 |   }, [])

I have to admit that the following type assertion is not beautiful, but it does its job:
  const ref = useRef() as React.MutableRefObject<HTMLDivElement>;

Here's a whole chart component.
import * as React from 'react';
import { createChart } from 'lightweight-charts';
import { useEffect, useRef, useState } from 'react'

interface ILineChart {
}

const LineChart: React.FunctionComponent<ILineChart> = (props) => {
  const ref = useRef() as React.MutableRefObject<HTMLDivElement>;

  useEffect(() => {
    const chart = createChart(ref.current, { width: 400, height: 300 });
    const lineSeries = chart.addLineSeries();
    lineSeries.setData([
      { time: '2019-04-11', value: 80.01 },
      { time: '2019-04-12', value: 96.63 },
      { time: '2019-04-13', value: 76.64 },
      { time: '2019-04-14', value: 81.89 },
      { time: '2019-04-15', value: 74.43 },
      { time: '2019-04-16', value: 80.01 },
      { time: '2019-04-17', value: 96.63 },
      { time: '2019-04-18', value: 76.64 },
      { time: '2019-04-19', value: 81.89 },
      { time: '2019-04-20', value: 74.43 },
    ]);
    return () => {
      chart.remove()
    }
  }, []);

  return (
    <>

    </>
  )
};

export default LineChart;

Btw we're going to prepare a tutorial how to make lightweight-charts work with react app so if anybody we'll have a time to look at #958 - feel free to leave any suggestions/ideas there.

The tutorials are deployed here now https://tradingview.github.io/lightweight-charts/tutorials. If you'll have any questions/suggestions/feedback - please create a discussion/issue.

Can you add a tutorial on how to add a tooltip with react? thank you!

The tutorials are deployed here now https://tradingview.github.io/lightweight-charts/tutorials. If you'll have any questions/suggestions/feedback - please create a discussion/issue.


Update references from MD_EXTENSIONS to MARKDOWN

Description
Updated the 404.md and table-of-contents.md files to be consistent with the format of the search page.
Reorganized and rewrote the content of the table-of-contents.md to break it down into more easily readable chunks.
Note: Issue 301 specifies that all documentation referring to MD_EXTENSIONS should be replaced with MARKDOWN.  As far as I can see, the table of contents page was the only page to include such a reference.
Closes #301

@talha131 some of the failures in CI are 'dictionary' related, can it have the words added?

Closed via https://github.com/Pelican-Elegant/elegant/pull/441


Handle discord client restarting

Currently if you open Discord, open HK with this mod, then restart Discord, the rich presence will be broken until you restart HK again. It seems that this is because the GameSDK doesn't handle reconnections automatically. Instead, it seems that you need to detect the NotRunning result, and re-initialize the GameSDK.

Actually, reading further into the thread it seems that solution is actually not recommended. :(


Refresh cycle

Description
Hello everyone,
I'm wondering if an automatic refresh fonction will be implemented at some point ? I know that Homarr is not a monitoring tool, but an option to refresh every X minutes or seconds would be perfect so check status.
Thank you for this great software.
Please tick the boxes

[X] You've read the docs
[X] You've checked for duplicate issues

Hi,
Could you develop on what would need to refresh?
Almost every widget is already on a refetch cycle constantly updating the page.
Sometimes it's more obvious than others like with the download widget showing a graph updating every second, but other are more softly updated like the media request that will only show once a new request is made even though it's constantly checking the list.

Hi,
It's more for the apps added without any integration like websites, that doesn't refresh by itself.

Are you talking about iframes?
I'm really struggling to understand what you mean here.
The only things apps have that aren't integrations is pings, which also refreshes periodically.
All refreshes of the sort are being done every x minutes as to not spam the network but are still being done.

Then yes, i am talking about pings, sorry for the lack of clarity.

Installed Homarr yesterday and I'm seeing the same issue.
The Plex widget, for instance, is pulsing green.
I close the Plex server but the pulse remains green.
After a few minutes I refresh the Homarr web page - pulse now red.
Restart Plex server - pulse stays red, currently  10 minutes after restart.

I would like to have this feature also.


[4.0.3] Huge performance issues

Hi,
I love kwm since it's early stage, but I encounter huge performance issues with the WindowServer process. It looks like that stopping the kwm service immediately reduce the CPU usage.
This seems to appear exclusively when using my multi-monitor setup (2 FHD external displays + the internal).
Do you have some tips to provide more informations on this ? and/or some ways to debug this ?
Could it be related to rules ?
Has someone encounter such an issue ?
Thanks

Seems like this is related to https://github.com/koekeishiya/kwm/issues/540
Already fixed in v4.0.4

thanks, indeed I just saw I wasn't on the latest release.
Just updated to 4.0.4. I close the issue and will reopen it if I encounter the problem again.
Thanks for your answer and your hard work !