sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: opencv
Issue: A possible bug in stereobm.cpp
Labels: question (invalid tracker),incomplete

##### System information (version)
- OpenCV => 4.2
- Operating System / Platform => Linux 64 Bit
- Compiler => gcc

##### Detailed description

I found the parabola interpolation used in the stereobm is quite weird.
`if( 0 < mind && mind < ndisp - 1 )
{
                int p = sad[mind+1], n = sad[mind-1];
                d = p + n - 2*sad[mind] + std::abs(p - n);
                dptr[y*dstep] = dispDescale<dType>(ndisp - mind - 1 + mindisp, p-n, d);
}`


I found the standard function of the parabola interpolation should be 
min_d = d-(f(d+1)-f(d-1))/(2*(f(d-1)-2*f(d)+f(d+1)))
I don't know why the std::abs(p-n) is added  and there is a 2 in the denominator is missing.


##### Steps to reproduce

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->

##### Issue submission checklist

 - [ ] I report the issue, it's not a question
   <!--
   OpenCV team works with answers.opencv.org, Stack Overflow and other communities
   to discuss problems. Tickets with question without real issue statement will be
   closed.
   -->
 - [x] I checked the problem with documentation, FAQ, open issues,
       answers.opencv.org, Stack Overflow, etc and have not found solution
   <!--
   Places to check:
   * OpenCV documentation: https://docs.opencv.org
   * FAQ page: https://github.com/opencv/opencv/wiki/FAQ
   * OpenCV forum: https://answers.opencv.org
   * OpenCV issue tracker: https://github.com/opencv/opencv/issues?q=is%3Aissue
   * Stack Overflow branch: https://stackoverflow.com/questions/tagged/opencv
   -->
 - [x] I updated to latest OpenCV version and the issue is still there
   <!--
   master branch for OpenCV 4.x and 3.4 branch for OpenCV 3.x releases.
   OpenCV team supports only latest release for each branch.
   The ticket is closed, if the problem is not reproduced with modern version.
   -->
 - [ ] There is reproducer code and related data files: videos, images, onnx, etc
   <!--
   The best reproducer -- test case for OpenCV that we can add to the library.
   Recommendations for media files and binary files:
   * Try to reproduce the issue with images and videos in opencv_extra repository
     to reduce attachment size
   * Use PNG for images, if you report some CV related bug, but not image reader
     issue
   * Attach the image as archite to the ticket, if you report some reader issue.
     Image hosting services compress images and it breaks the repro code.
   * Provide ONNX file for some public model or ONNX file with with random weights,
     if you report ONNX parsing or handling issue. Architecture details diagram
     from netron tool can be very useful too. See https://lutzroeder.github.io/netron/
   -->
Repository: terminal
Issue: Add a global mechanism for refering to actions
Labels: Issue-Feature,Area-Settings,Product-Terminal

Spec: #6902, [#6899 - Action IDs.md](https://github.com/microsoft/terminal/blob/main/doc/specs/%236899%20-%20Action%20IDs/%236899%20-%20Action%20IDs.md)

> As we come to rely more on actions being a mechanism by which the user defines
> "do something in the Terminal", we'll want to make it even easier for users to
> re-use the actions that they've already defined, as to reduce duplicated json as
> much as possible. This spec proposes a mechanism by which actions could be
> uniquely identifiable, so that the user could refer to bindings in other
> contexts without needing to replicate an entire json blob.

