sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Infer const-ness of local let bindings that aren't assigned to
Labels: Suggestion,Awaiting More Feedback

## Search Terms

let const infer assignment

## Suggestion

In some cases, type narrowing for `const` bindings is more effective than for `let` bindings. Specifically, using such bindings from a function that closes over them will keep the narrowed type, which doesn't happen for `let` binding, presumably on the assumption that those might be mutated at any time.

This suggests to treat local `let` bindings that are never assigned to (which can be determined by a rather straightforward static check on the syntax tree) like `const` bindings for this purpose.

(Interestingly, something like this seems to already exist for function parameters.)

## Use Cases

Though some people have adopted a coding style where locals are declared with `const` unless assigned to, there's also a good argument to be made that that is not a very good use of brain cycles and just using `let` for all locals is fine. This proposal would improve type inference for people using the `let` style.

## Examples

```
function foo() {
  let v: number[] | null = Math.random() < 0.5 ? [1] : null
  if (Array.isArray(v)) setTimeout(() => console.log(v.length), 100)
}
```

The compiler complains that `v` is possibly null. If the binding is changed to `const` the problem goes away. If `v` is made a function parameter it also doesn't occur. (But comes back when a `v = null` statement is added, suggesting a check like the one suggested here is being done in that case.)

## 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: PowerToys
Issue: [Run] Open with a touchpad / touchscreen gesture
Labels: Idea-Enhancement,Product-PowerToys Run

would be nice if I could launch using the Touchpad settings for Taps with Three-finger gestures.
Repository: godot
Issue: Child 2D gizmo does not update with animation
Labels: bug,topic:editor,confirmed,usability,topic:2d

<!-- Please search existing issues for potential duplicates before filing yours:	
https://github.com/godotengine/godot/issues?q=is%3Aissue	
-->

**Godot version:**
<!-- Specify commit hash if using non-official build. -->
3.2.2 rc2

