sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: node
Issue: setTimeout Calling Callback Too Early
Labels: help wanted,timers

* **Version**: v8.15.1
* **Platform**: Darwin Charlies-MacBook-Pro.local 18.2.0 Darwin Kernel Version 18.2.0: Thu Dec 20 20:46:53 PST 2018; root:xnu-4903.241.1~1/RELEASE_X86_64 x86_64

---

I have the following code in Node.js.

```js
const timeout = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
```

I'm trying to test this code with the following test:

```js
it("Should wait for given time before resolving", async () => {
    const MS = 100;
    const start = process.hrtime();

    await timeout(MS);

    const diff = process.hrtime(start);
    expect(((diff[0] * NS_PER_SEC) + diff[1]) / 1000000).to.at.least(MS);
});
```

The problem is sometimes (rarely), this test fails:


    Should wait for given time before resolving:

      AssertionError: expected 99.595337 to be at least 100
      + expected - actual

      -99.595337
      +100

Obviously this is some type of timing issue with Node.js or something. If anything I expect `await timeout(MS);` to take slightly longer than `MS`. In no case do I expect it to take less time.

What is it about the internals of JavaScript/Node.js that causes this to happen?

This occurred on macOS 10.14.3 running Node.js version 8.15.1.
Repository: TypeScript
Issue: Type aliases not being resolved for some functions types
Labels: Suggestion,Awaiting More Feedback

**TypeScript Version:**  3.4.0-dev.20190310

**Search Terms:**

Resolve / flatten / simplify type aliases for function calls

resolve type aliases

**Code**

```ts
let subject = {a:1,b:2,c:3,d:4}

type thisResolves = Pick<typeof subject, 'a' | 'b'>

let thisDoesnt = pick(subject, ['a', 'b'])

declare function pick<T, K extends keyof T>(obj: T, keys: K[]): Pick<T,K>
```

**Expected behavior:**

The Quick Info type of `thisDoesnt` resolves to `{ a: number, b: number}`

**Actual behavior:**

The Quick Info type of `thisDoesnt` resolves to `Pick<{ a: number, b: number, c: number, d: number}, 'a' | 'b'>`

