sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: TypeScript
Issue: `references` are not inherited in `tsconfig.json`
Labels: Docs

**TypeScript Version:**  3.1.0-dev.20180914

**Search Terms:** tsconfig.json extends references inheritance

It seems that the `references` key is not inherited via the `extends` mechanism, which surprised me because the handbook [doesn't mention](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#configuration-inheritance-with-extends) anything special about it.

Demo:

`tsconfig.base.json`:

```json
{
  "references": [
    { "path": "./some/other/project" }
  ],
  "compilerOptions": {
    "declaration": true,
    "composite": true
  }
}
```

`tsconfig.doesnt-work.json`:

```json
{
  "extends": "./tsconfig.base.json"
}
```

Building `tsconfig.doesnt-work.json` doesn't build the reference:

```
$ tsc -b -f -d tsconfig.doesnt-work.json
[11:12:13] A non-dry build would build project 'C:/demo/tsconfig.doesnt-work.json'
```

`tsconfig.works-but-duplicates-references.json`:

```json
{
  "extends": "./tsconfig.base.json",
  "references": [
    { "path": "./some/other/project" }
  ],
}
```

This is a correct build but I had to duplicate the `references` key:

```
$ tsc -b -f -d tsconfig.works-but-duplicates-references.json
[11:12:13] A non-dry build would build project 'C:/demo/tsconfig.works-but-duplicates-references.json'
[11:12:13] A non-dry build would build project 'C:/demo/some/other/project/tsconfig.json'
```
Repository: go
Issue: x/mobile/cmd/gobind: non-pointer struct types not supported in parameter or return values
Labels: NeedsInvestigation,mobile

Please answer these questions before submitting your issue. Thanks!


### What version of Go are you using (`go version`)?

```
go version go1.11 darwin/amd64
```

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

```
GOARCH="amd64"
GOBIN="/Users/dradtke/Workspace/go/bin"
GOCACHE="/Users/dradtke/Library/Caches/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/dradtke/Workspace/go"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/Cellar/go/1.11/libexec"
GOTMPDIR=""
GOTOOLDIR="/usr/local/Cellar/go/1.11/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/w1/f3bh6jkx0vx95g4885d2yr5h3kfr1q/T/go-build388664200=/tmp/go-build -gno-record-gcc-switches -fno-common"
```

### What did you do?

I attempted to use the `gobind` tool to generate code for the following example package:


```go
package bindtest

type Param struct {
        Value string
}

func DoSomething(p Param) {
        // do something with param
}
```

### What did you expect to see?

I would expect to see the method `DoSomething` available in the generated code.

### What did you see instead?

The function gets skipped due to an invalid parameter type:

```bash
$ gobind -lang go bindtest | grep DoSomething
// skipped function DoSomething with unsupported parameter or result types
```

The binding works, however, if `DoSomething` is updated to take a pointer to `Param`.
Repository: TypeScript
Issue: Later export causes `'T' is referenced directly or indirectly in its own type annotation`
Labels: Bug,Domain: JSDoc,checkJs,Domain: JavaScript

**TypeScript Version:**  3.1.0-dev.20180914

**Code**

```js
/** @typedef {{}} T */

/** @type {T} */
const T = JSON.parse("");

export class C extends T {}
```

**Expected behavior:**

Same error as if the class isn't exported: `Type '{}' is not a constructor function type.` at the `extends` clause.

**Actual behavior:**

`src/a.js:4:7 - error TS2502: 'T' is referenced directly or indirectly in its own type annotation.`
Repository: go
Issue: runtime: cgo Unix C code can't modify environment variables for Go
Labels: Documentation,NeedsFix,compiler/runtime

### What version of Go are you using (`go version`)?
1.11

### Does this issue reproduce with the latest release?
Yes

### What operating system and processor architecture are you using (`go env`)?
linux amd64

### What did you do?
Because of envOnce and copyenv in [env_unix.go](https://golang.org/src/syscall/env_unix.go), linked non-Go programs can't set environment variables that are visible to Go code. 

This is probably WAI, but it's surprising when embedding and could use a mention somewhere.

```go
package main

/*
#include <stdlib.h>       // for setenv()
*/
import "C"

import (
	"fmt"
	"os"
)

func main() {
	os.Setenv("foo", "1")
	fmt.Println("before:", os.Getenv("foo"))
	C.setenv(C.CString("foo"), C.CString("2"), 1)
	fmt.Println("after:", os.Getenv("foo"))
	os.Setenv("foo", "3")
	fmt.Println("after Go:", os.Getenv("foo"))
}
```

### What did you see instead?
"1 1 3" instead of "1 2 3".
Repository: pytorch
Issue: Semaphore leaks in dataloader
Labels: module: dataloader,triaged

Reported by @PetrochukM.
```
import torch
from torch import multiprocessing

# DEPENDANCY: This is required for ``DistributedDataParallel``
# https://pytorch.org/docs/stable/nn.html?highlight=distributeddataparallel#torch.nn.parallel.DistributedDataParallel
try:
    multiprocessing.set_start_method('spawn')
except RuntimeError:
    pass

# DEPENDANCY: This is required for ``from tqdm import tqdm``
# https://github.com/tqdm/tqdm/blob/96d8a3c3642474144f53f74331ef2172d1c39496/tqdm/_tqdm.py#L74
mp_lock = multiprocessing.RLock()

import torch
from torch.utils.data import DataLoader

if __name__ == '__main__':
    data_iterator = torch.utils.data.DataLoader([torch.tensor(i) for i in range(10)], num_workers=4)
    for batch in data_iterator:
        pass
```

Example warning:
```
/usr/lib/python3.6/multiprocessing/semaphore_tracker.py:143: UserWarning: semaphore_tracker: There appear to be 1 leaked semaphores to clean up at shutdown
  len(cache))
```

cc @SsnL @VitalyFedyunin @ejguan
Repository: rust
Issue: NLL: Poor borrow checker error message when extension of borrow happens indirectly (e.g. via method)
Labels: C-enhancement,A-diagnostics,P-medium,A-borrow-checker,T-compiler,E-medium,A-NLL

**EDIT**: Go [here](https://github.com/rust-lang/rust/issues/54256#issuecomment-434450019) for a smaller example.

Code:

```rust
#![feature(nll)]

extern crate clang;

use std::collections::HashMap;
use std::error::Error;
use clang::*;

#[derive(Default)]
struct SymbolDesc<'a> {
    deps: Vec<Entity<'a>>,
}

fn visit<'a>(_entity: Entity<'a>, _desc: &mut SymbolDesc<'a>) {
    // snip
}

fn main() -> Result<(), Box<Error>> {
    let clang = Clang::new()?;

    let index = Index::new(&clang, false, false);
    let sources = vec!["examples/simple.c", "examples/simple_impl.c"];

    let mut tus = vec![];
    let mut sym_table: HashMap<String, SymbolDesc<'_>> = HashMap::new();

    for source in sources {
        tus.push(index.parser(source).parse()?);

        for child in tus.last().unwrap().get_entity().get_children() {
            if let Some(child_name) = child.get_name() {
                let desc = sym_table.entry(child_name).or_default();
                visit(child, desc);
            }
        }
    }

    Ok(())
}
```

Error:

```
error[E0502]: cannot borrow `tus` as mutable because it is also borrowed as immutable
  --> src/main.rs:28:9
   |
28 |         tus.push(index.parser(source).parse()?);
   |         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
29 | 
30 |         for child in tus.last().unwrap().get_entity().get_children() {
   |                      --- immutable borrow occurs here
31 |             if let Some(child_name) = child.get_name() {
32 |                 let desc = sym_table.entry(child_name).or_default();
   |                            --------- borrow used here in later iteration of loop
```

The crux of the problem is that at line `visit(child, desc)`, `table` starts borrowing `tu` because it has type `HashMap<String, SymbolDesc<'tu>>`. This prevents `tus.push(index.parser(source).parse()?)` because it needs a mutable borrow.

I wish the error message mentioned that `table` borrows `tu` because that's far from obvious. But once you see it, it's understandable why the borrow checker is not happy.
Repository: TypeScript
Issue: Only emit declarations for code that has an /** @external */ JSDoc annotation
Labels: Suggestion,Awaiting More Feedback

## Search Terms
external emit declaration

## Problem
When working with the `--stripInternal` compiler flag, you want to create a clean declaration file that only exposes the stuff your library users should use.
You as library developer must add  the `/* @internal */` annotations to all the parts of your code you don't want in the declaration file. 'Sloppy developers in the team' forget to set this annotation and expose stuff without realizing it.

## Suggestion
It would be handy if we could reverse this.
We could start with an empty declaration file when a compiler flag `--onlyExternal` is set and only expose the things that have an `/* @external */` JSDoc annotation

- `/* @external */` exposes the 'item' and the 'parent path' to acces it.
- `/* @internal */` used inside an `/* @external */` parent hides the 'item' and and all its children.
- `/* @external */` used inside an `/* @internal */` parent is ignored and stays internal.

## Remarks
- When using the `/* @internal */` annotation, you mostly try to place it on top level structures (like namespaces). In these cases it is not a problem when code is added to the namespace. It is mostly a problem when new files or namespaces are added.
- When using the suggested `/* @external */` annotation, you normally will place it more deeply, like on specific functions, variables or classes to expose.
Repository: godot
Issue: JavaClassWrapper.wrap() doesn't seem to work
Labels: bug,platform:android,topic:porting

Basically JavaClassWrapper.wrap() has never worked. But it is tempting for people trying to get access to Android Classes. I did manage to the the java classes from the function by returning the correct value a modification I made to Godot code. But even then, it seems that the class deletes too many references which makes the Java Class holo which is still useless.
I think it could work great as the kivy project has something similiar in [pyjinus](https://pyjnius.readthedocs.io/en/latest/).
I would like to get this to work, but I need help because I do not know C++ much at all. 

**Godot version:**
ALL


**OS/device including version:**
Android


**Issue description:**
JavaClassWrapper.wrap() returns [Object:null] 
After patch it returns [JavaClass] but it seems to be holo, no class methods or class variables.

[Some proof that JavaClassWrapper.wrap() is actually getting a class from the JNI](https://gist.github.com/FeralBytes/c3a76dec37208c41798136653c5530e8).
Repository: opencv
Issue: cv::imread() won't work with .jp2 files after GetOpenFileName() dialog
Labels: category: imgcodecs,incomplete

I've encountered this weird issue that I seem to be unable to solve, involving jpeg2000 file format and GetOpenFileName() dialog.

I've made a C++ program that asks for an image and then, later on, uses it as a texture, manipulates it etc. But here's the problem:

I ask for the path to the image file with OPENFILENAME and GetOpenFileName(). Here's an example code for this very basic format:

```
#include "pch.h"
#include <iostream>
#include <opencv2/opencv.hpp>
#include <Windows.h>


void SelectAndOpenImage()
{
    OPENFILENAME openFile;
    char filePath[MAX_PATH] = { 0 };

    ZeroMemory(&openFile, sizeof(OPENFILENAME));

    openFile.lStructSize = sizeof(OPENFILENAME);
    openFile.hwndOwner = NULL;
    openFile.lpstrFile = filePath;
    openFile.lpstrFile[0] = '\0';
    openFile.nMaxFile = MAX_PATH;
    openFile.lpstrFilter = "Jpeg2000 (*.jp2)\0*.jp2\0Bitmap (*.bmp)\0*.bmp\0Jpeg (*.jpg)\0*.jpg\0Png (*.png)\0*.png\0";
    openFile.nFilterIndex = 1;
    openFile.lpstrInitialDir = NULL;
    openFile.Flags = OFN_FILEMUSTEXIST | OFN_HIDEREADONLY | OFN_NOCHANGEDIR;

    if (GetOpenFileName(&openFile))
    {
        cv::Mat image = cv::imread(openFile.lpstrFile, CV_LOAD_IMAGE_COLOR);
        if (image.empty()) std::cout << "Empty" << std::endl;
        else
        {
            cv::imshow("testing", image);
            cv::waitKey(5000);
        }
    }
    else
    {
        std::cout << "Failure" << std::endl;
    }
}

int main()
{
    SelectAndOpenImage();
    return 0;
}
```

The problem is that:
- cv::imread() works correctly for every image file format except Jpeg2000, cv::imshow() shows just a black image (apparently, all data is full of zeros).
- Jpeg2000 works well along with the others if I do not use this GetOpenFileName() dialog at all (instead I just type the file path directly to the source code and call cv::imread() before GetOpenFileName()). 
- If I use the dialog but ignore the file selection and use my own hard coded file path instead, Jpeg2000 file format won't work then either, again just a blank black image. 
- All other image file formats work just fine, no matter how I do it.

I'm using OpenCV 3.4.2 Release, but tried the same thing with Debug version. With Debug, all the data is filled with 0xcd (205 as uchar), resulting in a nice gray blank image (obviously not what I was looking for).

I'm currently using Windows10 and Visual Studio 2017 version 15.8.2 (MSVC++ 14.15). I built OpenCV as static libs.

Any ideas what could be causing this? Later on, I'll be moving away from always-so-problematic GetOpenFileName(), but before that, I'd like to see this thing work.
Repository: opencv
Issue: How to modify the camera setting to support more than 8 usb cameras ?
Labels: priority: low,category: videoio(camera)

Hi:
    I try to use 16 cameras for a object tracking task. I used to use the opencv version 2.4.11, which only need to modify the code in module/highgui/src [https://github.com/opencv/opencv/blob/2.4/modules/highgui/src/cap_libv4l.cpp#L260] [https://github.com/opencv/opencv/blob/2.4/modules/highgui/src/cap_v4l.cpp#L249](url). For the opencv version 2.4.13 and 3.4.3 looks like this setting can't work now. Is there anyone have some idea to solve this?
Repository: rust
Issue: Tracking issue for `slice::partition_dedup/by/by_key`
Labels: T-libs-api,B-unstable,C-tracking-issue,A-slice,Libs-Tracked,Libs-Small

Add three methods to the `slice` type, the `partition_dedup`, `partition_dedup_by` and `partition_dedup_by_key`. The two other methods are based on `slice::partition_dedup_by`.

### Steps / History
- [x] Implement the feature as a PR (#54058)
- [ ]  Stabilization PR ([see instructions on forge](https://forge.rust-lang.org/stabilization-guide.html))

### Unresolved Questions
- [ ] Should the methods only return one slice instead of a tuple with two slices? ([comment](https://github.com/rust-lang/rust/issues/54279#issuecomment-572494868))
- [ ] Annotate it with `#[must_use]`?
- [ ] https://github.com/rust-lang/rust/issues/34162
Repository: rust
Issue: Only first cap-lints argument is used
Labels: A-frontend,A-lints,T-compiler,C-bug,A-CLI

`rustc --cap-lints=warn --cap-lints=foo` should give an error on the invalid "foo" passed, but currently this does nothing.

It is not completely clear what exact behavior we want on `--cap-lints=allow --cap-lints=forbid` for example, though.

Currently this means that there's no way to override Cargo's default behavior on dependencies via RUSTFLAGS, for example.
Repository: opencv
Issue: Opencv failed to run 17 tests with release configuration and debug configuration
Labels: priority: low,category: calib3d,platform: win32

Environment:
 Windows Server 2016 + VS2017 Update 5 + opencv master branch latest srouce code

Opencv failed to run 17 tests with release configuration and debug configuration. Could you please help take a look at this? Thanks in advance!

Steps to reproduce the behavior:
 1.git clone https://github.com/opencv/opencv D:\OpenCV\src
 2.git clone https://github.com/opencv/opencv_extra D:\OpenCV\src\extra
 3.Open a VS 2017 x86 prompt and browse to D:\OpenCV
 4.mkdir build_x86 && pushd build_x86
 5.cmake -G "Visual Studio 15 2017" -DCMAKE_SYSTEM_VERSION=10.0.17134.0 -DWITH_IPP=ON -DBUILD_SHARED_LIBS=OFF -DBUILD_PERF_TESTS=ON -DBUILD_TESTS=ON -DBUILD_EXAMPLES=ON -DWITH_OPENCL=OFF -DBUILD_DOCS=OFF -DWITH_CUDA=OFF ..\src
 6.msbuild /p:Configuration=Release;Platform=Win32 .\OpenCV.sln /t:Rebuild /m /p:BuildInParallel=true
 7.pushd build_x86\bin\Release
 8. opencv_test_calib3d.exe --gtest_filter=-fisheyeTest.rectify:Calib3d_StereoSGBM_HH4.regression:Calib3d_StereoBM.regression:Calib3d_StereoSGBM.regression

Note:
OPENCV_TEST_DATA_PATH env variable has been set and point to <opencv_extra>/testdata.

The whole log file please see attachment.
[log_x86_test_13.log](https://github.com/opencv/opencv/files/2387457/log_x86_test_13.log)

TestErrorMessage:
[----------] Global test environment tear-down
[==========] 82 tests from 44 test cases ran. (241581 ms total)
[  PASSED  ] 65 tests.
[  FAILED  ] 17 tests, listed below:
[  FAILED  ] Calib3d_CalibrateCamera_C.regression
[  FAILED  ] Calib3d_CalibrateCamera_CPP.regression
[  FAILED  ] Calib3d_StereoCalibrate_C.regression
[  FAILED  ] Calib3d_StereoCalibrate_CPP.regression
[  FAILED  ] Calib3d_ChessboardDetector.accuracy
[  FAILED  ] Calib3d_ChessboardDetector.timing
[  FAILED  ] Calib3d_ChessboardDetector2.accuracy
[  FAILED  ] Calib3d_CirclesPatternDetector.accuracy
[  FAILED  ] Calib3d_AsymmetricCirclesPatternDetector.accuracy
[  FAILED  ] Calib3d_AsymmetricCirclesPatternDetectorWithClustering.accuracy
[  FAILED  ] fisheyeTest.Calibration
[  FAILED  ] fisheyeTest.Homography
[  FAILED  ] fisheyeTest.EstimateUncertainties
[  FAILED  ] fisheyeTest.stereoRectify
[  FAILED  ] fisheyeTest.stereoCalibrate
[  FAILED  ] fisheyeTest.stereoCalibrateFixIntrinsic
[  FAILED  ] Calib3d_Homography.fromImages
Repository: rust
Issue: Allow the `Iterator::partition` method to collect in two different collections
Labels: T-libs-api,A-iterators

The current `Iterator::partition` signature look like this:

```rust
fn partition<B, F>(self, mut f: F) -> (B, B) where
        Self: Sized,
        B: Default + Extend<Self::Item>,
        F: FnMut(&Self::Item) -> bool
    {
        // ...
    }
```

Which force the user to collect in two collections of the same type for the two different "sides".

A partition method with a signature like the following, allow more flexibility, allowing to specify the two collections independently.

```rust
fn partition<B, C, F>(self, mut f: F) -> (B, C) where
        Self: Sized,
        B: Default + Extend<Self::Item>,
        C: Default + Extend<Self::Item>,
        F: FnMut(&Self::Item) -> bool
    {
        // ...
    }
```

This is something that could not be changed in a snap of a finger, this is not backward compatible in a sense that the new function signature asks for 3 generic types. It could have been fixed by a default generic (i.e. `C=B`) but it is not allowed in function generic parameters.

So this issue will be here for a moment, I think. however, [I have done the update][1] just to see the compatibility problem.

The other solution could be to add something like `Iterator::partition_distinct`.

[1]: https://github.com/rust-lang/rust/compare/master...Kerollmops:iterator-partition-distinct-collections
Repository: neovim
Issue: RPC: Implement an analogue for ch_logfile
Labels: enhancement,channels-rpc,revisit-at-release,logging

Vim 8.0 has a function called `ch_logfile` for logging all of the activity for channels and jobs to a file conveniently. This makes it easy to figure out where some interaction between some plugin and a program, especially a language server, might be going wrong. It would be very useful to have a similar function in NeoVim. Right now, I often advise users to try and repeat their bugs in Vim instead of NeoVim, so I can see the log file that `ch_logfile` creates.
Repository: go
Issue: time: excessive CPU usage when using Ticker and Sleep
Labels: Performance,NeedsInvestigation

### What version of Go are you using (`go version`)?

go1.11 linux/amd64

### Does this issue reproduce with the latest release?

Yes

### What operating system and processor architecture are you using (`go env`)?

GOARCH="amd64"
GOBIN=""
GOCACHE="/home/lni/.cache/go-build"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/lni/golang_ws"
GOPROXY=""
GORACE=""
GOROOT="/usr/local/go"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GCCGO="gccgo"
CC="gcc"
CXX="g++"
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 -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build440058908=/tmp/go-build -gno-record-gcc-switches"

### What did you do?

I need to call a function roughly every millisecond, there is no real time requirement, as long as it is called roughly every millisecond everything is fine. However, I realised that both time.Ticker and time.Sleep() are causing excessive CPU overhead, probably due to runtime scheduling.
 
The following Go program uses 20-25% %CPU as reported by top on Linux. 

```
package main

import (
  "time"
)

func main() {
  ticker := time.NewTicker(time.Millisecond)
  defer ticker.Stop()
  for {
    select {
    case <-ticker.C:
    }
  }
}
```

for loop with range is causing similar overhead

```
package main

import (
  "time"
)

func main() {
  ticker := time.NewTicker(time.Millisecond)
  defer ticker.Stop()
  for range ticker.C {
  }
}
``` 

while the following program is showing 10-15% %CPU in top

```
package main

import (
  "time"
)

func main() {
  for {
    time.Sleep(time.Millisecond)
  }
}
```

To workaround the issue,  I had to move the ticker/sleep part to C and let the C code to call the Go function that need to be invoked every millisecond. Such a cgo based ugly hack reduced %CPU in top to 2-3%. Please see the proof of concept code below.   

ticker.h
```
#ifndef TEST_TICKER_H
#define TEST_TICKER_H

void cticker();

#endif // TEST_TICKER_H
```

ticker.c
```
#include <unistd.h>
#include "ticker.h"
#include "_cgo_export.h"

void cticker()
{
  for(int i = 0; i < 30000; i++)
  {
    usleep(1000);
    Gotask();
  }
}
```

ticker.go

```
package main

/*
#include "ticker.h"
*/
import "C"
import (
  "log"
)

var (
  counter uint64 = 0
)

//export Gotask
func Gotask() {
  counter++
}

func main() {
  C.cticker()
  log.Printf("Gotask called %d times", counter)
}
```

### What did you expect to see?

Much lower CPU overhead when using time.Ticker or time.Sleep() 

### What did you see instead?

20-25% %CPU in top