> ![](https://github.com/microsoft/terminal/raw/main/doc/specs/%236899%20-%20Action%20IDs/data-mockup-actions-and-ids-and-keys.png)
Repository: terminal
Issue: Epic: Introduce Actions page to the Settings UI
Labels: Product-Terminal,Issue-Scenario,Area-SettingsUI

_written and maintained by @carlos-zamora_
## Description

A largely missing part of the Settings UI is actions. This will allow the user to customize their command palette and key bindings without the need to go into the JSON.

Much like the implementation plan for the Settings UI, there are many moving pieces to this that are outside of the `TerminalSettingsEditor` project:
- [x] #8100: Inheritance for actions
  - enables ability to track where an action came from
  - PR #9621 
- [x] serialization for actions
  - step 1: general serialization
  - step 2: only serialize meaningful changes into settings.json (don't serialize the whole thing)
  - PR #9926 
- [x] Design Settings UI representation
   - PR #9427
- [x] Implement proposed design
  - Foundation (PR #9949)
     - delete a key binding
     - set the key chord for a key binding
     - miscellaneous work (i.e. keyboard navigation, accessibility, etc...)
  - Set Action
     - change the action for a key binding (PR #10220)
     - add a new key binding (PR #10550)

Some follow-up work items:
- [x] Key chord editor/listener
   - Instead of parsing key chord text, it'd be nice if we could listen for key chords.
   - Inspiration: We should take a look at how PowerToys got around this problem.
   - Inspiration: An old version of SUI also had this implemented (back during the hackathon).
   - PR #10652
- [ ] "the unbound bug"
   - Edit `switchToTab` to `win+shift+q`. Save. Edit `switchToTab` to `ctrl+shift+t`.
   - `"unbound": "win+shift+q"` appears but doesn't need to exist.
- [ ] `Actions::_GetContainerIndexByKeyChord` optimization
   - We're just doing a O(n) search for a matching key chord, but we could technically do this much faster.
   - The list is already sorted by command name, so if we...
      1. use `GetActionByKeyChord()` to get the `Command`
      2. perform a binary search on the list using `Command::Name()` (assuming it has a name)
   - we should be able to accomplish this search in O(log n) time (usually)'
- **Performance**
   - [ ] Clicking Actions in the left bar of Settings takes about 3 seconds to load and doesn't cache/keep it 
- [ ] #11341


Bugs:
- Settings Model:
   - [X] #10365: not serializing top-level "iterateOn" commands! (PR #10373)
   - [x] `GetKeyBindingForAction` doesn't always find the given action (PR #10341)
- Settings UI:
   - [x] #10406: Edit button on actions page is invisible with light theme

## References
#7175 should be kept in mind during this design.
Repository: pytorch
Issue: [jit] support for torch.distributed primitives
Labels: oncall: jit,weeks

## 🚀 Feature
The [`torch.distributed`](https://pytorch.org/docs/stable/distributed.html) package provides PyTorch support and communication primitives for multiprocess parallelism across several computation nodes running on one or more machines. It is the new basis for the `DistributedDataParallel` wrapper class, which provides a higher-level toolkit for performing synchronous distributed training.

An internal request is that we extend TorchScript to support the `torch.distributed` package, so that people can use the distributed communication primitives within a TorchScript program.


cc @suo @gmagogsfm
Repository: rust
Issue: Putting braces around match arm with macro call and trait resolution breaks parser
Labels: A-macros,C-bug

<!--
Thank you for filing a bug report! 🐛 Please provide a short summary of the bug,
along with any information you feel relevant to replicating the bug.
-->

I tried this code:

```rust
struct X;

macro_rules! foo {
    () => (X);
}

fn foo(a: u32) {
    let _: Option<X> = match a {
        // This obviously works
        0 => X.into(),
        // This works as well
        1 => foo!{}.into(),
        // This does not
        _ => {
            foo!{}.into()
        },
    };
}
```

I expected to see this happen: The code for the default match arm parses successfully just like the others.

Instead, this happened: It errors for the default match arm, because of the braces. This happens on every stable and nightly i've tested. This is a minimal reproducer from a program using quote, which gets constantly broken because rustfmt tries to format the actually longer line into a block.

### Meta
<!--
If you're using the stable version of the compiler, you should also check if the
bug also exists in the beta or nightly versions.
-->

Playground [stable](https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=bcaef315a0aca327cd8b3dc7cfa53868), [nightly](https://play.rust-lang.org/?version=nightly&mode=debug&edition=2018&gist=a882ba179d1e1da92bb90086e50986f3)

`rustc --version --verbose`:
```
rustc 1.45.0-nightly (7ced01a73 2020-04-30)
binary: rustc
commit-hash: 7ced01a730e8fc1bae2f8d4369c26812c0484da4
commit-date: 2020-04-30
host: x86_64-unknown-linux-gnu
release: 1.45.0-nightly
LLVM version: 9.0
```
Repository: PowerToys
Issue: [KBM] Allow for programming of the secondary value of NUMPAD keys
Labels: Idea-Enhancement,Product-Keyboard Shortcut Manager

# Summary of the new feature/enhancement
NUMPAD keys can produce 2 different key presses depending on if you have NUMLOCK enabled or not. E.g. NUMPAD 0 can either type the number 0 or NUMPADINSERT (notice this is different from the regular INSERT, even though they more or less perform the same action).
<!-- 
A clear and concise description of what the problem is that the new feature would solve.
Describe why and how a user would use this new functionality (if applicable).
-->

I want to use the secondary key value attached to NUMPAD keys and still be able to use the 6 functions keys to the left of the numpad separately (i.e., INS, HOME, PGUP, DEL, END, PGDN). So, if I use NUMPADINSERT (while NUMLOCK is OFF) for media play/pause, it plays/pauses my media and the INSERT key (physically to the left of the NUMPAD) is not affected.

# Proposed technical implementation details (optional)
In AutoHotKey the keycode I use is - "NumpadIns" keys, here are some other possible keycode values that might be useful:
- https://developer.mozilla.org/en-US/docs/Web/API/KeyboardEvent/keyCode
- https://keycode.info/

<!-- 
A clear and concise description of what you want to happen.
-->
Would love to see this implemented as I think this can make the numpad doubly useful.
Repository: PowerToys
Issue: Change playback source with hotkey
Labels: Help Wanted,Idea-New PowerToy,Resolution-Built into Windows

# Summary of the new feature/enhancement
A hotkey that changes the playback source on your computer. Makes swapping between playback sources quick and easy into a single hotkey, sometimes I use headphones and other times my speakers, I currently use [https://soundswitch.aaflalo.me/](SoundSwitch) to do this.
<!-- 
A clear and concise description of what the problem is that the new feature would solve.
Describe why and how a user would use this new functionality (if applicable).
-->
It would allow for quick switching between playback sources and I think it matches this projects goal of performing common actions and making it as simple as possible.

# Proposed technical implementation details (optional)
Maybe the [https://github.com/Belphemur/SoundSwitch](SoundSwitch Github) can be useful. 
<!-- 
A clear and concise description of what you want to happen.
-->
I would love to see implementation as I think it matches this projects goal and is extremely useful.
Repository: flutter
Issue: Autofill a page without interacting with its text fields
Labels: a: text input,c: new feature,framework,P3,team-framework,triaged-framework

Some (web) autofill services let the user autofill the current page in the extension's dropdown menu, so those extensions need to know the text fields ahead of time, even before any of the text fields gets the focus.

Extracted from https://github.com/flutter/flutter/issues/61301
Repository: go
Issue: x/tools/gopls: support LocationLink for relevant requests
Labels: help wanted,FeatureRequest,gopls,Tools

When requesting `textDocument/definition` gopls returns a [Location](https://github.com/golang/tools/blob/f8240f79c3d38bbbe93f1da8118267168124b29b/internal/lsp/definition.go#L24).

This FR is about supporting returning a LocationLink instead for clients that support it (a client capability).

Rationale: some editors/plugins can use this to support previewing the entire function on hover. See https://github.com/neovim/neovim/issues/12218 and https://github.com/neovim/neovim/pull/12368 for an in-depth description.

In terms of other language servers that do this, it looks like [rust-analyzer](https://github.com/ul/kak-lsp/issues/164) does it as well.

All (current) LSP actions that can return `LocationLink`'s:

* `textDocument/declaration`
* `textDocument/definition`
* `textDocument/typeDefinition`
Repository: PowerToys
Issue: [FancyZones] Quicky switch between layouts with the scroll wheel while dragging a window
Labels: Idea-Enhancement,FancyZones-Dragging&UI,Product-FancyZones

I sometimes like to keep my windows in a 3 columns, sometimes 2, sometimes 2 that are not equal width.

It would be awesome to be able to quickly switch between layouts. Im thinking while dragging a window and holding shift to see the zones, using the scroll wheel would cycle through the layouts created on that monitor.

Thanks!
Repository: vscode
Issue: No way for an extension to tell have vscode suggest .JSON when user saves file if it is not the main extension for json files
Labels: feature-request,languages-basic

Issue Type: <b>Bug</b>

See https://github.com/microsoft/vscode-azurearmtools/issues/809 (Save dialog for arm-template files should suggest saving with JSON extension like json files do)

1. Install https://marketplace.visualstudio.com/items?itemName=msazurermtools.azurerm-vscode-tools
2. Create a new file (don't save)
3. Change the language to "ARM Resource Manager Template"
4. CTRL+S
!) the dialog doesn't give a suggestion for extension
EXPECTED: vscode should suggest .JSON for the extension, but there appears to be no way to get that to happen.

MORE INFO:
Our package.json info looks like this for the arm-template language id:
```
        "languages": [
            {
                "id": "arm-template",
                "aliases": [
                    "Azure Resource Manager Template"
                ],
                "configuration": "dist/grammars/jsonc.arm.language-configuration.json"
            }
        ],
```
I can't put .json as our extension, because if I do, then *all* json files opened will use the arm-template language.  Rather, we manually switch to arm-template when we detect a specific schema in a json file (`https://schema.management.azure.com/schemas/2019-04-01/deploymentTemplate.json#`).  This is the mechanism that we were told to use because vscode doesn't provide a way to detect language ID based on any content past the first line (see https://github.com/microsoft/vscode/issues/69868#issuecomment-490084449).  Unfortunately, that means vscode doesn't know we're associated with json files.

VS Code version: Code - Insiders 1.48.0-insider (e7920dce7bfd0b707ebfc0a5379c6edd2233e475, 2020-07-10T11:55:11.286Z)
OS version: Darwin x64 19.5.0

<details>
<summary>System Info</summary>

|Item|Value|
|---|---|
|CPUs|Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz (12 x 2600)|
|GPU Status|2d_canvas: enabled<br>flash_3d: enabled<br>flash_stage3d: enabled<br>flash_stage3d_baseline: enabled<br>gpu_compositing: enabled<br>metal: disabled_off<br>multiple_raster_threads: enabled_on<br>oop_rasterization: disabled_off<br>opengl: enabled_on<br>protected_video_decode: unavailable_off<br>rasterization: enabled<br>skia_renderer: disabled_off_ok<br>video_decode: enabled<br>viz_display_compositor: enabled_on<br>webgl: enabled<br>webgl2: enabled|
|Load (avg)|3, 3, 3|
|Memory (System)|16.00GB (0.80GB free)|
|Process Argv||
|Screen Reader|no|
|VM|0%|
</details><details><summary>Extensions (5)</summary>

Extension|Author (truncated)|Version
---|---|---
gitlens|eam|10.2.2
todo-tree|Gru|0.0.178
vscode-dotnet-runtime|ms-|0.1.2
vscode-typescript-tslint-plugin|ms-|1.2.3
vscode-todo-highlight|way|1.0.4


</details>
<!-- generated by issue reporter -->
Repository: flutter
Issue: [Windows] Add mouse cursor "vertical arrow" IDC_UPARROW and other missing cursors
Labels: c: new feature,framework,platform-windows,a: desktop,a: mouse,P3,team-windows,triaged-windows

All system mouse cursors from Win32 have been included except for one, `IDC_UPARROW`, whose description goes "a vertical arrow".

The reason it is not included is naming. Flutter's system mouse cursors follow a naming convention based on the cursors's usage instead of appearance, which deems `verticalArrow` inappropriate. However this cursor is so rare that I'm not aware of any use cases.

If you find this cursor necessary, comment below with a use case (or better, a name) and we can discuss adding this cursor.

Related:
* https://github.com/flutter/flutter/issues/139692

------------

Edit: More missing cursors are found, see https://github.com/flutter/flutter/issues/61397#issuecomment-2455627182
Repository: TypeScript
Issue: Incorrect type allowed in returned object 
Labels: Bug

#### Version 
4.0.0-beta / 3.9.5  / 3.9.2 / Nightly

##### Code
```
type V = {
    p1?: "*" | { p11: object };
    p2?: "*" | { p22: object };
}

type T = {
    p3?: "*" | { p33: object };
    p4?: "*" | { p44: object };
}

type Pt = { [key: string]: ( V | T | "*") } | "*";

type Args = { a1: any, a2: any };
type P = (a: Args) => (Pt | Promise<Pt>);

let p: P = async (a: Args) => {

    return {
        a: "*",
        b: {
            p4: 22,

            /* Only if these two are removed then p4 will fail the check */
            p1: "*",
            p2: "*"
        }
    }
};
```

#### Expected behaviour
`p4: 22` should be caught as an incorrect type

#### Actual behavior
`p4: 22` passes the type check. If the last two properties (p1 and p2) are commented out then `p4: 22` fails the type check;

#### Playground links
[3.9.2](https://www.typescriptlang.org/play/?ssl=23&ssc=76&pln=25&pc=20#code/C4TwDgpgBAalC8UDeAoK6pgIwH4BcUARAFSFQA+ymWWBA9gEYBWEAxsFAL4DcaGYAJnxFSFKoIH1mbDjxScUKUJCgAVBMj7owAZmEkylJJh06pLdl14ZMAFn2ijd2+ZlX5i5dAAKHRMYBtAGsIEAIAZ2AAJwBLADsAcwBdAgAKWDF1SgMASi4xA14lcGgAQSiE8I1jAENaKBq4kAAaBskGpvcvKG8NVJqCcsq8+AA+KFTfMW8ougBbGPCIAB5fUZyigBsIDjACXsQa8JA41gmBqCHwkfHULSgonYBXKLjNGxsLg2b7mwYCVAfIF2AgCAQ-X7AgD0xCgAHk4psQFAYgAzKDAAAWECWGIA7nQGo8HhA5nQAG4QAAmGOxbzAtigeJim02UFRNRZtOgrGxrCCUGIUMhQOwBG+Io+gnFpElChsCh4QA)
Repository: TypeScript
Issue: Ability to replace return type of function type
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker.

Please help us by doing the following steps before logging an issue:
  * Search: https://github.com/Microsoft/TypeScript/search?type=Issues
  * Read the FAQ, especially the "Common Feature Requests" section: https://github.com/Microsoft/TypeScript/wiki/FAQ

-->

## Search Terms
* replace return type
* parameters generic

## Suggestion

I would like to be able to replace just the return type of a function with a utility type, like `WithReturn<F, R>`.

I'm not 100% sure this is needed, but it seems like using `(...args: Parameters<F>) => R` is not sufficient because any generics in `F` are lost.

## Use Cases

My use case is a utility function that captures the arguments to a function to allow it to be called later.

## Examples

```ts
export const defer = <F extends (...args: any) => any>(f: F) => ((
  ...args: Parameters<F>
) => ({
  function: f,
  args,
})) /* as any as F */;

const map = <T, R>(array: Array<T>, f: (i: T) => R) => array.map(f);
const deferredMap = defer(map);

let r = deferredMap([1], (i: number) => 2); // error now: Type 'unknown' is not assignable to type 'number'.(2345)
r.args; // error if defer returns F
```

Right now there's an error because the generics to `map()` are lost when using `Parameters`.

Playground: https://www.typescriptlang.org/play/?ssl=13&ssc=1&pln=1&pc=1#code/KYDwDg9gTgLgBAYwgOwM7wCbAGbCnAXjgB4AxOUGYZDVOACgDpmBDKAc1QC44XkBPAJSEAfLwEj62HqWEEx9egCg4cZozaceABTYsAtsCpRUZEUrkKA3irjYArsgQwAlih7YANLc2pvAX0FhAHoAKl46Pn4IuHJQ4IBuJSUkNHh9FjBCEgAVTzgAJUk2KBZ+HgBBKFL+YhyRfOkGFx4cy0L2krLGDLApQSTU9DgsXGrgDABZTOzRvHpegeSAGyM4fCI58anM+gBtAEYAXXz6Frhke30AIzx2gCYlqA0OVCSgA

## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: node
Issue: Passing a URL instance with a CONNECT method results in an invalid path
Labels: http

* **Version**: >=v10.21.0
* **Platform**: Linux solus 5.6.18-156.current #1 SMP PREEMPT Sun Jun 21 07:16:38 UTC 2020 x86_64 GNU/Linux
* **Subsystem**: http, https, url

### What steps will reproduce the bug?

```js
const http = require('http');

const server = http.createServer();

server.on('connect', (request, stream) => {
	console.log(request.url);
	stream.end('HTTP/1.1 501 Not Implemented\r\n\r\n');
});

server.listen(error => {
	if (error) {
		throw error;
	}

	const url = new URL(`http://localhost:${server.address().port}/example.com`);

	const request = http.request(url, {method: 'CONNECT'}).end();
	request.once('connect', response => {
		response.destroy();

		server.close();
	});
});
```

### How often does it reproduce? Is there a required condition?

Always.

### What is the expected behavior?

```
example.com
```

### What do you see instead?

```
/example.com
```

### Additional information

There is a workaround for this:

```diff
-const request = http.request(url, {method: 'CONNECT'}).end();
+const request = http.request({
+	hostname: url.hostname,
+	port: url.port,
+	path: 'example.com',
+	method: 'CONNECT'
+}).end();
```

/cc @yovanoc
Repository: godot
Issue: Editing labels seem to be buggy
Labels: bug,topic:editor,topic:gui

**Godot version:**
3.2.2


**OS/device including version:**
MacOS


**Issue description:**
There seem to be two issues with the **Label** node as follows (possibly related):

1) Renaming a label node does not rename the first time. Renaming a second time causes it to be renamed but add a number after it. For example if I rename "Label" to "Label5" it will stay as "Label". If I again rename it to "Label5" it will rename it to Label6".

2) If I click on a **Label** in the **Scene** section, it shows up **Inspector** section without any of the properties set. The property names are also all shown in red. However, if I select the label in the main editor by clicking on it, then it shows correctly in the **Inspector** window.

Note: I also posted a third label issue earlier today which I think is unrelated.

**Minimal reproduction project:**

Please see attached sample.
[KWGodot001-debug.zip](https://github.com/godotengine/godot/files/4916401/KWGodot001-debug.zip)