sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Feature Request: Readonly<T> should remove mutable methods
Labels: Suggestion,Awaiting More Feedback

## Search Terms

readonly, as const, Readonly<T>,

## Suggestion

Readonly<T> to work the way Readonly<T[]> does without having to create something like ReadonlyArray<T>, ReadonlySet<T>, etc...


I would love it if the `Readonly<T>` mapped type could exclude any method marked as `readonly` or maybe `as cosnt` or something similar.

## Use Cases

At the moment I have to do this:

```typescript
class Vector2 {
    public constructor(
        public x: number,
        public x: number,
    ) {}

    public add(other: ReadonlyVector2): Vector2 {
        return this.clone().addInPlace(other);
    }

    public addInPlace(other: ReadonlyVector2): this {
        this.x += other.x;
        this.y += other.y;
        return this;
    }

    public clone(): Vector2 {
        return new Vector2(this.x, this.y);
    }
}

interface ReadonlyVector2 {
    readonly x: number;
    readonly y: number;
    add(other: ReadonlyVector2): Vector2;
    clone(): Vector2;
}
```

This gets very boring with a lot of types, also it's error prone. I could forget to add something to the interface, or worse I could accidentally add something that is mutable.

I can currently do `method(this: Readonly<this>) {...}`, which is helpful, but doesn't stop me calling mutable methods on the type.

Inside a marked method you would be unable to mutate the state of member variables and you would unable to call other unmarked methods.

This would also allow you to remove the special case of `Readonly<T[]>`. The mutable methods of arrays could be marked with whatever syntax is decided and then `Readonly<T[]>` would just work like any other `Readonly<T>`. Currently I don't bother using `Readonly<T>` since it doesn't really help with anything except C style POD types. 

## Examples

```typescript
class Vector2 {
    public constructor(
        public x: number,
        public x: number,
    ) {}

    public readonly add(other: Readonly<Vector2>): Vector2 {
        return this.clone().addInPlace(other);
    }

    public addInPlace(other: Readonly<Vector2>): this {
        this.x += other.x;
        this.y += other.y;
        return this;
    }

    public const clone(): Vector2 {
        return new Vector2(this.x, this.y);
    }
}
```

## 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: godot
Issue: The 3D camera FOV isn't always set correctly when using camera replication
Labels: bug,topic:editor,confirmed,topic:3d

**Godot version:** Git https://github.com/godotengine/godot/commit/ebdd2bc474f6bb3ff124755196fa116c4fd91385

**OS/device including version:** Fedora 31

**Issue description:**

Depending on when you change the editor camera FOV, it may not always apply to the running project when editor camera replication is enabled.

This is not limited to FOV; the same bug occurs with the camera's near and far plane values.

**Steps to reproduce:**

1. Run a project that has a Camera node and enable camera replication at the top of the 3D viewport.
2. Change the camera FOV using the **View > Settings** menu at the top of the 3D viewport. Notice how the FOV also changes in the running project.
3. Disable camera replication and enable it again.
4. Notice how the default camera FOV was restored (instead of using the current editor camera FOV).