**Playground Link:** [here](https://www.typescriptlang.org/play/index.html#src=let%20subject%20%3D%20%7Ba%3A1%2Cb%3A2%2Cc%3A3%2Cd%3A4%7D%0D%0A%0D%0Atype%20thisResolves%20%3D%20Pick%3Ctypeof%20subject%2C%20'a'%20%7C%20'b'%3E%0D%0A%0D%0Alet%20thisDoesnt%20%3D%20pick(subject%2C%20%5B'a'%2C%20'b'%5D)%0D%0A%0D%0Adeclare%20function%20pick%3CT%2C%20K%20extends%20keyof%20T%3E(obj%3A%20T%2C%20keys%3A%20K%5B%5D)%3A%20Pick%3CT%2C%20K%3E%0D%0A)

**Related Issues:**

I've seen in other issues that type aliases are eagerly resolved (e.g. https://github.com/Microsoft/TypeScript/issues/13095#issuecomment-268627521 and https://github.com/Microsoft/TypeScript/issues/16798#issuecomment-324753135). This is a case where that behavior is useful, since reading through a lot of `Pick<Foo<Bar<...` in VS Code makes it difficult to figure out the true source of a type error.
Repository: rust
Issue: Generator size: borrowed variables are assumed live across following yield points
Labels: C-enhancement,T-compiler,A-coroutines,I-heavy,A-async-await,AsyncAwait-Triaged,C-optimization

Maybe a duplicate of #52924, but maybe also something else.

I observed that the sizes of `Future`s generated by async fns can grow exponentially.
The following code shows an async fn, which produces a 1kB future. Each layering in another async fn doubles it's size:

```rust
#![feature(async_await)]

async fn i_am_1kb() -> bool
{
    let x: [u8; 1*1024] = [0; 1*1024];
    async{}.await;
    let _sum: u8 = x.iter().sum();
    true
}

fn main() {
    let fut1 = i_am_1kb();
    dbg!(std::mem::size_of_val(&fut1));

    let composed_1 = async {
        let inner = i_am_1kb();
        inner.await;
    };
    dbg!(std::mem::size_of_val(&composed_1));

    let composed_2 = async {
        let inner = i_am_1kb();
        dbg!(std::mem::size_of_val(&inner));
        inner.await;
    };
    dbg!(std::mem::size_of_val(&composed_2));

    let composed_3 = async {
        let inner = async {
            let inner = async {
                i_am_1kb().await;
            };
            dbg!(std::mem::size_of_val(&inner));
            inner.await;
        };
        dbg!(std::mem::size_of_val(&inner));
        inner.await;
    };
    dbg!(std::mem::size_of_val(&composed_3));
}
```

Output:
```
[src/main.rs:16] std::mem::size_of_val(&fut1) = 1032
[src/main.rs:22] std::mem::size_of_val(&composed_1) = 1036
[src/main.rs:29] std::mem::size_of_val(&composed_2) = 2072
[src/main.rs:44] std::mem::size_of_val(&composed_3) = 4168
```

It doesn't matter whether the statement between the future generation and `await!` references the future or not. A simply `println("")` will have the same effect.
Only if the future is directly awaited (as in `composed_1`) the size will stay constant.

cc @cramertj , @nikomatsakis , @Nemo157
Repository: godot
Issue: ARVR image shakes when Multithreaded and ARVROrigin is attached to RigidBody
Labels: bug,topic:physics,topic:xr

**Godot version:**
Godot 3.1RC1

**OS/device including version:**
Windows 10, NVIDIA GT610

**Issue description:**
If Thread Model "Multithreaded" is selected and the ARVR Origin is attached to a RigidBody/VehicleBody then this Body shakes back and forth in the left or right view. (Doesn't matter if GLES2 or GLES3.)

![Imgur](https://i.imgur.com/N18P3ym.gif)

**Steps to reproduce:**
Attach a ARVROrigin and ARVRCamera to a RigidBody/Vehicle Body.
Enable ThreadModel "Multithreading".
Run the project and move the RigidBody.

**Minimal reproduction project:**
You need NO VR Gear to test this:
Attached is the Trucktown demo which is just modified to enable the ARVR view.
--> Select the "Mini Van". Move the truck with cursor keys.
[truck_town_vr.zip](https://github.com/godotengine/godot/files/2951145/truck_town_vr.zip)
Repository: You-Dont-Know-JS
Issue: Proposal: add a paragraph about WebAssembly
Labels: for second edition

Even though WebAssembly is not tightly bound to JS, it can relief its performance in any environment that has a JS engine (among others).  

So: would it make sense to include a mention of WebAssembly? Especially since there's already a paragraph on asm.js, one of Wasm's "ancestors".

Chapter 5 of Async & Performance might be the right place (the asm.js paragraph is also in there):  
https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch5.md 

What do you think?
Repository: godot
Issue: Texture loading/exporting bug when overriding driver_name for mobile
Labels: enhancement,topic:editor

**Godot version:**
3.1 RC1

**Issue description:**
I have a game that is supposed to use GLES3 by default, but GLES2 for mobile. So I override the renderer_name option in the project settings, for mobile, while the default remains GLES3.
When I do that, the exported build crashes immediately - the debug output shows that it fails to load ETC textures. If I switch the default renderer to GLES2, I don't get these error messages and the game launches (but it crashes later for a different reason, see #26902)

So I assume that if you override the renderer for mobile and set it to GLES2, the game is still exported as if it was a GLES3 game, so the engine doesn't find the correct texture files. But if the GLES2 is the project default, the textures are exported correctly. I guess that setting fallback_to_gles2 would fix it, but there's no point in exporting both ETC and ETC2 textures if I want to force GLES2 on mobile devices.

**Minimal reproduction project:**
Any demo that uses VRAM compression for some textures. Use GLES3 as default and override to GLES2 for mobile.
Repository: godot
Issue: Godot physics performance issue when colliding with a ConvexPolygonShape generated from a SphereMesh
Labels: bug,confirmed,topic:physics

**Godot version:**
3.1 RC2


**OS/device including version:**
Windows 10 64-bit, 
Intel I7 920 @ 2.67GHz, 2668 Mhz, 4 Cores, 8 Logical Processors,
NVIDIA GeForce GTX 750 Ti


**Issue description:**
When calling `KinematicBody::move_and_slide` multiple times per frame using Godot Physics and colliding with a vertical collision shape, frame rate plummets to almost 0. Bullet Physics works fine.


**Steps to reproduce:**
In the provided MRP, use WSAD to move the capsul over to the sphere and collide with it. Continuing to move around the sphere using Godot Physics causes the framerate to plummet. Switch to Bullet and do it again and you'll see it works fine.

**Minimal reproduction project:**
[PhysicsBug.zip](https://github.com/godotengine/godot/files/2951698/PhysicsBug.zip)
Repository: go
Issue: x/net/html/charset: BOM cannot be processed correctly
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 darwin/amd64

</pre>

### Does this issue reproduce with the latest release?



### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GOARCH="amd64"
GOBIN=""
GOCACHE="/Users/zsm/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/zsm/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.12/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.12/libexec/pkg/tool/darwin_amd64"
GCCGO="gccgo"
CC="clang"
CXX="clang++"
CGO_ENABLED="1"
GOMOD=""
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/6v/7stmg2756wlfk9c_qnv1hnbm0000gn/T/go-build194117381=/tmp/go-build -gno-record-gcc-switches -fno-common"
</pre></details>

### What did you do?

<!--
If possible, provide a recipe for reproducing the error.
A complete runnable program is good.
A link on play.golang.org is best.
-->

``` golang
package main

import (
	"bytes"
	"fmt"
	"io/ioutil"

	"golang.org/x/net/html/charset"
	"golang.org/x/text/encoding"
	"golang.org/x/text/transform"
)

func main() {
	raw := []byte("\xEF\xBB\xBFhello")
	fmt.Println(raw)
	if e, _, _ := charset.DetermineEncoding(raw, ""); e != encoding.Nop {
		tmp := transform.NewReader(bytes.NewBuffer(raw), e.NewDecoder())
		dist, _ := ioutil.ReadAll(tmp)
		fmt.Println(dist)
	}
}
```

### What did you expect to see?

BOM has been removed
or 
returns  encoding.Nop

### What did you see instead?

```
[239 187 191 104 101 108 108 111]
[239 187 191 104 101 108 108 111]
```
Repository: angular
Issue: Navigation with custom Animation and :Increment :decrement does not work as expected
Labels: type: bug/fix,area: animations,freq2: medium,state: needs more investigation,P3

# 🐞 bug report

### Description

We try to create a lazy loaded wizzard/stepper using router and custom navigation. We register a custom animation named **loginRouteSlideInAnimation** which has an `:increment` and `:decrement` transition

What we do, when we go to next page we would like to slide in new page from right and if we go to previous page we would like to slide in new page from right. We do this with this custom animation trigger

The strange thing is, if we run this locally with ng serve the navigation animation is not working as expected, go to NEXT page does not perform any animation until we go on a PREVIOUS page and also from the other side, on first PREVIOUS page does not perform any animation until we go on NEXT page.

What we can see `(query(':enter))` has no results in the situation where the animation is not working. But it should!

You can test the app on stackblitz, where the APP is working well. But please clone our repo and check it locally where it is not working as expected and like in the stackblitz.



## 🔬 Minimal Reproduction
<!--
Please create and share minimal reproduction of the issue starting with this template: https://stackblitz.com/fork/angular-issue-repro2
-->
https://stackblitz.com/github/mburger81/test-animation
https://github.com/mburger81/test-animation
<!--

## 🌍  Your Environment

**Angular Version:**
<pre><code>
Angular CLI: 7.3.5
Node: 10.15.2
OS: linux x64
Angular: 7.2.8
... animations, common, compiler, compiler-cli, core, forms
... language-service, platform-browser, platform-browser-dynamic
... router

Package                           Version
-----------------------------------------------------------
@angular-devkit/architect         0.13.5
@angular-devkit/build-angular     0.13.5
@angular-devkit/build-optimizer   0.13.5
@angular-devkit/build-webpack     0.13.5
@angular-devkit/core              7.3.5
@angular-devkit/schematics        7.3.5
@angular/cli                      7.3.5
@ngtools/webpack                  7.3.5
@schematics/angular               7.3.5
@schematics/update                0.13.5
rxjs                              6.3.3
typescript                        3.2.4
webpack                           4.29.0

</code></pre>
Repository: opencv
Issue: cv::findTransformECC produce CV_error() when cannot align images.
Labels: incomplete

Some times `findTransfromECC()` cannot align images.
I think that producing `CV_Error()` is not usable. So I just change `CV_Error` line to `return rho;` and checking in my code is return of `findTransformECC()` greater than zero to know that align complete successfully.

Is that change suitable. Would you accept my commit?
Repository: rust
Issue: rustc: remove unnecessary extern_prelude logic from ty::item_path
Labels: C-cleanup,T-compiler

From #56655 : 
> The checks added in 02357e4 effectively turned crate::std into std, but they were too general (affecting any crate::foo where foo was in the extern prelude, not just extern crates), and unnecessary, as only the extern crates created by "std injection" need any special-casing.
Since this only affects the user-facing "relative" mode, it shouldn't have interactions with linking, and the only observable effect should be sometimes-shorter paths in diagnostics.

Creating this issue as a tracking issue since the PR is closed due to inactivity.
Repository: rust
Issue: Highlight when errors have automatically applicable suggestions
Labels: C-enhancement,T-compiler,A-suggestion-diagnostics

With `tool_only_span_diagnostics` having landed, some suggestions that can be automatically applied aren't shown to the user as labels with `help: ...` messages, so users who look for that to know they can automatically apply the fix won't know about those suggestions. 

We should add some indicator that tells the user that an error can be automatically fixed.

See [this conversation](https://github.com/rust-lang/rust/pull/59084#discussion_r264273929).
Repository: godot
Issue: Crash after splashscreen on Android with GLES2 if default_env.tres is present [Samsung Galaxy S4]
Labels: bug,platform:android,topic:rendering,confirmed,crash

<!-- 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 non-official. -->
Tested on 3.1 RC1 and RC2

**OS/device including version:**
<!-- Specify GPU model and drivers if graphics-related. -->
Samsung "Galaxy S4" GT-I9505
Android 5.0.1
Exported on Ubuntu 18.04.1 LTS

**Issue description:**
<!-- What happened, and what was expected. -->
The error described in #26651 is occurring "again". The funny thing is, that it even occurs on Version RC1, even though I've tested it and used it for 2 days. It happened again after I reset my git-repo, to a commit that exported correctly yesterday.I don't know what caused this to happen, but the error remains the following:
If I try to export a very basic project with GLES2 for Android, the app crashes instantly after the splash screen. If I delete the file `default_env.tres`, the app launches normally. Tested on RC1 and RC2

**Steps to reproduce:**
as in #26651
1.) Create a new GLES2-Project
2.) Add and set main-scene
3.) Set export template and export for Android/One-Click-Deploy (with debug)
4.) Trying to launch app

**Minimal reproduction project:**
<!-- Recommended as it greatly speeds up debugging. Drag and drop a zip archive to upload it. -->
-> #26651
Repository: pytorch
Issue: Linking Caffe2 with sequential MKL but still calling multi-threaded mkl
Labels: caffe2

I turned off the openmp feature when building caffe2 and link caffe2 with the sequential version of mkl (libmkl_sequential.so). ldd caffe2.so also displays that caffe2 is linked with the sequential mkl (see first attached picture) . 
![1](https://user-images.githubusercontent.com/10581411/54141016-3a91d980-43fb-11e9-889a-0513214c8ed0.PNG)

But when I run caffe2 inference, it still calls the multi-threaded version of mkl (libmkl_intel_thread.so), the stack trace is displayed in the second picture as below.  How could I make the compiled caffe2 run sequential mkl for gemm? 
![image](https://user-images.githubusercontent.com/10581411/54141231-a8d69c00-43fb-11e9-8feb-9bba69b0cf15.png)
Repository: flutter
Issue: Initial routes with parameters
Labels: c: new feature,framework,f: material design,f: routes,P3,workaround available,team-design,triaged-design

It would be useful to be able to set the parameters of the initial routes, not just the names.
Something like:

```
MaterialApp(
    initialRoutes: [
        RouteSettings(name: "MainPage"),
        RouteSettings(name: "AlbumPage", arguments: albumId),
        RouteSettings(name: "SongPage", arguments: songId)
    ]
    ...
)
```
Repository: TypeScript
Issue: feature request: change indentation of multi-line variable declarations
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

format code indent tsserver
<!-- List of keywords you searched for before creating this issue. Write them down here so that others can find this suggestion more easily -->

## Suggestion

<!-- A summary of what you'd like to see added or changed -->
When `tsserver` formats the following typescript code using an indent size of 2, I get
```typescript
let a = 1,
  b = 2
```
while I'd expect it to indent the code like
```typescript
let a = 1,
    b = 2
```
regardless of the indent size.

Additionally, the following code would be formatted like
```typescript
const a = 1,
      b = 2
```

## Use Cases

This feature would be useful in variable declarations (`let`, `var`, `const`) when using an indent size different than 4.
<!--
What do you want to use this for?
What shortcomings exist with current approaches?
-->

## Examples

See the Suggestion section above.
<!-- Show how this would be used and what the behavior would be -->

## 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: TypeScript
Issue: Result of unknown indexing explicitly cast to `any` incorrectly reported as implicit any
Labels: Suggestion,In Discussion

<!-- Please try to reproduce the issue with `typescript@next`. It may have already been fixed. -->
**TypeScript Version:**  typescript@3.4.0-dev.20190311

<!-- Search terms you tried before logging this (so others can find this issue more easily) -->
**Search Terms:** "Element implicitly has an 'any' type" " index expression is not of type"

We are on the same page that an unknown/untyped indexing operation results in an `any` result. However, it seems that silence the error the object being indexed must be cast to `any`, it is insufficient to cast the result of the indexing itself to `any`.

**Code**

```ts
declare let foo: HTMLElement;

let a = (<any>foo.attributes)["bar"].value;

let x = foo.attributes["bar"].value;
let y = (<any>foo.attributes["bar"]).value;
let z = (foo.attributes["bar"] as any).value;
```

compiled with `tsc --strict ./test.ts`

**Expected behavior:**

* No error on `let a = ...` because type warnings on any operation on an explicitly `any` type (including indexing) are let through.
* An error is thrown on `let x = ...` because the element type resulting from the lookup is of unknown type.
* No error on `let y = ...`, not because the type is known but because I'm explicitly casting the `<any>` result to `any`.
* No error on `let z = ...`, not because the type is known but because I'm explicitly casting the `<any>` result to `any`.

**Actual behavior:**
```
test.ts:3:24 - error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.

3 let x = foo.attributes["bar"].value;
                         ~~~~~

test.ts:4:30 - error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.

4 let y = (<any>foo.attributes["bar"]).value;
                               ~~~~~

test.ts:5:25 - error TS7015: Element implicitly has an 'any' type because index expression is not of type 'number'.

5 let z = (foo.attributes["bar"] as any).value;
                          ~~~~~
```

I argue that both `(<any>foo)["bar"]` and `(<any> (foo["bar"]))` should not trigger this error.
Repository: pytorch
Issue: C++ nn::Sequential push_back() copies module if the module is concrete type
Labels: module: cpp,module: nn,triaged

## 🐛 Bug

In https://github.com/pytorch/pytorch/blob/3f1d0ee5d5f48bb0fbef433a61cef0be9ad40a76/test/cpp/api/sequential.cpp#L37-L48, if we delete the copy constructor of `M` by adding `M(const M&) = delete;`, this test will fail to compile, because in https://github.com/pytorch/pytorch/blob/3f1d0ee5d5f48bb0fbef433a61cef0be9ad40a76/torch/csrc/api/include/torch/nn/modules/sequential.h#L197-L203 the `push_back(std::make_shared<Type>(std::forward<M>(module)));` line actually copies the module and expects the copy constructor to exist. Since copying a concrete type module is expensive, we should fix it so that this copy can be avoided.

cc @yf225 @glaringlee @albanD @mruberry @jbschlosser @walterddr
Repository: godot
Issue: Slight delay when looping .ogg file
Labels: bug,topic:audio

**Godot version:**
3.1 RC2 (Also happening on 3.0.6)

**OS/device including version:**
Windows 8.1 Pro 64-bit and Windows 7 Pro 64-bit

**Issue description:**
When an ogg file loops, there is a slight delay before looping the sample back to the beginning.

**Steps to reproduce:**
Create a project with an empty node.  Add an AudioStreamPlayer to the node and load an ogg file.  Check auto-play and run the project.  This is more apparent with music that has a perfect loop from the end to beginning.

**Minimal reproduction project:**
In the provided project, the ogg sample should automatically play.  The ogg sample is 9 seconds long.
[OggMusicTest.zip](https://github.com/godotengine/godot/files/2954141/OggMusicTest.zip)
Repository: pytorch
Issue: Caffe2 building failure
Labels: caffe2

If I uninstall mkl-include in anaconda, this issue will disappear. But if caffe2 is compiled with mkl-include, it gives error as below. Error: "regexec" is not declared in this scope.

![image](https://user-images.githubusercontent.com/10581411/54159463-688b1400-4423-11e9-8cbf-5a8582f621bf.png)