sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: Consider adding `primitive` as a union of all primitive types
Labels: Suggestion,Awaiting More Feedback

## Search Terms

- primitive type
- primitive type union

## Suggestion

`primitive` would be a union of all primitive types, e.g.:
```ts
type primitive = string | number | bigint | boolean | symbol | null | undefined; // unknown & not object
```

The advantage of doing this as a **TypeScript** built‑in rather than defining it in user space is that when a new primitive type gets added to **ECMAScript** (e.g.: `bigdecimal`), it will be supported automatically without needing to update the type definitions of the library.

## Use Cases


When describing an API that takes all‑but‑one primitive type, it’s useful to be able to do `Exclude<primitive, symbol>` or `Exclude<primitive, number | bigint>` without needing <https://github.com/microsoft/TypeScript/pull/29317>.

## Examples

<dl>
<dt>From <a href="https://github.com/DefinitelyTyped/DefinitelyTyped/pull/44805">DefinitelyTyped/DefinitelyTyped#44805</a>:</dt>
<dd>

```ts
/**
 * @see https://tc39.es/ecma262/#sec-createhtml
 */
export function CreateHTML(
	string: object | Exclude<primitive, string>, // unknown & not string
	tag: string,
	attribute: string,
	value?: object | Exclude<primitive, string>, // unknown & not string
): string;

/**
 * @throws {TypeError} If `x` or `y` is a `number` or `bigint` or they're different types.
 * @see https://tc39.es/ecma262/#sec-samevaluenonnumeric
 */
export function SameValueNonNumeric(
	x: object | Exclude<primitive, number | bigint>, // unknown & not (number | bigint)
	y: object | Exclude<primitive, number | bigint>, // unknown & not (number | bigint)
): boolean;
```
</dd>
</dl>

## 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).

## Related