**Issue description:**
<!-- What happened, and what was expected. -->
![Ln86SiFGtr](https://user-images.githubusercontent.com/2223172/85716789-18ee5b80-b6ed-11ea-8d64-3ffe9a67f392.gif)
Notice the Node2D gizmo staying in place until you move cursor over viewport (which focuses the viewport and updates the gizmo only once).

**Minimal reproduction project:**
<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
[ReproductionProject.zip](https://github.com/godotengine/godot/files/4831075/ReproductionProject.zip)
Repository: godot
Issue: Focus (f, 3D) doesn't reset/recalibrate zoom range
Labels: enhancement,discussion,topic:editor,topic:3d

**Godot version:**
3.2.2.rc4.mono.official

**Issue description:**
When zooming in, currently there's a limit that gets hit quite easily. In other engines this range is much greater, but if one hits the limit there refocusing on an object usually resets the range. But in godot it does not, the range stays at the limit if it was there before focussing.
This just makes it a worse freelook-move-forward.

**Steps to reproduce:**
Zoom in completely (mousewheel), focus an object (f-key), notice it's not possible to zoom in further nor pan around.
Repository: flutter
Issue: [Flutter Web] How to prefix project path with URL "fweb/assets/fontmanifest.json  . Inside main.dart.js - nodejs server 
Labels: framework,d: api docs,platform-web,a: release,P3,team-web,triaged-web

Hi.
I am facing a problem when I try to integrate the flutter generated build file to a nodejs server. The icon does not show. The error console is present in the image itself.
![error_log_4](https://user-images.githubusercontent.com/56631153/85728523-4ab8ef80-b6f8-11ea-9de4-ed64a55d86fe.png)
The above image is when I start my server,
![error_log_5](https://user-images.githubusercontent.com/56631153/85728527-4bea1c80-b6f8-11ea-9624-d38661009a02.png)
The above image is when I refresh my browser. But the increment function seems to be working.
I am running the server on chrome and on Microsoft Edge (the new one with the chromium engine). In both, I encounter the same problem. 
Any help is appreciated.
Repository: PowerToys
Issue: [Image Resizer] Option to set the DPI for each size format
Labels: Idea-Enhancement,Product-Image Resizer

I have 600 DPI images that need to be resized to specific px but also have the DPI change to 300 DPI as well. My request is adding some sort of advance options to set the DPI for each Image Size item.
Repository: TypeScript
Issue: Split the "lib.dom.d.ts" definition file apart
Labels: Suggestion,Needs Proposal

<!-- 🚨 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

<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

lib.dom.d.ts, split, modular

## Suggestion

<!-- A summary of what you'd like to see added or changed -->

I'm currently writing a TypeScript definition file for the API of a game, which will be submitted to [DefinitelyTyped](https://github.com/DefinitelyTyped/DefinitelyTyped) soon.

The API of the game exposes a `Notification` class to the global scope, which collides with the one in "lib.dom.d.ts" definition file. Not only that, but it also uses jQuery and `XMLHttpRequest`, forcing me to include that definition file.

## Use Cases

<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->

By splitting the "lib.dom.d.ts" definition file apart, user can select only the APIs they need.

This change should not break the backward compatibility of old projects, although old versions of TypeScript will not support projects using the modular definition file.

## Examples

<!-- Show how this would be used and what the behavior would be -->

For example, the "lib.dom.d.ts" definition file could be split up like this:

```
lib.dom.d.ts
|-- lib.dom.elements.d.ts
|-- lib.dom.notification.d.ts
|-- lib.dom.xhr.d.ts
`-- ... (other modules)
```

When some parts of the user's definition file collide with the "lib.dom.d.ts" definition file, the user can use the following instead:

```jsonc
{
    "compilerOptions": {
        "lib": [
            "DOM.Elements",
            "DOM.XHR",
            ... // (other modules except for "DOM.Notification")
        ]
        ...
    }
    ...
}
```

## 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: rust
Issue: Simple code won't compile. Both stable and nightly.
Labels: T-compiler,I-compilemem,C-bug

<!--
Thank you for finding an Internal Compiler Error! 🧊  If possible, try to provide
a minimal verifiable example. You can read "Rust Bug Minimization Patterns" for
how to create smaller examples.

http://blog.pnkfx.org/blog/2019/11/18/rust-bug-minimization-patterns/

-->

### Code

Please see the file [lib.zip](https://github.com/rust-lang/rust/files/4832388/lib.zip)

rustc consumes all the memory while compiling this code. 188Gb of RAM was consumed on server.

### 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.
-->

`rustc --version --verbose`:
```
rustc

 1.44.1 (c7087fe00 2020-06-17)
rustc 1.46.0-nightly (67100f61e 2020-06-24)
```

### Error output

```
process didn't exit successfully: `rustc --crate-name directory_trees --edition=2018 directory-trees/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=e813bd9f91882755 -C extra-filename=-e813bd9f91882755 --out-dir /home/user/RustProjects/directory-bot/target/release/deps -L dependency=/home/user/RustProjects/directory-bot/target/release/deps --extern unchecked_index=/home/user/RustProjects/directory-bot/target/release/deps/libunchecked_index-d1f689d7ce9ce478.rmeta -C target-cpu=native` (signal: 9, SIGKILL: kill)
```

<!--
Include a backtrace in the code block by setting `RUST_BACKTRACE=1` in your
environment. E.g. `RUST_BACKTRACE=1 cargo build`.
-->
<details><summary><strong>Backtrace</strong></summary>
<p>

No backtrace appeared.

```
process didn't exit successfully: `rustc --crate-name directory_trees --edition=2018 directory-trees/src/lib.rs --error-format=json --json=diagnostic-rendered-ansi --crate-type lib --emit=dep-info,metadata,link -C opt-level=3 -C metadata=e813bd9f91882755 -C extra-filename=-e813bd9f91882755 --out-dir /home/user/RustProjects/directory-bot/target/release/deps -L dependency=/home/user/RustProjects/directory-bot/target/release/deps --extern unchecked_index=/home/user/RustProjects/directory-bot/target/release/deps/libunchecked_index-d1f689d7ce9ce478.rmeta -C target-cpu=native` (signal: 9, SIGKILL: kill)
```

</p>
</details>
Repository: pytorch
Issue: Compiling PyTorch with 11.0, V11.0.167
Labels: module: build,triaged

## 🐛 Bug

My CUDA driver is 11.0 but it seems cudatoolkit only goes up to version 10.2.  This causes there to be a mismatch when I try to install apex.

Here is the stack trace from installing apex with the command

`pip install -v --no-cache-dir --global-option="--cpp_ext" --global-option="--cuda_ext" ./`


    torch.__version__  = 1.5.1


    /tmp/pip-req-build-qbjtmvks/setup.py:51: UserWarning: Option --pyprof not specified. Not installing PyProf dependencies!
      warnings.warn("Option --pyprof not specified. Not installing PyProf dependencies!")

    Compiling cuda extensions with
    nvcc: NVIDIA (R) Cuda compiler driver
    Copyright (c) 2005-2020 NVIDIA Corporation
    Built on Wed_May__6_19:09:25_PDT_2020
    Cuda compilation tools, release 11.0, V11.0.167
    Build cuda_11.0_bu.TC445_37.28358933_0
    from /usr/local/cuda/bin

    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-req-build-qbjtmvks/setup.py", line 130, in <module>
        check_cuda_torch_binary_vs_bare_metal(torch.utils.cpp_extension.CUDA_HOME)
      File "/tmp/pip-req-build-qbjtmvks/setup.py", line 85, in check_cuda_torch_binary_vs_bare_metal
        "https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  "
    RuntimeError: Cuda extensions are being compiled with a version of Cuda that does not match the version used to compile Pytorch binaries.  Pytorch binaries were compiled with Cuda 10.2.
    In some cases, a minor-version mismatch will not cause later errors:  https://github.com/NVIDIA/apex/pull/323#discussion_r287021798.  You can try commenting out this check (at your own risk).
    Running setup.py install for apex ... error

Should I just comment out the error or is there a better workaround? 

cc @malfet
Repository: pytorch
Issue: Stop registering kernels that use DispatchStub as catch all
Labels: module: internals,triaged

A kernel should only be registered as catch-all if it would work for ANY backend.  Kernels that use DispatchStub do NOT fall in this 
category: DispatchStub is specialized to only work for CPU and CUDA. If you incorrectly register a kernel that uses DispatchStub as catchall, it will seemingly work for PyTorch, but if a custom backend implementor tries to call the function, it will incorrectly report that the kernel exists, but DispatchStub doesn't work. Trying to make DispatchStub work for a new backend is a fools game: you should just register your kernel directly.

Here are all the files that need to be audited. Do an audit by looking for all functions in the corresponding cpp file that invoke the dispatch stub, and then verify in `native_functions.yaml` that they are registered as `CPU, CUDA: ...` (and not catch all), introducing the dispatch if it is in that case. Activation.h has an example.

- [ ] aten/src/ATen/native/Activation.h #40565
- [ ] aten/src/ATen/native/BinaryOps.h
- [ ] aten/src/ATen/native/Copy.h
- [ ] aten/src/ATen/native/Cross.h
- [ ] aten/src/ATen/native/DispatchStub.h
- [ ] aten/src/ATen/native/Distance.h
- [ ] aten/src/ATen/native/Fill.h
- [ ] aten/src/ATen/native/Lerp.h
- [ ] aten/src/ATen/native/PointwiseOps.h
- [ ] aten/src/ATen/native/Pow.h
- [ ] aten/src/ATen/native/RNN.h
- [ ] aten/src/ATen/native/RangeFactories.cpp
- [ ] aten/src/ATen/native/ReduceAllOps.h
- [ ] aten/src/ATen/native/ReduceOps.h
- [ ] aten/src/ATen/native/Sorting.h
- [ ] aten/src/ATen/native/TensorAdvancedIndexing.h
- [ ] aten/src/ATen/native/TensorCompare.h
- [ ] aten/src/ATen/native/UnaryOps.h
- [ ] aten/src/ATen/native/Unfold2d.h
- [ ] aten/src/ATen/native/UnfoldBackward.h
- [ ] aten/src/ATen/native/UpSample.h
- [ ] aten/src/ATen/native/batch_norm.h
- [ ] aten/src/ATen/native/cpu/CatKernel.h
- [ ] aten/src/ATen/native/cpu/DepthwiseConvKernel.h
- [ ] aten/src/ATen/native/cpu/GridSamplerKernel.h
- [ ] aten/src/ATen/native/cpu/README.md
- [ ] aten/src/ATen/native/cpu/SoftmaxKernel.h
- [ ] aten/src/ATen/native/cuda/TensorCompare.cu
- [ ] aten/src/ATen/native/group_norm.h
- [ ] aten/src/ATen/native/layer_norm.h
- [ ] aten/src/ATen/native/quantized/affine_quantizer.h
- [ ] aten/src/ATen/native/quantized/cpu/kernels/README.md
- [ ] aten/src/ATen/native/quantized/cpu/quantized_ops.h
- [ ] aten/src/ATen/native/quantized/fake_quant_affine.h


cc @ezyang @bhosmer @smessmer @ljk53
Repository: pytorch
Issue: If all parameters are unused by forward pass in a process, backward will not work with DDP.
Labels: oncall: distributed,triaged

We realized that if the `forward` pass produces empty `list(_find_tensors(output))` - referring the code below - in some processes with `find_unused_parameters = True`, the backward() will not work for DDP.

https://github.com/pytorch/pytorch/blob/e490352dc4ad4f61c795bfdae968954c7d916861/torch/nn/parallel/distributed.py#L521-L522

With today's reducer it's impossible to make all parameters unused, as we would require at least one `autograd_hook` invocation to process unused parameters. The loss function may take an empty list and then produce some irrelevant tensor. In that case applications can still call backward, but they cannot run it with today's DDP.

cc: @mrshenli @pritamdamania87 @zhaojuanmao 
This issue was realized in pull request: #40407 

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera @rohan-varma @gqchen @aazzolini @xush6528 @osalpekar @jiayisuse
Repository: pytorch
Issue: Converting NumPy dtype to Torch dtype when using `as_tensor`
Labels: triaged,module: numpy

## 🚀 Feature
Let the `dtype` keyword argument of [`torch.as_tensor`](https://pytorch.org/docs/master/generated/torch.as_tensor.html#torch.as_tensor) be either a `np.dtype` or `torch.dtype`. 

## Motivation

Suppose I have two numpy arrays with different types and I want to convert one of them to a torch tensor with the type of the other array. 

According to https://discuss.pytorch.org/t/converting-a-numpy-dtype-to-torch-dtype/52279/2, there's no convenient way to convert a numpy tensor to a torch tensor. 

## Pitch

```python
import numpy as np
import torch


# currently raises the following:
# TypeError: as_tensor(): argument 'dtype' must be 
# torch.dtype, not numpy.dtype
mytensor = torch.tensor(48., dtype=np.float32)
```

## Alternatives

- make [this API](https://github.com/pytorch/pytorch/blob/29881c7f02ed7cb263a602f73a84089a79571c8e/torch/csrc/utils/tensor_numpy.cpp#L196-L220) public
- let the `dtype` keyword argument of [`torch.Tensor.to`](https://pytorch.org/docs/stable/tensors.html#torch.Tensor.to) be either a `np.dtype` or `torch.dtype`

## Additional context

Similar issue: #541


cc @mruberry
Repository: flutter
Issue: Pull-Down Menus for iOS 14
Labels: c: new feature,framework,a: fidelity,f: cupertino,customer: crowd,P1,team-design,triaged-design

On iOS 14, Pull-Down Menus have been added.

> Menus offer several advantages over action sheets, context menus, and popovers. For example:
>
> A menu opens very near the button that reveals it, so people can instantly understand the relationship between the menu's items and the action they're performing.
>
> In addition to listing actions, a menu can offer selections people can use to affect the primary action.
>
> Menus animate quickly into view and don't dim the screen when they appear, giving both the transition and the overall experience a lightweight feel.

![](https://developer.apple.com/design/human-interface-guidelines/ios/images/menu-clarification_2x.png)
![](https://developer.apple.com/design/human-interface-guidelines/ios/images/menu-secondary-actions_2x.png)

https://developer.apple.com/design/human-interface-guidelines/ios/controls/pull-down-menus/
Repository: pytorch
Issue: Libtorch C++ multiple GPU performance slower than single GPU
Labels: module: performance,module: cpp,triaged,module: data parallel

## 🐛 Bug

Using the data_parallel C++ interface results in code that is much slower on multiple GPUs than on a single GPU.  In addition, the GPU utilization is less than 10% with muliple GPUs compared to over 96% with a single GPU.

## To Reproduce

Steps to reproduce the behavior:

 Implement a non-trivial model (e.g. ResNet50 or SlowFast) using the libtorch c++ interface (I used libtorch-win-shared-with-deps-1.5.0.zip + cuda 10.1)

Add mulitiple GPU support via torch::nn::parallel::data_parallel

Time training runs with a single GPU and with multiple GPUs 

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

## Expected behavior

Runs with multiple GPUs should be faster than runs on a single GPU.  Definitely not *much* slower.

## Environment


 - PyTorch Version (e.g., 1.0): LibTorch 1.5.0 pre-built library
 - OS (e.g., Linux): Windows 7
 - How you installed PyTorch (`conda`, `pip`, source): N/A
 - Build command you used (if compiling from source): 
 - Python version: N/A
 - CUDA/cuDNN version: 10.1
 - GPU models and configuration: 2x GTX 1080
 - Any other relevant information:

## Additional context

This is in line with what @dmagee reported in #18837. Looking though the code, it appears as if replicas of the modules are cloned and deleted on every iteration of training. Is there a way to use data_parallel and avoid this overhead?

cc @VitalyFedyunin @ngimel @yf225 @glaringlee @albanD @mruberry
Repository: flutter
Issue: DraggableScrollableSheet with reverse CustomScrollView inside cause "reversed" behaviour for modal bottom sheet
Labels: c: new feature,framework,f: scrolling,c: proposal,P3,team-framework,triaged-framework

Simplified code:
```
showModalBottomSheet(
    context: context,
    isScrollControlled: true,
    isDismissible: true,
    backgroundColor: Colors.transparent,
    builder: (context) => DraggableScrollableSheet(
        expand: false,
        initialChildSize: 1,
        minChildSize: 0.6,
        maxChildSize: 1,
        builder: (context, scrollController) => CustomScrollView(
                              reverse: true,
                              controller: scrollController,
                                slivers: <Widget>[...])));
```

And now when scroll up - bottom sheet going to close state, and when down - sheet going to expanded state. Without reverse list inside all works as expected.

Use case - chat in bottom sheet like on Facebook comments under the post.

Flutter (Channel stable, v1.17.4, on Linux, locale en_US.UTF-8)
Repository: flutter
Issue: bench_mouse_region_grid_hover too sensitive to Zone changes
Labels: framework,platform-web,a: mouse,team: benchmark,P3,team-web,triaged-web

There was a change to the benchmark harness (https://github.com/flutter/flutter/pull/57576), which caused the numbers in bench_mouse_region_grid_hover to move up:

<img width="269" alt="Screen Shot 2020-06-25 at 1 11 18 PM" src="https://user-images.githubusercontent.com/211513/85790755-9e6e0d80-b6e5-11ea-9f78-bd3f30368b22.png">

After some examination by @pennzht it looks like this benchmark is sensitive to zone change. For example, benchmarks were moved into a shared parent zone that captures stdout output. On @pennzht's computer this affected the numbers by 2x (on my computer it didn't change anything though).

My suspicion is the use of `TestGesture` which uses some zone tricks behind the scenes. According to my profiling those tricks take quite a bit of time per frame (0.16ms in my testing). We might want to consider changing the benchmark to not use any zone tricks.

/cc @dkwingsmt @pennzht
Repository: vscode
Issue: Allow us to change the font type and size of find-replace widget
Labels: feature-request,editor-find

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
Hi, and please! It's unreadable for my limited eyes:
![image](https://user-images.githubusercontent.com/51187764/85794127-7940c580-b70c-11ea-9ade-6a1f91a41625.png)

I know we are now able to resize the widget horizontally (like pointed out at issues #2657, #20447 and #2220), but that doesn't change the legibility of the inserted characters.

Look how easier it is on Sublime Text to read:
![image](https://user-images.githubusercontent.com/51187764/85794095-6e863080-b70c-11ea-981b-0d1446787eae.png)

There should be a pair of settings like `"editor.FindReplaceWidgetFontFace": "Consolas",` and `"editor.FindReplaceWidgetFontSize": "16",` (the names are just examples).