sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: io::Stdout should use block bufferring when appropriate
Labels: C-enhancement,T-libs-api,A-io

I feel like a pretty common pitfall for beginning Rust programmers is to try writing a program that uses `println!` to print a lot of lines, compare its performance to a similar program written in Python, and be (rightly) baffled at the fact that Python is substantially faster. This occurred most recently here: https://www.reddit.com/r/rust/comments/bl7j7j/hey_rustaceans_got_an_easy_question_ask_here/emx3bhm/

The reason why this happens is because `io::Stdout` unconditionally uses line buffering, regardless of whether it's being used interactively (e.g., printing to a console or a tty) or whether it's printing to a file. So if you print a lot of lines, you end up calling the `write` syscall for every line, which is quite expensive. In contrast, Python uses line buffering when printing interactively, and standard block bufferring otherwise. You can see more details on this [here](https://github.com/python/cpython/blob/6daaf3f7de78eec2c80eaa8e94e4cca54f758a30/Modules/_io/_iomodule.c#L163-L173) and [here](https://docs.python.org/3/library/sys.html#sys.stdout).

In my opinion, Rust should adopt the same policy as Python. Indeed, there is even a FIXME item for this in the code:

https://github.com/rust-lang/rust/blob/ef01f29964df207f181bd5bcf236e41372a17273/src/libstd/io/stdio.rs#L401-L404

I think this would potentially solve a fairly large stumbling block that folks run into. The CLI working group [even calls it out as a performance footgun](https://rust-lang-nursery.github.io/cli-wg/tutorial/output.html#a-note-on-printing-performance). And also [here](https://github.com/rust-lang-nursery/cli-wg/issues/29) too. Additionally, [ripgrep rolls its own handling for this](https://docs.rs/grep-cli/0.1.2/grep_cli/fn.stdout.html).

I can't think of too many appreciable downsides to doing this. It is a change in behavior. For example, if you wrote a Rust program today that printed to `io::Stdout`, and the user redirected the output to a file, then the user could (for example) `tail` that output and see it updated as each line was printed. If we made `io::Stdout` use block buffering when printing to a file like this, then that behavior would change. (This is the reasoning for flags like `--line-buffered` on `grep`.)

cc @rust-lang/libs
Repository: PowerToys
Issue: Manage FileMgr view defaults by folder, file type, etc. and prevent re-set w/o permission.
Labels: Idea-New PowerToy
Repository: flutter
Issue: [in_app_purchase] buying methods should return Future
Labels: p: in_app_purchase,package,team-ecosystem,P3,triaged-ecosystem

Currently, you have to subscribe to a `Stream` of purchases, however, in my conception, `Stream`s are preferable when you are supposed to receive lots of responses that update the screen accordingly and do not block user experience. In this case, you are making a request and the user is supposed to continue to use the app only when the response arrives.

IAPs are pretty simple and straightforward, I cannot see the need to separate the request and response, unless the developers had no other option, which I think is not the case, since other similar plugins do use `Future`s.

Perhaps the `Stream` should be kept for when users make a purchase within the store itself, as @adriancmurray said.

This discussion started here: #9591
Repository: TypeScript
Issue: Feature: Analyze @throws tags
Labels: Suggestion,Awaiting More Feedback

### Description

Given a function has a `@throws` JSDoc tag, it would be helpful to apply some analysis and raise a compiler warning (or, if configured, an error) when the caller does not handle the error **and** it doesn't declare its own `@throws` tag.

### Examples

```typescript
/**
 * @throws {SomeException}
 */
function myFunction() {
  // some logic
  // then for some reason we throw an exception
  if (somethingWentWrong) {
    throw new SomeException("something happened");
  }
  // some more logic
}

function potentialMess() {
  myFunction(); // Compiler error: 'myFunction' may throw `SomeException`. ts(9876)
}

/**
 * @throws {SomeException}
 */
function letItBubble() {
  myFunction(); // No compiler errors
}

function aFunctionThatHandlesTheException() {
  try {
    myFunction(); // No compiler errors
  }
  catch (error) {
    // do something with the error
  }
}
```

### Questions

- Ideally, it would be even better if VSCode realizes that `myFunction` throws an error, and then `@throws` is not required for the analysis. Still, this approach would be useful when dealing with external code/interfaces.

- It is my understanding that JSDoc's `@throws` is allowed once -- if this is correct, then VSCode could ignore this and accept multiple tags anyway? Otherwise, maybe we can use a different tag, e.g. `@exception`?
Repository: rust
Issue: Clippy attributes have no effect on struct fields
Labels: A-attributes,A-lints,T-compiler,C-bug

Example:

```use failure::Error;

struct MyTest {
    a: &'static [u64],
}

fn main() -> Result<(), Error> {
    let b = MyTest {
        #[allow(clippy::unreadable_literal)]
        a: &[1234567890],
    };

    Ok(())
}
```

The #[allow] directive must be placed on the variable assignment to have an effect - where it is now does not seem to cover the field value.

Searched a little bit, but wasn't sure if this goes with any existing issues (not sure if this would be #53012 since I don't think clippy attributes are procedural)
Repository: go
Issue: cmd/go: concurrent build and cache clean is unsafe
Labels: NeedsInvestigation,GoCommand

Migrated from discussion in https://github.com/golang/go/issues/31931.

If you start a build with `go build`, and run `go cache -clean` while it is building, the build can fail, because intermediate artifacts get deleted.

A sample failure looks like:

```
# os/exec
../os/exec/exec.go:24:2: can't open import: "bytes": open /Users/josh/Library/Caches/go-build/85/852a5f87d98090fa893dcf8b168751b8a141cb0f4087b4951cfd9fc5edebe252-d: no such file or directory
```

@jayconrod wrote:

> What should go clean -cache do with concurrent builds?
> * We could have a "clean" lock that would block `go build` and other commands until `go clean -cache` finishes.
> * `go clean -cache` could leave files created after it started. This might be hard to do reliably and portably though.

@bcmills wrote:

> I think that locking scheme is possible to implement using the existing `cmd/go/internal/lockedfile` API.
>
> `go build` would obtain a read-lock on the file (`os.O_CREATE|os.O_RDONLY`)
> `go clean` would obtain a write-lock on the file (`os.O_CREATE|os.O_WRONLY`)
>
> We don't currently rely on file-locking for the cache, but since this would only prevent a `build` / `clean` race perhaps it's not so bad.

I am not sure that @jayconrod's second option would work: I believe the problem is that the clean deletes files previously created by this build, which the build is still relying on.

@jayconrod's first option would work as long as `go clean -cache` is also blocked until `go build` is done. This makes it look a lot like a RW lock, as @bcmills notes. The only remaining danger is starvation of the clean. (That could actually happen in my particular, unusual case, since I am running many concurrent builds, but that's probably not worth designing around.)
Repository: flutter
Issue: [Web] Empty white website in Chrome on GitPod
Labels: framework,platform-web,P3,team-web,triaged-web