**Minimal reproduction project:** Any 3D project can do, but you can use this one for testing purposes: [test_dithering.zip](https://github.com/godotengine/godot/files/3882914/test_dithering.zip)
Repository: PowerToys
Issue: [Shortcut Guide] Add shortcut taskbar for Task View / Cortana / Widget
Labels: Idea-Enhancement,Product-Shortcut Guide,Area-Quality

# Summary of the enhancement

This issue details two small update suggestions to the Shortcut Guide PowerToy.

The first update would move the "Open Task view" tip to just above the taskbar, where the number-key tips currently appear.

The second update would add a "C - Open Cortana" tip above the Cortana button on the taskbar, in the same row as the number-key tips.

These suggestions are illustrated below:
![Annotation 2019-11-23 161021](https://user-images.githubusercontent.com/42657792/69486704-d0478a80-0e0b-11ea-9a8f-48cc4674af01.png)

In addition, I am aware that users can customize the taskbar by removing one or both of these buttons. In that case, the tips should probably be moved back to the standard location (in the middle of the screen).
Repository: youtube-dl
Issue: Add support for Win32 long paths
Labels: request

<!--

######################################################################
  WARNING!
  IGNORING THE FOLLOWING TEMPLATE WILL RESULT IN ISSUE CLOSED AS INCOMPLETE
######################################################################

-->


## Checklist

<!--
Carefully read and work through this check list in order to prevent the most common mistakes and misuse of youtube-dl:
- First of, make sure you are using the latest version of youtube-dl. Run `youtube-dl --version` and ensure your version is 2019.11.22. If it's not, see https://yt-dl.org/update on how to update. Issues with outdated version will be REJECTED.
- Search the bugtracker for similar feature requests: http://yt-dl.org/search-issues. DO NOT post duplicates.
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm reporting a feature request
- [x] I've verified that I'm running youtube-dl version **2019.11.22**
- [x] I've searched the bugtracker for similar feature requests including closed ones


## Description

<!--
Provide an explanation of your issue in an arbitrary form. Please make sure the description is worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient. Provide any additional information, suggested solution and as much context and examples as possible.
-->

Windows 10 allows users to enable Win32 long paths either from the Local Group Policy Editor or Registry Editor. However, youtube-dl does not honor this setting and fails to download files that are longer than 260 characters. Is it possible for youtube-dl to honor the Win32 long paths setting if enabled?
Repository: pytorch
Issue: Add Google Colab as an option on the 'Get Started' page.
Labels: module: docs,triaged,enhancement

## 🚀 Feature
Along with all the instructions for local installation on https://pytorch.org/get-started/locally/ it would be great to also add a few lines about Google Colab notebooks. 

## Motivation
Colab notebooks already set up with all required libraries pre-installed. It saves time, and users don't have to deal with errors while building or installing. All the work already done. Also, it would be a great place to start because the already existing Colab notebooks can be imported without any hassle.

## Pitch
NA

## Alternatives
NA

## Additional context
NA
Repository: godot
Issue: AtlasTexture does not work with some Objects and Resources
Labels: bug,discussion,topic:core,topic:rendering,confirmed,documentation

**Godot version:**
3.1.1

**OS/device including version:**
Windows 10

**Issue description:**
Using the AtlasTexture on some Objects and Ressources does not use the selected region but the whole image. I found this to be the case with AnimatedTexture and CPUParticles2D, but I am prety shure, this is are not the only two cases. 

**Steps to reproduce:**

- Create a AnimatedTexture or CPUParticles2D
- Use a AtlasTexture as the Texture
- The whole AtlasTexture is used instead of the selected Region

Note: The AtlasTexture is shown correctly in the Editor

**Minimal reproduction project:**
Repository: pytorch
Issue: Docs missing link to torch.__config__
Labels: module: docs,triaged

## 📚 Documentation

The docs page currently contains a link to "torch.__config__" in the left sidebar under Python API.

This link leads to a dead end (https://pytorch.org/docs/stable/__config__.html).

The link or the sidebar should be updated. 

Thanks!
-Dan
Repository: go
Issue: x/crypto/bcrypt: base64 decode - incorrect padding calculation
Labels: NeedsInvestigation

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.13.4 darwin/amd64
</pre>

### Does this issue reproduce with the latest release?
Yes

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/bparadise/Library/Caches/go-build"
GOENV="/Users/bparadise/Library/Application Support/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GONOPROXY=""
GONOSUMDB=""
GOOS="darwin"
GOPATH="/Users/bparadise/dev/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/darwin_amd64"
GCCGO="gccgo"
AR="ar"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD="/Users/bparadise/dev/go/src/github.com/demisto/server/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/dw/42b9g2ds6_552shlyt5kym0jqhh9d5/T/go-build594486857=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?
Test bcrypt base64 decoding function with inputs of different lengths, generated using the corresponding encoding function from the same file

### What did you expect to see?
Successful decoding of all valid base64-encoded inputs

### What did you see instead?
Decoding errors

## Additional Details
### Description
When calculating padding `=`s, the calculation returns 4 when it should return 0.
This edge case is never encountered in bcrypt, since the inputs are always the same length (which is not divisible by 4).

### Reference
This is the existing code (https://github.com/golang/crypto/blob/ac88ee75c92c889b97e05591e9a39b6480c538b3/bcrypt/base64.go#L24)
```
	numOfEquals := 4 - (len(src) % 4)
```

### Suggested fix
```
	numOfEquals := (4 - (len(src) % 4)) % 4
```
Repository: terminal
Issue: ED3 in the alt buffer should erase the main scrollback buffer
Labels: Product-Conhost,Area-VT,Issue-Bug,Priority-2

# Environment

Windows build number: Version 10.0.18362.356
Also tested with a recent build from source: 171f00c2656731e5ba0185dbbf337389fb7030bd

# Steps to reproduce

1. Start a WSL bash shell in conhost.
2. Do a long directory listing so you get some content in the backscroll buffer. 
3. Execute this command: `printf "\e[?1049h\e[3J\e[?1049l"`

That command switches to the alternate buffer (private mode 1049), executes the `ED` escape sequence with parameter 3 (i.e. erase the scrollback buffer), and then switches back to the main buffer.

# Expected behavior

The alternate screen buffer doesn't have a scrollback, so the `ED3` sequence should erase the main scrollback buffer. Then when you switch back to the main screen, there should be no scrollback any more.

This is how the command is implemented in XTerm, and most of the other terminal emulators I've tested.

# Actual behavior

The main scrollback buffer isn't erased.

This is probably somewhat related to issue #3545. I think the alt screen technically has its own scrollback (even though it's zero length), and it's that empty buffer that is being "erased" when `ED3` is executed. It might be better if the alt screen shared the same buffer as the main screen.
Repository: tauri
Issue: Actually use security framework
Labels: help wanted,good first issue

**Describe the solution you'd like**
It'd be nice to actually apply the security framework when building.

**Describe alternatives you've considered**
Ignoring security problems won't help.
Repository: rust
Issue: Decide the precise rules for operand of &raw [const|mut]
Labels: T-lang,F-raw_ref_op

#66671 implements a check on the operand of `&raw [const|mut]` to ensure that it's not a temporary. It's similar to the check used for the left-hand operand of `=`, but it only allows field and index projections when they are based on a place expression, or it there is at least one deref adjustment involved.

It's possible that we want to restrict this to "at least one deref adjustment from a reference" or some other variant that limits the use of this with overloaded deref coercions.

```rust
// The following are all currently OK
Struct A { f: (i32, u32) }
let x: A = ...;
&raw const x;
&raw const x.f;
&raw const x.f.0;
let y = &x;
&raw const y;
&raw const *y;
&raw const (*y).f;
&raw const y.f;          // Same as above
&raw const (*y).f.0;
&raw const y.f.0;        // Same as above

// There's no distinction between `&T` and `Rc<T>`
use std::rc::Rc;
use std::ops::Deref;

let z = std::rc::Rc::new(x);
&raw const z;
&raw const *(z.deref());
&raw const *z;           // Same as above
&raw const (*z).f;
&raw const z.f;          // Same as above
&raw const (*z).f.0;
&raw const z.f.0;        // Same as above

// The following are not allowed:
&raw const A { ... };
&raw const A { ... }.f;
&raw const A { ... }.f.0;

// These are allowed:
const X: &A = ...;
&raw const *X;
&raw const X.f;
&raw const X.f.0;

// These are allowed, because they can't easily be distinguished from the above. They all result in immediately dangling pointers.
&raw const *(&A { ... });
&raw const (&A { ... }).f;
&raw const (&A { ... }).f.0;

// These are also allowed, and seem even more dubious.
&raw const *Rc::new(A { ... });
&raw const Rc::new(A { ... }).f;
&raw const Rc::new(A { ... }).f.0;
```

cc #64490
cc @Centril @RalfJung @oli-obk
Repository: pytorch
Issue: Exponentiated gradient descent
Labels: feature,module: optimizer,triaged

## 🚀 Feature
I am interested in contributing an [exponentiated gradient descent optimizer](https://ttic.uchicago.edu/~tewari/lectures/lecture4.pdf)  to pytorch.

## Motivation

Optimizing variables / parameters with a simplex constraint on the parameters.

## Pitch

Contribute a new optimizer

## Alternatives

Projected gradient descent.



cc @vincentqb
Repository: rust
Issue: std::future: Document that each Future (Stream, etc) must only be used by one task at a time
Labels: C-enhancement,T-libs-api,A-docs,A-async-await,AsyncAwait-Triaged

See https://github.com/snapview/tokio-tungstenite/pull/68#issuecomment-557907777 for context.

I couldn't find anything in the docs about this (maybe I just missed it), but current futures executors / async runtimes only allow remembering one waker per future/etc. So if you use the same in multiple tasks, one of the tasks would potentially never be woken up.

Allowing only one makes sense for performance reasons, so seems like a good idea.

This should be documented somewhere to make this constraint clear.
Repository: pytorch
Issue: [docs] Missing docs for Storage.from_buffer
Labels: module: docs,triaged

https://pytorch.org/docs/master/storage.html#torch.FloatStorage.from_buffer

This method is useful when ingesting byte streams/arrays from external programs like sox or ffmpeg.
Repository: pytorch
Issue: Increasing memory usage on CPU
Labels: module: performance,module: cpu,module: memory usage,triaged

## 🐛 Bug

I am trying to run a small neural network on the CPU and am finding that the memory used by my script increases without limit. Since my script does not do much besides call the network, the problem appears to be a memory leak within pytorch.

The problem does not occur if I run the model on the gpu.

## To Reproduce

I am attaching a Dockerfile that builds my environment and a script (test.py) that reproduces the issue.
[Dockerfile](https://gist.github.com/varun-intel/e36716c839c9ad5ced4dc08cd274d8e1)
[test.py](https://gist.github.com/varun-intel/08fe43f05533ad2613d97f19c9473d01)

The output of the script is:
[output](https://gist.github.com/varun-intel/22456b07e7229215570d54875c841fe5)
The memory usage continues to increase until the script crashes with an out of memory error.

## Expected behavior

The memory should increase until it reaches a reasonable steady state.

## Environment

Collecting environment information...
PyTorch version: 1.3.1
Is debug build: No
CUDA used to build PyTorch: 10.1.243

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.4.0-1ubuntu1~18.04.1) 7.4.0
CMake version: version 3.10.2

Python version: 3.5
Is CUDA available: Yes
CUDA runtime version: 10.0.130
GPU models and configuration: GPU 0: TITAN Xp
Nvidia driver version: 430.26
cuDNN version: /usr/lib/x86_64-linux-gnu/libcudnn.so.7.6.3

Versions of relevant libraries:
[pip3] numpy==1.13.3
[conda] Could not collect


cc @VitalyFedyunin @ngimel @mruberry
Repository: rust
Issue: E0119 can overwrite E0277 leading to confusing error message
Labels: A-diagnostics,A-DSTs,T-compiler,C-bug

Code:

```rust
trait Trait {}

struct Unsized {
    tail: [()],
    marker: (),
}

impl<T: Sized> Trait for T {}
impl Trait for Unsized {}
```

error:

```
error[E0119]: conflicting implementations of trait `Trait` for type `Unsized`:
  --> src/lib.rs:10:1
   |
9  | impl<T: Sized> Trait for T {}
   | -------------------------- first implementation here
10 | impl Trait for Unsized {}
   | ^^^^^^^^^^^^^^^^^^^^^^ conflicting implementation for `Unsized`
```

Without `impl Trait for Unsized`:

```
error[E0277]: the size for values of type `[()]` cannot be known at compilation time
 --> src/lib.rs:4:5
  |
4 |     tail: [()],
  |     ^^^^^^^^^^ doesn't have a size known at compile-time
  |
  = help: the trait `std::marker::Sized` is not implemented for `[()]`
  = note: to learn more, visit <https://doc.rust-lang.org/book/ch19-04-advanced-types.html#dynamically-sized-types-and-the-sized-trait>
  = note: only the last field of a struct may have a dynamically sized type
```

The better behavior would be to

- Make sure that the E0277 is emitted even in the case of other errors.
- When finding an E0277 struct definition, treat it as if it were `?Sized` through the rest of the pipeline.
Repository: godot
Issue: Previously opened script's horizontal scrollbars are shifted after application restart
Labels: bug,topic:editor,confirmed,usability

**Godot version:**
v3.2.beta.custom_build.28613ab8c

**OS/device including version:**
Windows 10

**Issue description:**
Godot remembers for each script position of a text cursor. And after restart tries to set position of the horizontal scrollbar so that the text cursor is located at the beginning of the editor space.
Scrollbar should always be at position 0 (or as it was before)

![scroll_offset_bug](https://user-images.githubusercontent.com/11059246/69503867-6ec41080-0f1e-11ea-8e16-e8423ba080d1.png)
Repository: rust
Issue: libcore crate docs are out of date regarding panic handling
Labels: C-enhancement,T-libs-api,A-docs

https://github.com/rust-lang/rust/blob/c9bacb70f0b19d324a548bd7942692ab18d159a4/src/libcore/lib.rs#L20-L39

These docs discuss `rust_begin_panic` and `rust_eh_personality`, which seems outdated. Instead they should probably document the `#[panic_handler]` attribute or link to [the corresponding Nomicon chapter](https://doc.rust-lang.org/nomicon/panic-handler.html).
Repository: pytorch
Issue: Conv2d: Inconsistent results on Raspberry Pi 3B 
Labels: module: convolution,triaged

## 🐛 Bug

The problem is the result after a convolution layer. With some kernel sizes like (3, 3), only the first channel have expected values, the other have random values.

I try with Pyotrch 1.4.0 which I build and unofficial wheel of Pytorch 1.3.0 on Raspberry pi 3B and 3B+

## To Reproduce

Steps to reproduce the behavior:

1. Create a zero tensor
2. Create a Conv2d with a kernel size of 3 and 3 output channels
3. Apply the layer to the tensor

```
import torch
import torch.nn as nn

tensor = torch.zeros([1, 1, 10, 14]).float()
conv1 = nn.Conv2d(in_channels=1, out_channels=3, kernel_size=3)
print(conv1(tensor))
```

## Expected behavior

I expect to get tensor the same value on each channels,  the offset.
Then the first channel have this value, the second and third have theses values : 2.9514e+29, 3.1036e+27, 2.0706e-19 for examples.


## Environment

PyTorch version: 1.4.0a0+e05e90c
Is debug build: No
CUDA used to build PyTorch: None

OS: Raspbian GNU/Linux 10 (buster)
GCC version: (Raspbian 8.3.0-6+rpi1) 8.3.0
CMake version: version 3.13.4

Python version: 3.7
Is CUDA available: No
CUDA runtime version: No CUDA
GPU models and configuration: No CUDA
Nvidia driver version: No CUDA
cuDNN version: No CUDA

Versions of relevant libraries:
[pip3] numpy==1.17.4
[pip3] torch==1.4.0a0+e05e90c

## Additional context

I try with a kernel size of 4, the result is consistent but if I set the weight parameters, the output get the same problem.
Repository: pytorch
Issue: Unexpected difference torch.multiprocessing.manager.queue and torch.multiprocessing.queue
Labels: module: multiprocessing,module: cuda,triaged

It seems that torch.multiprocessing.Manager.Queue doesn't support multiprocessor sharing of cuda tensors. 
Running the repro below throws the exception:

> RuntimeError: Attempted to send CUDA tensor received from another process; this is not currently supported. Consider cloning before sending.



```
import torch
import torch.multiprocessing as mp


def produce(in_Q, out_Q):
    while True:
        t = in_Q.get()
        v = torch.tensor(t, device='cuda')
        out_Q.put(v)

def consume(out_Q):
    res = out_Q.get()
    return res

def main():
    if False: #-----------Change this to True for the expected behavior queue --------------------
        qsrc = mp
    else:
        manager = mp.Manager()
        qsrc = manager
    
    in_Q = qsrc.Queue(10)
    out_Q = qsrc.Queue(10)

    consumer = mp.Process(target=consume, args=[out_Q])
    consumer.start()
    producer = mp.Process(target=produce, args=(in_Q, out_Q))
    producer.start()
    in_Q.put(1)
    consumer.join()
    print('done.')

if __name__ == "__main__":
    main()
```

cc @ngimel
Repository: opencv
Issue: Set CAP_PROP_ZOOM not working (python & directshow)
Labels: bug,priority: low,category: videoio(camera),platform: win32

### System information (version)
- OpenCV => 4.1.2 (Python 3.7)
- Operating System / Platform => Windows 10 64 Bit
- Hardware => Surface Book Pro

##### Detailed description

Using the directshow framework of OpenCV's Video-Module, it seems to be impossible to set the zoom-value like so:

`self.vidcap.set(cv2.CAP_PROP_ZOOM, zoomValue)`

This always returns 'false' no matter what values are put in.

Opening the settings dialog with

`self.vidcap.set(cv2.CAP_PROP_SETTINGS, True)`

it is possible to zoom, by using the slider. Using the slider and afterwards obtaining the zoom value with `self.vidcap.get(cv2.CAP_PROP_ZOOM)` reports the correct values, which were set with the slider in the settings dialog.

##### Steps to reproduce

```
import cv2
self.vidcap = cv2.VideoCapture()
self.vidcap.open(deviceID + cv2.CAP_DSHOW)
self.vidcap.set(cv2.CAP_PROP_SETTINGS, True)
self.vidcap.set(cv2.CAP_PROP_ZOOM, 10.0) # <-- this always returns false and does nothing
```