- <https://github.com/microsoft/TypeScript/issues/28131>
- <https://github.com/microsoft/TypeScript/pull/29317>
- <https://github.com/microsoft/TypeScript/issues/39498>
Repository: scrcpy
Issue: [feature request] Add option to clamp events coordinates inside the device screen (swipe from left/right edge)
Labels: feature request

 - [x] I have checked that a similar [feature request](https://github.com/Genymobile/scrcpy/issues?q=is%3Aopen+is%3Aissue+label%3A%22feature+request%22) does not already exist.

**Is your feature request related to a problem? Please describe.**
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
I am using Samsung Note 10 and I setup my phone to remove Navigation Bar and using One Hand Operation+ for swipe gesture from left/right edge of the screen for navigation.
Like swipe left from right edge to back, swipe left + down from right edge for home.
For that setup, currently I increase horizontal of the window to add black padding zone
But the mouse drag from black padding zone is not recognized.

**Describe the solution you'd like**
A clear and concise description of what you want to happen.
- Accept swipe started from black padding zone that ended inside screen zone
I am using follow coordinate:
^
|
y
x ->

So when a swipe start from padding zone, we would wait only until the mouse click and being dragged into the screen as filter condition of mistake.
When condition meet, the gesture would start from same Y of the coordinate but we would rewrite the start X coordinator to be inside of screen
The end gesture would be where mouse ended the drag

**Describe alternatives you've considered**
A clear and concise description of any alternative solutions or features you've considered.

**Additional context**
Add any other context or screenshots about the feature request here.
Repository: PowerToys
Issue: [FancyZones] Dragging to edge of screen could bring up the FancyZones overlay, instead of default Windows snap overlay
Labels: Idea-Enhancement,Product-FancyZones

# Summary of the new feature/enhancement

Currently when dragging a window to an edge of a monitor, the window will snap to Windows' default snap positions.
![e048f12e-214c-46c9-a999-696cc68daef2](https://user-images.githubusercontent.com/5911334/87004498-22fb6a00-c183-11ea-9dea-33faaeb27874.gif)

It would be pretty cool if FancyZones could override this interaction to snap to a FancyZone
Repository: pytorch
Issue: The new version of the libtorch become slow
Labels: module: performance,oncall: jit,module: cpp,triaged

My previous program based on  libtorch  1.0.0 Slow down 100ms after the upgrade. And then I find that the same code ran libtorch1.0.0 would be faster than 1.3.0-1.5.1. That's why?  1.1.0-1.2.0 I have not test.


cc @suo @gmagogsfm @yf225 @glaringlee @VitalyFedyunin @ngimel
Repository: pytorch
Issue: Failure to build on Power9 due to FXDIV_SOURCE_DIR not being set
Labels: module: build,triaged,module: POWER

## 🐛 Bug

The build (actually the cmake configure) on Power9 architectures fails with a strange error:

```
CMake Error at cmake/Codegen.cmake:207 (add_custom_target):
  add_custom_target cannot create target "ATEN_CPU_FILES_GEN_TARGET" because
  another target with the same name already exists.  The existing target is a
  custom target created in source directory
  "/dev/shm/s3248973-EasyBuild/PyTorch/1.5.1/fosscuda-2019b-Python-3.7.4/pytorch-1.5.1/caffe2".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  caffe2/CMakeLists.txt:3 (include)


CMake Error at cmake/Codegen.cmake:208 (add_custom_target):
  add_custom_target cannot create target "ATEN_CUDA_FILES_GEN_TARGET" because
  another target with the same name already exists.  The existing target is a
  custom target created in source directory
  "/dev/shm/s3248973-EasyBuild/PyTorch/1.5.1/fosscuda-2019b-Python-3.7.4/pytorch-1.5.1/caffe2".
  See documentation for policy CMP0002 for more details.
Call Stack (most recent call first):
  caffe2/CMakeLists.txt:3 (include)
```

## To Reproduce

Steps to reproduce the behavior:

1. `python setup.py install` on Power9 with the 1.5.* releases and current master branch

## Expected behavior

Build works

## Additional context

I used `cmake --trace` to narrow this down:
- `pytorch-1.5.1/CMakeLists.txt(564):  add_subdirectory(caffe2 )` starts running the caffe2 CMakeLists
- `pytorch-1.5.1/caffe2/CMakeLists.txt(61):  ADD_SUBDIRECTORY(${FXDIV_SOURCE_DIR} ${CMAKE_BINARY_DIR}/FXdiv )` starts running the same CMakeLists again, see https://github.com/pytorch/pytorch/blob/a8bc7545d5998c5e3e0c07f01f8c816cd381904f/cmake/Dependencies.cmake#L256 and https://github.com/pytorch/pytorch/blob/a6b703cc89e57273ab943e0ac38eb09b7e6ecd14/caffe2/CMakeLists.txt#L94-L96

Having that I found that in `cmake/Dependencies.cmake` the variable `FXDIV_SOURCE_DIR` is set only if *NPACK is build, which is not the case on Power. Using this unset variable seems to include the current folder again leading to the problem


cc @malfet
Repository: go
Issue: proposal: encoding/json: garbage-free reading of tokens
Labels: Proposal,Proposal-Hold

As @bradfitz noted in the reviews of the original API, the `Decoder.ReadToken` API [is a garbage factory](https://go-review.googlesource.com/c/go/+/11651/2/src/encoding/json/stream.go#279). Although, as @rsc noted at the time, "a clean API ... is more important here. I expect people to use it to get to the position they want in the stream and then call Decode", the inefficiency is a problem in practice for anyone that wishes to use the encoding/json tokenizer as a basis for some other kind of decoder.

Dave Cheney's  ["Building a high performance JSON parser"](https://dave.cheney.net/high-performance-json.html) details some of the issues involved. He comes to the conclusion that the interface-based nature of [json.Token](https://golang.org/pkg/encoding/json/#Token) is a fundamental obstacle. I like the current interface-based API, but it does indeed make it impossible to return arbitrary tokens without creating garbage. Dave suggests [a new `Scanner` API](https://dave.cheney.net/high-performance-json.html#_scanning), somewhat more complex, that is also not backwardly compatible with the current API in encoding/json.

I propose instead that the following method be added to the `encoding/json` package:

```
// TokenBytes is like Token, except that for strings and numbers, it returns
// a static Token value with the actual data payload in the []byte parameter,
// which is only valid until the next call to Token or TokenBytes or Decode.
// For strings, the returned Token will be ""; for a number, it will be
// Number("0"); for all other kinds of token, the Token will be returned as by
// Token method and the []byte value will be nil.
//
// This is more efficient than using Token because it avoids the
// allocations required by that API.
func (dec *Decoder) TokenBytes() (Token, []byte, error)
```

`Token` can be implemented in terms of `TokenBytes` as follows:

```
func (dec *Decoder) Token() (Token, error) {
	tok, data, err := dec.TokenBytes()
	if err != nil || data == nil {
		return tok, err
	}
	switch tok {
	case "":
		return string(data)
	case Number(0):
		return Number(data)
	}
	panic("unreachable")
}
```

## Discussion

This proposal relies on the observation that the `Decoder.Token` API only generates garbage for two kinds of tokens: numbers and strings. For all other token types, no garbage need be generated, as small numbers (`json.Delim` and bool) do not incur an allocation when boxed in an interface.

It maintains the current API as-is. Users can opt-in to the new API if they require efficiency at some risk of incorrectness (the caller could hold onto the data slice after the next call to Decode). The cognitive overhead of `TokenBytes` is arguably low because of its similarity to the existing API.

If [this proposal](https://github.com/golang/go/issues/40127) is accepted, an `Encoder.EncodeTokenBytes` could easily be added to provide garbage-free streaming JSON generation too.
Repository: youtube-dl
Issue: Reverse playlist and then start from particular number
Labels: question

<!--

######################################################################
  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:
- Look through the README (http://yt-dl.org/readme) and FAQ (http://yt-dl.org/faq) for similar questions
- Search the bugtracker for similar questions: http://yt-dl.org/search-issues
- Finally, put x into all relevant boxes (like this [x])
-->

- [x] I'm asking a question
- [x] I've looked through the README and FAQ for similar questions
- [x] I've searched the bugtracker for similar questions including closed ones


## Question

<!--
Ask your question in an arbitrary form. Please make sure it's worded well enough to be understood, see https://github.com/ytdl-org/youtube-dl#is-the-description-of-the-issue-itself-sufficient.
-->

WRITE QUESTION HERE

Want to download all uploaded videos of a channel in reverse order with the renaming of the filename adding a prefix number associated video number, i.e., first video uploaded should have 01 in front of the filename. I used the following command.

`youtube-dl --playlist-reverse -o "SubFolder/%(playlist_index)s-%(title)s.%(ext)s" https://www.youtube.com/playlist?list=AbcdEf1GhIjK2lmn3OpqRs4t -f "bestvideo[height<=720][ext=mp4]+bestaudio/[height <=? 720]"`

This works perfectly.

But I had to stop, unfortunately in the middle, say 6 videos downloaded. Thus, want to start from 7th. I used the following command.

`youtube-dl --playlist-reverse -o "SubFolder/%(playlist_index)s-%(title)s.%(ext)s" https://www.youtube.com/playlist?list=AbcdEf1GhIjK2lmn3OpqRs4t -f "bestvideo[height<=720][ext=mp4]+bestaudio/[height <=? 720]" --playlist-start 7`

Now, what it does is, 1st it removes the top 6 videos without reversing and then reverse the playlist (probably) and starts downloading from 1st video of the channel and the file name starts with 07 along with video title.

What I actually expected/wanted: a command that reverses the playlist first and then starts from --playlist-start.

Probably similar to [this issue](https://github.com/ytdl-org/youtube-dl/issues/6845) but that is opened from Sept 2015 :(.
Repository: ant-design
Issue: Add swipe support to `Tabs` to switch between `TabPane`s
Labels: 💡 Feature Request,Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### What problem does this feature solve?
When using the component `Tabs`, it would be great for users on mobile to be able to switch between `TabPane`s by a swipe gesture like on `ant-design-mobile`.

I am using ant-design for a web application which should work equally good on desktop and on mobile (which is why we chose `ant-design` instead of `ant-design-mobile`).

### What does the proposed API look like?
Add a `swipeable` prop to `Tabs` to enable switching tabs with a swipe gesture.


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: TypeScript
Issue: Head comments are removed in some cases for next `import` line
Labels: Bug

---
name: Bug
about: Create a report to help us improve TypeScript
title: 'Head comments are removed in some cases'
labels: ''
assignees: ''

---


**TypeScript Version:**  3.7.x-dev.201xxxxx


There is a  repo, the same result for 3.6 and latest next 4.0...

**Search Terms:**

**Code**

```ts
// @some-comment
import { A } from "./mod";

const a: A = {};
```

Repro repo: https://github.com/whitecolor/ts-remove-comment-import

**Expected behavior:**

Comments is not removed

```js
"use strict";
// @some-comment
Object.defineProperty(exports, "__esModule", { value: true });
var a = {};
```


**Actual behavior:**

Head comments are removed in some cases for next `import` line. Produced output:

```js
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
var a = {};
```

**Playground Link:** <!-- A link to a TypeScript Playground "Share" link which demonstrates this behavior -->

No.

**Related Issues:** <!-- Did you find other bugs that looked similar? -->

Yes. There were a few alike issues before.
Repository: ant-design
Issue: 分页组件（Pagination）的 pageSize 选择器中能否添加一个“显示全部”的选项
Labels: Inactive

- [x] I have searched the [issues](https://github.com/ant-design/ant-design/issues) of this repository and believe that this is not a duplicate.

### What problem does this feature solve?
现在虽然可以设置一个例如 1000 条/页 这样比较大的页数，但是实际情况下需要用户自己去理解一下当总条目数小于 1000 时，选这个“1000 条/页”就是展示全部的效果，而且有些业务场景我们也无法预知这个总条目会不会超过 1000 条。能不能做到当这个 Pagination 能够获取到总条目数（total）的情况下，允许提供一个 API 使 pageSize 的下拉框中出现一个“展示全部”的选项。

### What does the proposed API look like?
```tsx
<Pagination showSizeChanger showTotalSizeOption  total={865} />
```


<!-- generated by ant-design-issue-helper. DO NOT REMOVE -->
Repository: react-native
Issue: iOS can't dismiss Modal! 
Labels: Platform: iOS,Resolution: PR Submitted,Component: Modal,Never gets stale

## Description

On iOS the `<Modal>` component cannot be dismissed by dragging down. (gesture is a native behaviour on iOS)

The reason for that being is that the `onDismiss` or `onRequestClose` function is never called. It is only being called on tvOS.

## React Native version:

```
info Fetching system and libraries information...
(node:10129) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
System:
    OS: macOS 10.15.5
    CPU: (16) x64 Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
    Memory: 2.78 GB / 32.00 GB
    Shell: 5.7.1 - /bin/zsh
  Binaries:
    Node: 14.4.0 - /usr/local/bin/node
    Yarn: 1.22.4 - /usr/local/bin/yarn
    npm: 6.14.5 - /usr/local/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  Managers:
    CocoaPods: 1.9.3 - /usr/local/bin/pod
  SDKs:
    iOS SDK:
      Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
    Android SDK:
      API Levels: 25, 28, 29
      Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.0, 30.0.0, 30.0.0
      System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
      Android NDK: 21.2.6472646
  IDEs:
    Android Studio: 4.0 AI-193.6911.18.40.6514223
    Xcode: 11.5/11E608c - /usr/bin/xcodebuild
  Languages:
    Java: 1.8.0_252 - /usr/bin/javac
    Python: 2.7.16 - /usr/bin/python
  npmPackages:
    @react-native-community/cli: Not Found
    react: 16.13.1 => 16.13.1 
    react-native: 0.63.0 => 0.63.0 
  npmGlobalPackages:
    *react-native*: Not Found
```

## Steps To Reproduce

1. Create `<Modal>` component and set `visible` and `onRequestClose` properties
2. Open Modal by setting `visible` to `true`
3. Try to close Modal by dragging down

## Expected Results

Modal should be dragged down and `onDismiss` or `onRequestClose` should be called

## Snack, code example, screenshot, or link to a repository:

```tsx
<Modal
  presentationStyle="pageSheet"
  visible={true}
  onRequestClose={() => console.log("will never be called.")} />
```
![Screen Recording 2020-07-09 at 13 40 49 mov](https://user-images.githubusercontent.com/15199031/87036482-2a565e00-c1eb-11ea-96e7-1be40e591de8.gif)
Repository: godot
Issue: `drop_data` doesnt fire if `visible = false ; visible = true`was called before
Labels: bug,topic:gui

<!-- Please search existing issues for potential duplicates before filing yours:	
https://github.com/godotengine/godot/issues?q=is%3Aissue	
-->

**Godot version:** 3.2.1.stable
<!-- Specify commit hash if using non-official build. -->

**OS/device including version:** Arch Linux
<!-- Specify GPU model, drivers, and the backend (GLES2, GLES3, Vulkan) if graphics-related. -->

**Issue description:**
<!-- What happened, and what was expected. -->

Drag&Drop on a panel with mouse_filter 'Pass' calls the `drop_data` function on the panel's parent as expected. But if the panel's `visible` property was set false and then to true immediately before that, it prevents the `drop_data` call, as if it's mouse_filter was set to 'Stop'. When it's mouse_filter is set to 'Ignore' it works as expected.

**Steps to reproduce:**
Open the minimal reproduction projection and drag the Label with the text 'drag me!' on the red panel with the mouse_filter property set to 'Pass' and its visibility double-toggled on each mouse motion event. The drop event will not fire although it should.

**Minimal reproduction project:** 
[drop_data_visibility_changed.zip](https://github.com/godotengine/godot/files/4896741/drop_data_visibility_changed.zip)

![s](https://user-images.githubusercontent.com/6108978/87041091-fe8aa680-c1f1-11ea-86a8-936b4c7ee4c8.png)


<!-- A small Godot project which reproduces the issue. Drag and drop a zip archive to upload it. -->
**workaround:** My workaround is to buffer the visibility in a special variable and set the visible property later.
Repository: pytorch
Issue: DLPack cannot accept empty CUDA tensor
Labels: module: cuda,triaged

## 🐛 Bug

<!-- A clear and concise description of what the bug is. -->

When converting a DLPack object representing an empty CUDA tensor to a PyTorch tensor, it crashes with "CUDA error: invalid argument".

## To Reproduce

Steps to reproduce the behavior:

```python
# bug.py
import torch as th
from torch.utils import dlpack

y = th.tensor([]).cuda()
y_dlpack = dlpack.to_dlpack(y)
dlpack.from_dlpack(y_dlpack)
```

1. Run the above `bug.py`.

<!-- If you have a code sample, error messages, stack traces, please provide it here as well -->

Error message:
```
Traceback (most recent call last):
  File "bug.py", line 6, in <module>
    dlpack.from_dlpack(y_dlpack)
RuntimeError: CUDA error: invalid argument
```

## Expected behavior

<!-- A clear and concise description of what you expected to happen. -->
Shall not crash and get a tensor of shape `torch.Size([0])`.

## Environment

```
Collecting environment information...
PyTorch version: 1.5.1
Is debug build: No
CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.3 LTS
GCC version: (Ubuntu 7.5.0-3ubuntu1~18.04) 7.5.0
CMake version: version 3.13.3

Python version: 3.7
Is CUDA available: Yes
CUDA runtime version: 10.0.130
GPU models and configuration: GPU 0: Tesla V100-SXM2-16GB
Nvidia driver version: 418.87.01
cuDNN version: /usr/local/cuda-10.1/targets/x86_64-linux/lib/libcudnn.so.7.6.2

Versions of relevant libraries:
[pip3] numpy==1.18.5
[pip3] torch==1.5.1
[pip3] torch-cluster==1.4.5
[pip3] torch-geometric==1.4.2
[pip3] torch-scatter==2.0.4
[pip3] torch-sparse==0.6.0
[pip3] torchtext==0.5.0
[conda] blas                      1.0                         mkl
[conda] cudatoolkit               10.1.243             h6bb024c_0
[conda] mkl                       2020.1                      217
[conda] mkl-service               2.3.0            py37he904b0f_0
[conda] mkl_fft                   1.1.0            py37h23d657b_0
[conda] mkl_random                1.1.1            py37h0573a6f_0
[conda] numpy                     1.18.5           py37ha1c710e_0
[conda] numpy-base                1.18.5           py37hde5b4d6_0
[conda] pytorch                   1.5.1           py3.7_cuda10.1.243_cudnn7.6.3_0    pytorch
[conda] torch-cluster             1.4.5                    pypi_0    pypi
[conda] torch-geometric           1.4.2                    pypi_0    pypi
[conda] torch-scatter             2.0.4                    pypi_0    pypi
[conda] torch-sparse              0.6.0                    pypi_0    pypi
[conda] torchtext                 0.5.0                    pypi_0    pypi
```

## Additional context

<!-- Add any other context about the problem here. -->
CPU tensor works fine.


cc @ezyang @gchanan @zou3519 @ngimel
Repository: rust
Issue: Add support for `#[doc(since="version")]` attribute
Labels: T-rustdoc,C-feature-request

To the present day, the _internal_ crates like `core` and `std` can annotate things with `#[stable(since="version")]`. This is extremely useful for users, especially because `rustdoc` is able to write this information in the rendered documentation.

Unfortunately, this kind of feature is not available for _normal_ crates. Take, for instance, [`tokio::runtime::Handle::current`](https://docs.rs/tokio/0.2.21/tokio/runtime/struct.Handle.html): this function is available since version `0.2.8` of the `tokio` crate (not sure about `0.2.7`, that's not the point), but this information is not available at a first glimpse.

IMHO, adding the possibility of annotating functions, structs and traits (and maybe something I missed) with `#[doc(since="version")]` would give more _doc_ power to crates' authors. Moreover, it should be possible to leverage the current implementation of `stable(since="version")` in order to introduce the feature without reinventing the wheel.