I tried to make the Flutter for Web run in Gitpod. 
All seems to be working in Firefox and Safari (I'm on OSX) but in Chrome I don't anything in the opened website.

To reproduce start this Gitpod workspace in chrome (clicking the link):

https://gitpod.io/#https://github.com/svenefftinge/flutter_web
Repository: terminal
Issue: Need a way to have per-machine profiles in settings
Labels: Issue-Feature,Area-Settings,Product-Terminal

Settings roam, which is really cool! However, my machines don't all have the same configuration. For instance, my main dev machine has tooling installed on the `O:` drive. My default profile runs the VS command prompt batch file. Well, I just dropped terminal on a second machine that doesn't have the same hardware config, so this default profile is totally busted there. Thankfully I'm launching with `cmd /k o:\...foo.cmd`, so I just get a slightly annoying error from CMD.

However, we'll need a way to have some way of differentiating config. As an idea, in other tools (e.g. emacs), it's not uncommon to key off of machine name to vary configuration.

=========

After a brief discussion in triage, we realize that there's going to need to be a thorough design of how we want per-machine settings to be done here. 

The initial design of settings is "simple" in that all settings applied in an unfiltered fashion and there's only 1 file and we have no "settings UI yet".

There's advantages to no settings UI.
There's advantages to having only one settings file.
There's advantages to being able to layer multiple settings files.
And so on and so forth.

Therefore, it's a feature that someone needs to sit down and spec at a future date.
Repository: terminal
Issue: Feature Request: /help commands output to collapsible pane
Labels: Issue-Feature,Area-UserInterface,Area-Extensibility,Product-Terminal

When using command line tools, I often have to continuously repeat typing command /help to remind myself what I can do with the app.

If there was a way to output the text displayed when typing /help to a collapse box on the screen, I could then expand it to find a command, without having to keep either scrolling, or re-running the command
Repository: TypeScript
Issue: [feature request] destructured type assignment
Labels: Suggestion,Awaiting More Feedback

<!-- 🚨 STOP 🚨 𝗦𝗧𝗢𝗣 🚨 𝑺𝑻𝑶𝑷 🚨

Half of all issues filed here are duplicates, answered in the FAQ, or not appropriate for the bug tracker. Please read the FAQ first, especially the "Common Feature Requests" section.

-->

## Search Terms

typescript destructuring types

## Suggestion

We can currently do:

```ts
type Lane = import('../Lane').Lane
```

But it would be nifty to be able to do:

```ts
type {Lane} = import('../Lane')
```

And taking it further, grab more things at once:


```ts
type {Lane, LaneColor, LaneSize} = import('../Lane')
```

instead of having to write

```ts
type Lane = import('../Lane').Lane
type LaneColor = import('../Lane').LaneColor
type LaneSize = import('../Lane').LaneSize
```

## Use Cases

convenience

## Examples

see above
## 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: Types made public via associated types are not documented
Labels: T-rustdoc,C-bug,A-reachable-priv

Given following code:

```
mod raspberry {
    pub struct Banana;
}

pub struct Peach;

pub trait Apple {
    type Juice;
}

impl Apple for Peach {
    type Juice = raspberry::Banana;
}
```

The generated documentation will not include documentation for `<Peach as Apple>::Juice`.

![Screenshot_2019-05-10 lib Peach - Rust](https://user-images.githubusercontent.com/679122/57492050-01c19400-72c8-11e9-9a57-0392a8016a44.png)
Repository: terminal
Issue: GSync/Freesync refresh rate / FPS drops when using Terminal
Labels: Help Wanted,Area-Rendering,Issue-Bug,Product-Terminal,Priority-2

My main monitor is 144Hz. An easy way of seeing the current FPS is wiggling the mouse - the movement in 144 FPS is much smoother than 60 FPS, and this is **very** noticeable.

While using Terminal, the FPS constantly drops, and moves between low FPS and full 144 FPS. I can't tell if it drops to 60 FPS or a different amount, but it's way lower than 144 FPS. Wiggling the cursor while typing shows this problem well.

It seems like every interaction with the Terminal can cause the FPS to "flip" between low and high: Focusing on the window, typing, etc. Sometimes waiting ~3 seconds is enough for the FPS to switch back to high.

Graphics card is an `Nvidia GTX 1080 Ti` and monitor is an `Asus PG279Q`.

```
C:\WINDOWS\system32>ver

Microsoft Windows [Version 10.0.18362.86]
```
Repository: pytorch
Issue: TensorIterator resizes output to a scalar if there are no inputs
Labels: module: internals,triaged

## 🐛 Bug

In master e47b210 -- May 9, 2019

When TensorIterator is built with only a single output (and no inputs) it resizes the output to a scalar (0-dim).  The problem lies in `compute_shape`. If there are no inputs (and `resize_outputs_` is the default value of `true`) then `shape_` remains empty.

This bug is not user visible. There's no code currently that triggers it, but it makes it harder to write operators using TensorIterator.

https://github.com/pytorch/pytorch/blob/e47b21007511e3e427ffc25ac6fca339bd7953a6/aten/src/ATen/native/TensorIterator.cpp#L516-L552

Discovered by @syed-ahmed in https://github.com/pytorch/pytorch/pull/20292#discussion_r282686933
Repository: pytorch
Issue: torch.distributions.Binomial.sample() uses a massive amount of memory
Labels: module: distributions,module: memory usage,triaged

## 🐛 Bug

I'd like to use a random sampling process as part of my training (related to work in [this paper](https://arxiv.org/abs/1901.11365)). In my case this entails taking a binomial sample every epoch from the raw data, and using that sample to train. The dataset itself is small enough to fit into GPU memory (~8000 samples by 7000 features). Unfortunately, the binomial sample method contains [this](https://github.com/pytorch/pytorch/blob/master/torch/distributions/binomial.py#L97-L99):

```python
max_count = max(int(self.total_count.max()), 1)
shape = self._extended_shape(sample_shape) + (max_count,)
bernoullis = torch.bernoulli(self.probs.unsqueeze(-1).expand(shape))
```

Which, for my data, means that it tries to allocate a >600GB matrix to take a sample from a 240MB matrix. This is not ideal, to say the least. I guess no one has tried to sample a binomial distribution of this size before?

## To Reproduce

Steps to reproduce the behavior:

1. Create a binomial distribution with a big max count, e.g. `b = torch.distributions.binomial.Binomial(max_count=2000, probs=0.5)`
1. Try to take a big sample: `b.sample(sample_shape=torch.Size(10000, 10000)`
1. Laugh when pytorch tells you to buy 745GB of RAM just so you can perform this operation

## Expected behavior

The numpy version, on the same machine:

```
%timeit b = np.random.binomial(2000, 0.5, size=(10000, 10000))
11.4 s ± 60.3 ms per loop (mean ± std. dev. of 7 runs, 1 loop each)
```

## Environment

 - PyTorch Version (e.g., 1.0): 1.0.1.post2
 - OS (e.g., Linux): Ubuntu16 via Docker container
 - How you installed PyTorch (`conda`, `pip`, source): `conda install pytorch -c torch`
 - Build command you used (if compiling from source): N/A
 - Python version: 3.7
 - CUDA/cuDNN version: 9.0
 - GPU models and configuration: running on an NVIDIA Titan XP with 12GB of RAM
 - Any other relevant information: N/A?
Repository: vscode
Issue: Cannot set embedded language indentation rules
Labels: feature-request,languages-basic

Related: https://github.com/vuejs/vetur/issues/534

Vetur extension defines two languages: `vue` and `vue-html`.

I can only use `languages.setLanguageConfiguration` to set indentation rule of the outer language `vue` but not the embedded `vue-html`.

With this API call, here's what I see:

```ts
export function registerLanguageConfigurations() {
  // languages.setLanguageConfiguration('vue', {
  //   indentationRules: {
  // 		increaseIndentPattern: /<(?!\?|(?:area|base|br|col|frame|hr|html|img|input|link|meta|param)\b|[^>]*\/>)([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*<\/\1>)|<!--(?!.*-->)|\{[^}"']*$/,
  // 		decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/
  //   },
  // });
  languages.setLanguageConfiguration('vue-html', {
    indentationRules: {
      increaseIndentPattern: /<(?!\?|(?:area|base|br|col|frame|hr|html|img|input|link|meta|param)\b|[^>]*\/>)([-_\.A-Za-z0-9]+)(?=\s|>)\b[^>]*>(?!.*<\/\1>)|<!--(?!.*-->)|\{[^}"']*$/,
      decreaseIndentPattern: /^\s*(<\/(?!html)[-_\.A-Za-z0-9]+\b[^>]*>|-->|\})/
    }
  });
}
```

![bug](https://user-images.githubusercontent.com/4033249/57496844-e899f280-7289-11e9-94d0-7145034d56ca.gif)

If I remove the commented-out call to set `indentationRules` of `vue` language, then it seems to work. However, I'm worried it'll affect other non `vue-html` regions such as css/javascript.

You can repro by:

- Checking out this branch of Vetur: https://github.com/vuejs/vetur/tree/embedded-indentation-rules
- Compile with

  ```bash
  yarn
  cd server && yarn && cd ..
  yarn compile
  ```
- Run the `client` debug config to test it

In short:
- In `vue-html` embedded in `vue`, I would expect setting `vue-html`'s indentation rules would affect move line up/down
- I have to set both indentation rules for `vue` and `vue-html` to achieve this, which would have some side effect
Repository: node
Issue: Inspector segmentation fault
Labels: confirmed-bug,inspector

* **Version**: 12.2.0
* **Platform**: Windows 10, Linux Ubuntu 18.0, Mac HighSierra
* **Subsystem**: inspector

Accessing `this` in static class field initialization context in some conditions crashes the process. This seems to be related both to Node.js inspector and Chrome devtool inspector.

Here is an automated repro:

```js
'use strict';

~class{a(){}};
debugger;
class A{static a = this};
if(process.argv.includes('test')) return;

const cp = require('child_process');
const proc1 = cp.spawn(process.execPath, ['--inspect-brk', __filename, 'test']);
const proc2 = cp.spawn(process.execPath, ['inspect', '-p', proc1.pid]);

proc1.on('exit', (code, signal) => {
  if(code) console.log('Exit code: ' + code.toString(16).toUpperCase());
  if(signal) console.log('Exit signal: ' + signal);
});

setTimeout(() => proc2.stdin.write('c\n'), 1000);
setTimeout(() => proc2.stdin.write('s\n'), 1100);
setTimeout(() => proc2.stdin.write('repl\n'), 1200);
setTimeout(() => proc2.stdin.write('this\n'), 1300);
```

Save as `main.js`, then run `node main.js`
Output:

```
Exit code: C0000005   // On Windows
Exit signal: SIGSEGV  // On Linux and Mac
```
Repository: PowerToys
Issue: Disable focus stealing
Labels: Idea-New PowerToy

The old TweakUI had an option to disable focus stealing. I am a real power user: while launching several apps I am writing emails, notes, documents and so on. But when another app has been finished the startup it steals the focus. Other times this happens when an app shows a pop-up.

Pls bring back an option to disable focus stealing
Repository: go
Issue: encoding/asn1: unmarshal of Context Specific into slice of RawValue
Labels: NeedsInvestigation

<!-- Please answer these questions before submitting your issue. Thanks! -->

### What version of Go are you using (`go version`)?

<pre>
go version go1.12.5 windows/amd64
</pre>

### Does this issue reproduce with the latest release?

My Go version is the latest version.

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
set GOARCH=amd64
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows

</pre></details>

### What did you do?

I tried to ASN.1 unmarshal `UnauthenticatedAttributes` of a PKCS #7 `SignedData`. But the Unmarshal() does not properly unmarshal (only two of the total of three are unmarshalled) and returns the rest as a return value.  However, other asn1 editor or viewers or OpenSSL properly unmarshal and show the result. 

My code is available at https://play.golang.org/p/2W2xBUjbpqO

### What did you expect to see?
The ASN1 editor shows like the following pics. 
https://imgur.com/vfiSt3Q
https://imgur.com/OhjLlsY


### What did you see instead?
They are not properly unmarshalled.
Repository: PowerToys
Issue: Network Kill-Switch
Labels: Idea-New PowerToy

As addition to the WLAN and Airplane toggle in the sidebar: A Kill-Switch for all Network-Connections for Internet, WAN and LAN (Ethernet, WLAN, Mobile/LTE/UMTS,...)
Repository: godot
Issue: Octant physics negatively impact GridMap performance
Labels: bug,discussion,confirmed,topic:physics,topic:3d,performance

**Godot version:** 3.1.1 mono (64 bit)
<!-- Specify commit hash if non-official. -->


**Issue description:**
When using the gridmap to render thousands of cells (100.000 cells, 100 different more complex meshes), the framerate drops significantly.
After some investigation, I found out that this is caused by the physics tick. We confirmed this hypothesis by disabling all collision layers.

Additionally, the more cells are filled, the slower it gets to change cells. When we increased the octant size, this had a positive effect on this issue.

Is it possible to disable the physics altogether? Or providing a way to access those physics objects by making octants available through the gridmap?

If not, is there a reason why it is implemented as such? Would there be a problem if we attempted to fix this issue (no C++ experts here though :) )?

**Steps to reproduce:**
Create a gridmap and fill 100.000 cells with around 20 different meshes -a little more complex than a cube-. This should drop the framerate significantly.
When disabling the collision layers, it should be back to normal.

The game will also take a lot longer when changing a cell on a gridmap with 100.000 filled cells than with a gridmap of 1.000.

Example of the meshes used:
![](https://i.gyazo.com/bc0e798bcf311ddc1bb21efc1c4f64ea.png)
Repository: pytorch
Issue: [feature request] Run examples from docs as tests
Labels: module: docs,feature,triaged

Quite a few times (e.g. https://github.com/pytorch/pytorch/issues/20301) some examples from docs became obsolete and ran unnoticed.

Proposal: ability to mark some examples in docs as tests and run them on CI and check execution for errors, warnings etc.
Repository: pytorch
Issue: Define portable M_PI replacement, use it instead of non-standard M_PI in math.h
Labels: module: internals,triaged

A common mistake is to use `M_PI` from `<math.h>` which is not portable on Windows. Standard workaround is to `#define _USE_MATH_DEFINES` before including the header. We should have a shim header that handles this for you, and then add a lint rule to forbid direct inclusion of `math.h`. Alternately, if only uses of `M_PI` are in cpp files, we can just add `-D_USE_MATH_DEFINES` to our Windows compiler flags (this approach is not permissible if they occur in `M_PI`

Recent occurrence: https://github.com/pytorch/pytorch/pull/19316
Repository: terminal
Issue: CMD does not show Unix LF when pasting
Labels: Product-Conhost,Area-Interaction,Issue-Bug,Priority-2

* Build 18890 (18894 on the way...)
* What doing: Create a file with **Unix (LF) line endings**. For example,

```cmd
echo foo
echo bar
```
Paste it in CMD window. The output is `fooecho bar`. The output should be in separate lines. Try the same in mintty. It shows correct output.