sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: electron
Issue: [Bug]: can't intercept WM_CLIPBOARDUPDATE windows messages on windows
Labels: platform/windows,bug :beetle:,status/confirmed,12-x-y,13-x-y,14-x-y,15-x-y

### Preflight Checklist

- [X] I have read the [Contributing Guidelines](https://github.com/electron/electron/blob/main/CONTRIBUTING.md) for this project.
- [X] I agree to follow the [Code of Conduct](https://github.com/electron/electron/blob/main/CODE_OF_CONDUCT.md) that this project adheres to.
- [X] I have searched the [issue tracker](https://www.github.com/electron/electron/issues) for a feature request that matches the one I want to file, without success.

### Electron Version

15.0.0, 11.4

### What operating system are you using?

Windows

### Operating System Version

Windows 10

### What arch are you using?

x64

### Last Known Working Electron version

_No response_

### Expected Behavior

I expect to be able to use the `hookWindowMessage` API to intercept the [`WM_CLIPBOARDUPDATE`](https://docs.microsoft.com/en-us/windows/win32/dataxchg/wm-clipboardupdate) Windows message.

### Actual Behavior

The handler never fires.

### Testcase Gist URL

https://gist.github.com/8ebf946a7f62d48d00a14ba3f45cc539

### Additional Information

This might be a dupe of [this](https://github.com/electron/electron/issues/7746), or maybe I'm misunderstanding what the `hookWindowMessage` API does.

main.js:
```
const {app, BrowserWindow} = require('electron')

async function createWindow() {
  const mainWindow = new BrowserWindow();
  await mainWindow.loadFile('index.html')

  mainWindow.webContents.on("did-create-window", (window, details) => {
    const handle = Array.from(window.getNativeWindowHandle());
    // await sending handle to .NET process to register the window with the clipboard thing as per the Remarks section in the docs below
    const CLIP = 0x031D; // https://docs.microsoft.com/en-us/windows/win32/dataxchg/wm-clipboardupdate
    window.hookWindowMessage(CLIP, (wp, lp) =>
    {
          console.log(wp);
     });
  });
}

app.whenReady().then(() => {
  createWindow()
  
  app.on('activate', function () {
    if (BrowserWindow.getAllWindows().length === 0) createWindow()
  })
})

app.on('window-all-closed', function () {
  if (process.platform !== 'darwin') app.quit()
})
```

index.html:
```
<button onclick="window.open('https://google.com')">Open Window</button>
```

My .NET process which receives the window handle does:
```
using System.Runtime.InteropServices;

public static void RegisterWindowWithClipboard(byte[] hwndBuffer) {
	if (!BitConverter.IsLittleEndian) {
		Array.Reverse(hwndBuffer);
	}

	IntPtr winHandle;
	if (hwndBuffer.Length == 4) winHandle = (IntPtr)BitConverter.ToUInt32(hwndBuffer, 0);
	else winHandle = (IntPtr)BitConverter.ToUInt64(hwndBuffer, 0);

	AddClipboardFormatListener(winHandle);
}

[DllImport("user32.dll", SetLastError = true)]
[return: MarshalAs(UnmanagedType.Bool)]
static extern bool AddClipboardFormatListener(IntPtr hwnd);
```
Repository: rust
Issue: Diagnostics in FFI use recommend users to cast to i/u8 instead of the appropriate c_char
Labels: A-diagnostics,T-compiler

<!--
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.

If you cannot produce a minimal reproduction case (something that would work in
isolation), please provide the steps or even link to a repository that causes
the problematic output to occur.
-->
Note: related to the lint described in https://github.com/rust-lang/rust/issues/79089

Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=e4aed9f0b25f39886e30db193cf508e2

```rust
use libc::c_char;

fn fun(c: c_char) {
    
}

fn main() {
    let x: u8 = 3;
    
    fun(x)
}
```

The current output is:

```
Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
  --> src/main.rs:10:9
   |
10 |     fun(x)
   |         ^ expected `i8`, found `u8`
   |
help: you can convert a `u8` to an `i8` and panic if the converted value doesn't fit
   |
10 |     fun(x.try_into().unwrap())
   |         ^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` due to previous error
```

<!-- The following is not always necessary. -->
Ideally the output should look like:

```
   Compiling playground v0.0.1 (/playground)
error[E0308]: mismatched types
  --> src/main.rs:10:9
   |
10 |     fun(x)
   |         ^ expected `i8`, found `u8`
   |
help: you can convert a `u8` to an `c_char` and panic if the converted value doesn't fit
   |
10 |     fun(x.try_into().unwrap())
   |         ^^^^^^^^^^^^^^^^^^^^^

For more information about this error, try `rustc --explain E0308`.
error: could not compile `playground` due to previous error
```

`c_char` is different on platforms, it may be `u8` or `i8`. The correct cast here in FFI use is towards a `c_char`, keeping casts correct in all situations. There's also an argument to be made that i8 -> c_char should be using an `as` cast.
Repository: angular
Issue: Disabled attribute in an input element is failing build compilation
Labels: type: bug/fix,area: compiler,P4,compiler: template type-checking

### Which @angular/* package(s) are the source of the bug?

Don't known / other

### Is this a regression?

Yes

### Description

Related: https://github.com/angular/components/issues/17495

Updated an app from angular 10 to angular 12.2 to find the lovely disabled attribute is causing my build to fail.

Example:
html

    <form [formGroup]="myForm">
      <input type="text" disabled formControlName="mo">
    </form>

component class

    export class AppComponent {
      constructor(private fb: FormBuilder) {

      }
      myForm: FormGroup = this.fb.group({
        mo: new FormControl('')
      });
    }

Now I could specify `[disabled]="true"` and it would compile then, but I really shouldn't have to given `disabled` by itself is valid.

### Please provide a link to a minimal reproduction of the bug

_No response_

### Please provide the exception or error you saw

```true
Error: src/app/app.component.html:2:61 - error TS2322: Type 'string' is not assignable to type 'boolean'.

   <input type="text" disabled formControlName="mo">
```


### Please provide the environment you discovered this bug in

```true
"@angular/animations": "~12.2.0",
    "@angular/cdk": "^12.2.7",
    "@angular/common": "~12.2.0",
    "@angular/compiler": "~12.2.0",
    "@angular/core": "~12.2.0",
    "@angular/forms": "~12.2.0",
    "@angular/platform-browser": "~12.2.0",
    "@angular/platform-browser-dynamic": "~12.2.0",
    "@angular/router": "~12.2.0",
"rxjs": "~6.6.0",
```


### Anything else?

Adding tsconfig.json file for extra clarity
/* To learn more about this file see: https://angular.io/config/tsconfig. */
{
  "compileOnSave": false,
  "compilerOptions": {
    "baseUrl": "./",
    "outDir": "./dist/out-tsc",
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noFallthroughCasesInSwitch": true,
    "sourceMap": true,
    "declaration": false,
    "downlevelIteration": true,
    "experimentalDecorators": true,
    "moduleResolution": "node",
    "importHelpers": true,
    "target": "es2017",
    "module": "es2020",
    "lib": [
      "es2018",
      "dom"
    ]
  },
  "angularCompilerOptions": {
    "enableI18nLegacyMessageIdFormat": false,
    "strictInjectionParameters": true,
    "strictInputAccessModifiers": true,
    "strictTemplates": true
  }
}
Repository: flutter
Issue: [Documentation] Add multipage sample app with tests 
Labels: a: tests,framework,d: api docs,d: examples,c: proposal,f: integration_test,P3,team-framework,triaged-framework

The counter app is used for documentation for example integration test and other tests but then there is no example to test clicking a button and say landing on another page or going back.  Thus, the entirety of Flutter documentation should be updated to include examples using the new multipage sample app from Flutter 2.5.  Also debugging tests like explained here: https://medium.com/flutter-community/hot-reload-for-flutter-integration-tests-e0478b63bd54 should work out-of-the-box.  That author is saying 10x more productivity so that is a lot of bang for your buck and I can see that after now having issues with testing and having to wait around so long for them to run.  
This should be doable with a week or two and would cut down on the amount of Googling for answers by so many novices and other developers who need a multipage example app used rather than a counter especially for testing. Toy examples work for somethings say showing changes in font but for testing?  No.  Most of the core features like navigating and checking for components or text to indicate a new page was navigated to should have examples.
Repository: flutter
Issue: [desktop] Easy way to prevent running multiple instances of the flutter application
Labels: c: new feature,tool,engine,a: quality,c: proposal,a: desktop,P3,team-tool,triaged-tool

Ideally, there should be a way to prevent multiple instances of an application from running, perhaps an API that abstracts Mutex from the underlying operating system.

I'm developing a desktop app that depends on this feature.
Repository: pytorch
Issue: Deprecate torch.cross with optional dim
Labels: triaged,module: deprecation

## 🚀 Feature

Deprecate torch.cross with optional dimension (or make the dimension default to -1 instead of None)

## Motivation

The behavior can be unexpected. torch.cross selects the first dimension of the input tensors that have size 3 and does a cross product along those dimensions. This is weird.

## Alternatives

Don't deprecate it.
Repository: pytorch
Issue: [POC] Convolution-relu fusion via torch function and one-step lazy evaluation
Labels: triaged,module: __torch_function__,module: lazy

This code sample shows how to use torch function to do automatic eager mode convolution-relu fusion with "one step" of lazy evaluation. It needs a lot of improving and there are some internal APIs we can make better, but this is a use case for torch function/dispatch that we ought to be paying attention to.

```python
import torch

# TODO: tree_map is pretty slow, once you figure out what API you want
# there is easy optimizations available
from torch.utils._pytree import tree_map

# TODO: Obviously you will want to generalize this to work for arbitrary
# operators
class DelayedConv2d:
    def __init__(self, args, kwargs):
        self.args = args
        self.kwargs = kwargs
        self.val = None

    def force(self):
        if self.val is None:
            self.val = torch.conv2d(*self.args, **self.kwargs)
            self.args = None
            self.kwargs = None
        return self.val

    # NB: Using __torch_function__ here means that if you want to identify
    # quantization fusions in backwards, this is not possible.  I don't
    # think you need it.
    @classmethod
    def __torch_function__(cls, func, types, args=(), kwargs=None):
        if kwargs is None:
            kwargs = {}
        if func is torch.relu:
            self, = args
            assert isinstance(self, DelayedConv2d)
            if self.val is not None:
                return torch.relu(self.val)
            else:
                print("fusion is possible here!")
                return torch.relu(self.force())

        # no fusion possible, just force everything
        def unwrap(t):
            if isinstance(t, DelayedConv2d):
                return t.force()
            else:
                return t

        return func(*tree_map(unwrap, args), **tree_map(unwrap, kwargs))

# TODO: Tracer should probably be a mode; this would avoid having to deal with
# wrapping/unwrapping tracers as happens here.  Other possibilities are for this
# to be a tensor subclass (which means that methods like tracer.relu() would work)
class Tracer:
    def __init__(self, val):
        self.val = val

    @classmethod
    def __torch_function__(cls, func, types, args=(), kwargs=None):
        if kwargs is None:
            kwargs = {}

        def wrap(t):
            return Tracer(t)

        def unwrap(t):
            if isinstance(t, Tracer):
                return t.val
            else:
                return t

        if func is torch.conv2d:
            return DelayedConv2d(tree_map(unwrap, args), tree_map(unwrap, kwargs))
        else:
            r = func(*tree_map(unwrap, args), **tree_map(unwrap, kwargs))
            return tree_map(wrap, r)

filters = torch.randn(8, 4, 3, 3)
inputs = Tracer(torch.randn(1, 4, 5, 5))

result = torch.nn.functional.conv2d(inputs, filters, padding=1)
print(torch.relu(result).size())
```


cc @hameerabbasi @rgommers @peterbell10
Repository: vscode
Issue: `acceptSuggestionOnCommitCharacter` with ghost text
Labels: feature-request,suggest,inline-completions

Testing #133907

So I just realized that `acceptSuggestionOnCommitCharacter` is on by default, this means that when you hit `;` at this point:
![image](https://user-images.githubusercontent.com/2644648/135140919-06205a60-6db9-468c-add7-fc1319f7930c.png)
it will accept the _completion_ (not the inline completion):
![image](https://user-images.githubusercontent.com/2644648/135141355-fb814463-6462-4680-ab19-78ba9d437860.png)

I wanted to call this out because I think it's worth discussing... do you think that `;` would accept only the completion or the whole suggestion?

In my eyes, a `;` is saying "I wanna commit to this whole statement" and so I might expect that the inline completion would also be accepted. This might be a nice way for a user to accept the completion and the inline completion in one keystroke (if such a thing doesn't exist already).

What do you think @hediet?
Repository: material-ui
Issue: Can't new create inputs variants
Labels: new feature,component: text field

<!-- Provide a general summary of the issue in the Title above -->
I am trying to create a new varian for inputs like I did for buttons 
![image](https://user-images.githubusercontent.com/34176666/135141727-4b6e9d12-8070-49b8-a37e-7ca158d8431d.png)

When i try to replicate this with `MuiIpunt` or `MuiInputBase` the typescript compilert complains like this feature isn't available 

![image](https://user-images.githubusercontent.com/34176666/135141778-32e322c2-4960-4ecd-9156-a6668acb44e6.png)
![image](https://user-images.githubusercontent.com/34176666/135141426-a069ebd7-deb3-4278-8c8e-0fe4c1b4afdc.png)

<!--
  Thank you very much for contributing to MUI by creating an issue! ❤️
  To avoid duplicate issues we ask you to check off the following list.
-->

<!-- Checked checkbox should look like this: [x] -->
I'm working with the last Mui 5 release
- [x] The issue is present in the latest release.
- [ ] I have searched the [issues](https://github.com/mui-org/material-ui/issues) of this repository and believe that this is not a duplicate.

## Current Behavior 😯

<!-- Describe what happens instead of the expected behavior. -->

## Expected Behavior 🤔

<!-- Describe what should happen. -->

## Steps to Reproduce 🕹

<!--
  Provide a link to a live example (you can use codesandbox.io) and an unambiguous set of steps to reproduce this bug.
  Include code to reproduce, if relevant (which it most likely is).

  You should use the official codesandbox template as a starting point: https://mui.com/r/issue-template-next

  If you have an issue concerning TypeScript please start from this TypeScript playground: https://mui.com/r/ts-issue-template

  Issues without some form of live example have a longer response time.
-->

Steps:

1.
2.
3.
4.

## Context 🔦

<!--
  What are you trying to accomplish? How has this issue affected you?
  Providing context helps us come up with a solution that is most useful in the real world.
-->

## Your Environment 🌎

<!--
  Run `npx @mui/envinfo` and post the results.
  If you encounter issues with TypeScript please include the used tsconfig.
-->
<details>
  <summary>`npx @mui/envinfo`</summary>
  
```
  Don't forget to mention which browser you used.
  Output from `npx @mui/envinfo` goes here.
```
</details>
Repository: pytorch
Issue: torch.utils._pytree -> stable
Labels: high priority,feature,triaged,better-engineering,needs design,module: pytree

## 🚀 Feature

PyTorch should use a performant and stable version of _pytree.

## Motivation

`torch.utils._pytree` (heavily inspired by JAX pytrees) is something I cooked up in a non-performant way when prototyping the initial non-composable version of torch.vmap. Since then, it's found many legitimate use cases in PyTorch internals:
- functorch [transforms](https://github.com/facebookresearch/functorch/blob/6c026e965c50ab25a3a63f2625691c9a4a4a18ff/functorch/_src/eager_transforms.py#L13); [eager compilation](https://github.com/facebookresearch/functorch/blob/6c026e965c50ab25a3a63f2625691c9a4a4a18ff/functorch/_src/eager_compilation.py#L85)
- [fx](https://github.com/pytorch/pytorch/blob/master/torch/fx/_pytree.py)
- [writing torch_dispatch objects](https://github.com/pytorch/pytorch/blob/4752453d27c275df5f8efdea651ed9f08e366c7a/test/test_python_dispatch.py#L62)

The last use case means we want to expose torch.utils._pytree to users! (or provide a stable mechanism that users can use).

There is only really one main blocker to exposing torch.utils._pytree: performance.
- [tree_map is slow](https://github.com/pytorch/pytorch/issues/65753), it can probably be faster.
- Some of the eager compilation work is showing that torch.utils._pytree is slow, especially in the case where the input is a flat list.

## Pitch

torch.utils._pytree is heavily inspired by JAX's pytrees. JAX's pytrees are implemented in C++ (with bindings to Python) for performance reasons. We should either:
- delete our pytree and take a dependency on JAX (or figure out if they'd be interested in splitting off pytree into its own library)
- run our own implementation of pytree and improve its performance.

cc @ezyang @gchanan @kadeng @msaroufim @XuehaiPan @zou3519 @albanD @Chillee
Repository: material-ui
Issue: [TableRow] Implement `disabled` state
Labels: new feature,component: table

Can we disable a row in the table by a `prop`, something like this:

![Screen Shot 2021-09-28 at 22 48 10](https://user-images.githubusercontent.com/1549069/135151739-24d8ccf4-0bde-48fb-a36e-6f36e6ab4c75.png)

Row number 4 is disabled
Repository: nvm
Issue: Ubuntu 21.04 install script does not hook into .zshrc but into .bashrc
Labels: installing nvm: profile detection

While installing nvm by install script in zsh, the download is successful, however the hook into zshrc does not take place. 
However it hooks into .bashrc 

#### Operating system and version:
Ubuntu 21.04

#### How did you install `nvm`?
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.38.0/install.sh | bash

#### What happened?
Download of nvm into folder .nvm successful, however hooking into zshrc not happening

#### What did you expect to happen?
the .zshrc should be updated with this or something similar:
`export NVM_DIR="$HOME/.nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm`

#### Is there anything in any of your profile files that modifies the `PATH`?
Yes multiple additions to the PATH var like
`export PATH="[...]:$PATH"`
Repository: terminal
Issue: [1.12] Split pane on parent loses opacity? 
Labels: Help Wanted,Issue-Bug,Area-UserInterface,Product-Terminal,Priority-2

_discovered in the 1.12 bug bash on 9/28, but probably not blocking_


Split pane on parent loses opacity? (bad merge?) 
Repro steps: 
1. Have multiple panes open 
1. MoveFocus to parent pane 
1. SplitPane 
Behavior: new pane has transparency, but old panes lost it
Repository: pytorch
Issue: Non-persistent modules
Labels: module: nn,low priority,module: serialization,triaged,enhancement

## 🚀 Feature

Add non-persistent modules, similar to non-persistent buffers

## Motivation

When saving torch models with large submodules, such as word embeddings in an NLP model, it would be useful to add the embedding to the model without it being saved when saving the results of state_dict()

## Pitch

Similar to how there is a `persistent` bool as part of `register_buffer`, I would like to be able to mark a module as persistent or not.

```
def register_buffer(self, name: str, tensor: Optional[Tensor], persistent: bool = True)
```

```
def add_module(self, name: str, module: Optional['Module'], persistent: bool = True) 
```

The added modules which aren't persistent will be skipped during `state_dict` calls, but will otherwise be treated the same as other modules.

## Alternatives

Making a subclass of my own of `nn.Module` which handled this is possible, but it seems brittle to override `state_dict` 

Including the modules in a `[]` list rather than a `ModuleList` avoids having them saved, but also means calls such as `cuda` don't work because `apply` doesn't find them.

Removing the keys manually after calling `state_dict()` is what we're doing now, but makes it a lot harder to reuse a module as a submodule of another object.

## Additional information

Here is an example of how we are currently handling this:

https://github.com/stanfordnlp/stanza/blob/c457a9309ad15c522e94230f919c25d1e7aebf64/stanza/models/ner/model.py#L19
https://github.com/stanfordnlp/stanza/blob/c457a9309ad15c522e94230f919c25d1e7aebf64/stanza/models/ner/trainer.py#L118



cc @albanD @mruberry @jbschlosser @walterddr
Repository: pytorch
Issue: Autocast sometimes discards changes to mutable arguments
Labels: triaged,module: amp (automated mixed precision),module: intel

## 🐛 Bug: Autocast sometimes discards changes to mutable arguments

Currently, changes to mutable arguments are lost in certain cases where casting occurs. In [autocast_mode.cpp](https://github.com/pytorch/pytorch/blob/master/aten/src/ATen/autocast_mode.cpp#L111), when casting occurs a copy of the tensor is made before passing into a kernel. If the tensor is modified, the original tensor does not change.

## To Reproduce

```
import torch

tensor1 = torch.rand(5, 5, dtype=torch.half)
mean_orig = torch.rand(5, dtype=torch.half)
var_orig = torch.rand(5, dtype=torch.half)
mean_half = mean_orig.clone().detach()
var_half  = var_orig.clone().detach()
tensor1_float = tensor1.float()
mean_float  = mean_orig.float()
var_float  = var_orig.float()

with torch.cpu.amp.autocast():
    torch.nn.functional.batch_norm(tensor1, mean_half, var_half, training=True)
    torch.nn.functional.batch_norm(tensor1_float, mean_float, var_float, training=True)

print(mean_orig - mean_half)
print(mean_orig - mean_float)
```
Output:
```
tensor([0., 0., 0., 0., 0.], dtype=torch.float16)
tensor([ 0.0377,  0.0272, -0.0152, -0.0325, -0.0591])
```

`batch_norm` is expected to modify running_mean and running_var when `training=True`. When `dtype=float`, no copy is created so changes to mean and var are retained (second line of output - see that the mean has changed compared to its original value). But when `dtype=half`, casting occurs and changes to mean and var are lost (first line of output).

cc @mcarilli @ptrblck @eellison
Repository: create-react-app
Issue: changes in index.html file are not reflected
Labels: stale,needs triage

I've created a react app using create-react-app

"react": "^17.0.2",
"react-dom": "^17.0.2",
"react-scripts": "4.0.3",

When I try to add script tags in index.html in the public folder, it's not getting reflected when I start the dev server.

The index.html file is being overwritten by the originally given HTML(checked in devtools), unable to even change the title in HTML, it's reverting back to "React App"

Do we need to make any config changes or something so that the changes in index.html will be persisted?