sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: cmd/go: unify DWARF knowledge
Labels: NeedsInvestigation

Knowledge about what platforms we should generate DWARF for is currently spread between the linker and cmd/go. We should put it all in one place, probably cmd/go. See CLs 40859 and 40865 for discussion.
Repository: kubernetes
Issue: Downward API does not support gpu resource
Labels: sig/node,kind/feature,needs-triage

I can not fetch the GPU limit resource by downward API using YAML like :
```yaml
          valueFrom:
            resourceFieldRef:
              resource: limits.alpha.kubernetes.io/nvidia-gpu
```

The errror message:
```yaml
The Job "gpu-job" is invalid: spec.template.spec.containers[0].env[4].valueFrom.resourceFieldRef.resource: Unsupported value: "limits.alpha.kubernetes.io/nvidia-gpu": supported values: limits.cpu, limits.memory, requests.cpu, requests.memory
```
Repository: rust
Issue: Misleading error when a trait method implementation has explicit lifetime parameters but the trait signature does not.
Labels: C-enhancement,A-diagnostics,A-lifetimes,A-trait-system,T-compiler,D-papercut

Consider this example ([playground](https://play.rust-lang.org/?gist=f6e6314f04cbe19a3f30d1e03208a281&version=nightly&backtrace=0)):
```
use std::vec::Vec;
use std::option::Option;

trait MyTrait {
    fn bar(&self, vec: &Vec<u32>) -> Option<&u32>;
}

struct Foo;

impl MyTrait for Foo {
    fn bar<'a>(&self, vec: &'a Vec<u32>) -> Option<&'a u32> {
        vec.get(0)
    }
}
```

The error message is:

```
rustc 1.18.0-nightly (7627e3d31 2017-04-16)
error[E0495]: cannot infer an appropriate lifetime for lifetime parameter 'a in generic type due to conflicting requirements
  --> <anon>:11:5
   |
11 |       fn bar<'a>(&self, vec: &'a Vec<u32>) -> Option<&'a u32> {
   |  _____^ starting here...
12 | |         vec.get(0)
13 | |     }
   | |_____^ ...ending here
   |
note: first, the lifetime cannot outlive the anonymous lifetime #2 defined on the body at 11:60...
  --> <anon>:11:61
   |
11 |       fn bar<'a>(&self, vec: &'a Vec<u32>) -> Option<&'a u32> {
   |  _____________________________________________________________^ starting here...
12 | |         vec.get(0)
13 | |     }
   | |_____^ ...ending here
note: ...so that method type is compatible with trait (expected fn(&Foo, &std::vec::Vec<u32>) -> std::option::Option<&u32>, found fn(&Foo, &std::vec::Vec<u32>) -> std::option::Option<&u32>)
  --> <anon>:11:5
   |
11 |       fn bar<'a>(&self, vec: &'a Vec<u32>) -> Option<&'a u32> {
   |  _____^ starting here...
12 | |         vec.get(0)
13 | |     }
   | |_____^ ...ending here
note: but, the lifetime must be valid for the anonymous lifetime #1 defined on the body at 11:60...
  --> <anon>:11:61
   |
11 |       fn bar<'a>(&self, vec: &'a Vec<u32>) -> Option<&'a u32> {
   |  _____________________________________________________________^ starting here...
12 | |         vec.get(0)
13 | |     }
   | |_____^ ...ending here
note: ...so that method type is compatible with trait (expected fn(&Foo, &std::vec::Vec<u32>) -> std::option::Option<&u32>, found fn(&Foo, &std::vec::Vec<u32>) -> std::option::Option<&u32>)
  --> <anon>:11:5
   |
11 |       fn bar<'a>(&self, vec: &'a Vec<u32>) -> Option<&'a u32> {
   |  _____^ starting here...
12 | |         vec.get(0)
13 | |     }
   | |_____^ ...ending here

error: aborting due to previous error
```


All of the text of the error is focussed on the body of the function, even though there are no lifetime problems in the body with respect to the signature of the surrounding function. The actual error is that the signatures of the trait method and its implementation do not match.
Repository: flutter
Issue: Is there a way to dynamically collapse / control SliverAppBar?
Labels: c: new feature,framework,f: material design,f: scrolling,P3,team-design,triaged-design

Hi,
I am just starting to learn flutter and I would like to know how to for example collapse SliverAppBar when I click on a button.

Best regards

Matej
Repository: vscode
Issue: SCM - Support keyboard shortcuts
Labels: feature-request,scm

<!-- Do you have a question? Please ask it on http://stackoverflow.com/questions/tagged/vscode -->

- VSCode Version: 1.11.2
- OS Version: macOS Sierra 10.12.4

Steps to Reproduce:

1. Open a project under git, with some changed files
2. Ctrl-Shift-G to open the SCM view.  It has a commit message at the top and a list of Changes below.
3. Tab to go to the list of Changes.
4. Cursor down until an interesting file is selected.

Now I can do Return to see a diff.  After that, the file is highlighted and there are icons in the SCM view for reverting this file (curved arrow) or for staging it (plus sign).

But I can't find a keyboard shortcut for the "stage" icon.  I tried Return, Ctrl-Return, Space, Ctrl-Space, S, Shift-S, the Plus key, Cmd-Down (because that opens a file in Explorer view), Cmd-Up, Cmd-Right, Cmd-Left.

I also tried Cmd-Shift-P to find the command, but it doesn't have a keyboard shortcut printed.  I also tried to right-click the file, which gave me a context menu (with "stage" in it), again without keyboard shortcut.
Repository: go
Issue: reflect: StructOf should support embedding types with non-exported methods
Labels: help wanted,NeedsFix,compiler/runtime

There's this code in reflect/type.go:

                                        if ift.nameOff(m.name).pkgPath() != "" {
                                                // TODO(sbinet)
                                                panic("reflect: embedded interface with unexported method(s) not implemented")
                                        }

See also #5748.
Repository: go
Issue: cmd/compile: go:linkname prevents inlining
Labels: Performance,compiler/runtime

go version devel +33c3477039 Tue Apr 18 03:56:16 2017 +0000 linux/amd64

`sync_runtime_procPin` is marked with `//go:linkname sync_runtime_procPin sync.runtime_procPin`. Runtime marks it as inlinable (which is good). However, sync fails to inline it with `cannot inline runtime_canSpin: no function body`.
There are more functions exposed from runtime to sync, sync/atomic, reflect, time, os.
Can we inline them?
Repository: You-Dont-Know-JS
Issue: Add some 'why' explanation to the 4 ways that `this` is set
Labels: for second edition

You briefly introduce this here https://github.com/getify/You-Dont-Know-JS/blob/master/up%20%26%20going/ch2.md#this-identifier and here https://github.com/getify/You-Dont-Know-JS/blob/master/up%20%26%20going/ch3.md#this--object-prototypes.

I know that you don't want to get into details about these four methods, and that you'll do so in a later title, but I think the reader would benefit from a sentence that explains at a high level, what the thinking behind it being set in four different ways is. Why it is useful or necessary to understand it.

I'm thinking about something similar to what you have written about closure and modules (`One important application of closure is the module pattern, as we briefly introduced in this book in Chapter 2. The module pattern is perhaps the most prevalent code organization pattern in all of JavaScript; deep understanding of it should be one of your highest priorities.`). Something that sparks the readers imagination and helps fire some neurons before they get to the chapter.

I haven't read the rest of the book yet so there may be a good reason why you don't do this, but I wanted to feed back now to give you the perspective of a new reader (it might be that when I know more about this, I don't find the lack of context so significant).

PS. Loving the book so far :)
Repository: go
Issue: cmd/compile: big array not allocated on heap, which make program panic.
Labels: NeedsFix,compiler/runtime

Please answer these questions before submitting your issue. Thanks!

### What version of Go are you using (`go version`)?

go version go1.8.1 linux/amd64

### What did you do?

```golang
package main

const N = 1000 * 1000 * 537
var a [N]byte

func main() {
	// this will stack overflow
	for _, v := range a {
	  _ = v
	}

	// edit: blow solo also stack overflow
	var x [N]byte
	var y [N]byte
	_, _ = x, y
}
```

[edit]: now(Go SDK 1.12.2), the above program doesn't crash. But below @agnivade shows [one case which will still crash](https://github.com/golang/go/issues/20021#issuecomment-481574765).

### What did you expect to see?

runs ok

### What did you see instead?

crash

```
runtime: goroutine stack exceeds 1000000000-byte limit
fatal error: stack overflow

runtime stack:
runtime.throw(0x469cdc, 0xe)
	/sdks/go/src/runtime/panic.go:596 +0x95
runtime.newstack(0x0)
	/sdks/go/src/runtime/stack.go:1089 +0x3f2
runtime.morestack()
	/sdks/go/src/runtime/asm_amd64.s:398 +0x86

goroutine 1 [running]:
main.main()
	/tmp/main.go:6 +0x88 fp=0xc460057f88 sp=0xc460057f80
runtime.main()
	/sdks/go/src/runtime/proc.go:185 +0x20a fp=0xc460057fe0 sp=0xc460057f88
runtime.goexit()
	/sdks/go/src/runtime/asm_amd64.s:2197 +0x1 fp=0xc460057fe8 sp=0xc460057fe0
exit status 2
```
Repository: opencv
Issue: CV_CAP_GSTREAMER_QUEUE_LENGTH fails
Labels: bug,category: videoio


I have a scenario in which I am processing an mp4 file in batch mode using VideoCapture via gstreamer. In this case appsink requires the sync=false property so that the execution is at fastest speed without delays.

The problem is that the appsink is configured by cap_gstreamer.cpp as drop with buffer 1. Using the property CV_CAP_GSTREAMER_QUEUE_LENGTH to modify the buffering makes the pipeline crash probably because it is not

Example (OSX with OpenCV 3.2.0) with the following input

filesrc location=x.mp4 ! qtdemux ! h264parse ! vtdec_hw ! videoconvert ! appsink sync=false

Performance motivato: the same FULL HD video playbacks in 100-200 us using gstreamer and in 3-4ms using the hardware decoding  provided by OSX VideoToolbox and made accessible by gstreamer via vtdec_hw.

The specific error is with qtdemux.
Repository: TypeScript
Issue: The check "Parameter cannot be referenced in its initializer" for default parameters is too strict
Labels: Bug

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

**TypeScript Version:**  2.2.1 / nightly (2.2.0-dev.201xxxxx)

**Code**

```ts
(function(x = () => x) {
  console.log(x());
})();
```

**Expected behavior:**
This is valid code according to ES2015 specs and it should compile correctly.
**Actual behavior:**
Getting "Parameter 'x' cannot be referenced in its initializer".
Repository: go
Issue: net/http: Server hangs and cannot receive any more requests when using ReverseProxy
Labels: NeedsInvestigation

Please answer these questions before submitting your issue. Thanks!

### What version of Go are you using (`go version`)?
$ go version
go version go1.7.5 linux/amd64

### What operating system and processor architecture are you using (`go env`)?
$ go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/user/tmp/github/reverse-proxy-test"
GORACE=""
GOROOT="/opt/emc/apps/golang/go"
GOTOOLDIR="/opt/emc/apps/golang/go/pkg/tool/linux_amd64"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build252819066=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"


### What did you do?
Source: [https://github.com/hleong25/reverse-proxy-test](https://github.com/hleong25/reverse-proxy-test)

I cross compiled from linux to windows: `GOOS=windows go build henryleong.com/...`

The binary will start an HTTP server and will act as a reverseproxy. I will refer to it as the agent. The agent will spawn the same binary but with a new port (agents port +1), read the stdout and stderr through separate pipes. The spawned binary will be referred to as plugin. The plugin will handle the actual HTTP request from the agent through a reverseproxy request.

On a separate machine, I do a loop to the agents endpoint: `while true; do curl http://<host>:<port>/greetings; done;`

### What did you expect to see?
I expect the curl command will be processed very quickly.

### What did you see instead?
Intermittently, after a short period, curl will hang waiting for the agents server to process the HTTP request.

I believe it has to do with the stdout/stderr pipes which is not being flushed and creates some sort of deadlock/race condition.

### Workaround 1
If it gets into this situation, to get out of it, I would do a HTTP request to the plugin directly, and the agent starts processing the HTTP requests. Which after a while, the agent will get into this issue again and I would need to do a HTTP request to the plugin directly.


### Workaround 2
If I modify the plugin to output something to stdout or to stderr periodically, the agents HTTP server will start responding to HTTP requests.
Repository: opencv
Issue: imdecode should allow more control over decode process
Labels: feature,category: imgcodecs

Presently, imdecode is all-or-nothing. If the user's data decodes correctly into some type of image, then the image is returned, and otherwise it isn't.

It would be really helpful if the user had more control over this process. For example, it would be handy if the user could decide if they want to abort the decode process after inspecting the type of image or its width/height. imdecode presently does not allow this.
Repository: opencv
Issue: imdecode does not reuse dst if size differs
Labels: feature,category: imgcodecs

imdecode does allow users to reuse a pixel buffer by passing it as dst. Unfortunately, this only works if the size is actually the right size to be decoded. Otherwise, opencv allocates a new buffer. It seems this is not really within the intent for this argument. It would be really useful if users could make sure that their buffer can always be reused (even if it has to be wrapped in a new Mat structure)
Repository: opencv
Issue: Rigid body transformations using estimateAffine3D
Labels: feature,category: calib3d

##### System information (version)
- OpenCV => 3.0+
- Operating System / Platform => ALL
- Compiler => ALL

##### Detailed description
In case of rigid body transforms, the determinant of the rotation part returned is positive and equal to one. However, `estimateAffine3D` seems to estimate non-rigid scale as well. Current behavior can produce reflected and scaled rotations. The documentation does not show any details, and it seems that this function performs (or shall perform) rigid transformation of physically rotated and translated bodies (orthogonal rotation and transformation). However, when some outliers exists, it handle them as scale rather than searching for different candidates.

Hence, there should exist a way to restrict the current method to only rigid transforms, in which it should RANSACly search for non-scaled pairs or to fail if no proper points are found.


##### Current signature
```.c
int estimateAffine3D(InputArray src, InputArray dst,
                     OutputArray out, OutputArray inliers,
                     double ransacThreshold = 3, double confidence = 0.99);
```

##### Suggested signature
```.c
int estimateAffine3D(InputArray src, InputArray dst,
                     OutputArray out, OutputArray inliers,
                     double ransacThreshold = 3, double confidence = 0.99,
                     bool rigid = false);
```

##### Steps to reproduce
```py
import numpy as np
import cv2

src = np.array([
    [10, 10, 10],
    [10, 10, 20],
    [10, 20, 10],
    [10, 20, 20],
])

dst = np.array([
    [-20, 20, 20],
    [-20, 20, 40],
    [20, 40, 20],
    [20, 40, 40],
])

retval, Rt, inliers = cv2.estimateAffine3D(src, dst) #, rigid=True
if retval:
    print("det: %.3f" % np.linalg.det(Rt[:,:3]))
else:
    print("failed")
```
##### Expected output
`det: 1.000` OR `failed`

##### Actual output
`det: -23.762`

##### Additional
It would be great if the returned transform is a 4x4 matrix. Changing `modules/calib3d/src/ptsetreg.cpp` like below will do the trick:
```diff
         solve(A, B, X, DECOMP_SVD);
-        X.reshape(1, 3).copyTo(_model);
+        Mat last_row = Mat::zeros(4, 1, CV_64F);
+        last_row.at<double>(3) = 1;
+        X.push_back(last_row);
+        X.reshape(1, 4).copyTo(_model);
```
Repository: vscode
Issue: full width tab glyph for editor.renderWhitespace
Labels: feature-request,editor-render-whitespace

When viewing invisible characters (editor.renderWhitespace), I would like the character/glyph used for tabs to extend across the full width of the tab (N spaces / to the next tab stop). Sublime Text 3 uses what looks like an emdash(?) or essentially a line than runs to the next tab stop. VSCode uses a single character width arrow. 

In descending order of preference:

  - a line that extends the full tab width (to the next tab stop) like ST3
  - an arrow that extends the full tab width (to the next tab stop)
Repository: opencv
Issue: Python wrapper: Incorrectly wrapped members of cv::ml::TrainData
Labels: bug,category: python bindings

##### System information (version)
- OpenCV => 3.0+
- Operating System / Platform => ALL
- Compiler => ALL

##### Detailed description
- `cv::ml::TrainData::getSample` has a `NULL` pointer as a default argument for its `buf` parameter.
However, this is incorrectly wrapped in the generated code as a pointer to a zero-valued float:
```c
float buf=0.f;
//...
ERRWRAP2(_self_->getSample(varIdx, sidx, &buf));
```
- Similarly, `cv::ml::TrainData::getValues` has a NULL pointer as default argument for its `values` parameter, yet it is wrapped as a pointer to a zero-valued float.
```c
float values=0.f;
//...
ERRWRAP2(_self_->getValues(vi, sidx, &values));
```
This will cause undesired behaviors and generate garbage data and possibly causes crashes.

##### Steps to reproduce
- Build opencv_python2
- Check the generated code at `{BUILD_DIR}/modules/python2/pyopencv_generated_types.h` and see how the NULL pointers are changed into pointers to zero-valued floats.

##### How to solve
- `cv::ml::TrainData::getSample` wrapper should be corrected to something similar to:
```diff
-    float buf=0.f;
+    PyObject* pyobj_buf = NULL;
+    Ptr<float> buf;

     const char* keywords[] = { "varIdx", "sidx", "buf", NULL };
-    if( PyArg_ParseTupleAndKeywords(args, kw, "Oif:ml_TrainData.getSample", (char**)keywords, &pyobj_varIdx, &sidx, &buf) &&
-        pyopencv_to(pyobj_varIdx, varIdx, ArgInfo("varIdx", 0)) )
+    if( PyArg_ParseTupleAndKeywords(args, kw, "OiO:ml_TrainData.getSample", (char**)keywords, &pyobj_varIdx, &sidx, &pyobj_buf) &&
+        pyopencv_to(pyobj_varIdx, varIdx, ArgInfo("varIdx", 0)) &&
+        pyopencv_to(pyobj_buf, buf, ArgInfo("buf", 0)) )
     {
-        ERRWRAP2(_self_->getSample(varIdx, sidx, &buf));
+        ERRWRAP2(_self_->getSample(varIdx, sidx, buf));
```

- `cv::ml::TrainData::getValues` wrapper should be corrected to something similar to:
```diff
-    float values=0.f;
+    PyObject* pyobj_values = NULL;
+    Ptr<float> values;

     const char* keywords[] = { "vi", "sidx", "values", NULL };
-    if( PyArg_ParseTupleAndKeywords(args, kw, "iOf:ml_TrainData.getValues", (char**)keywords, &vi, &pyobj_sidx, &values) &&
-        pyopencv_to(pyobj_sidx, sidx, ArgInfo("sidx", 0)) )
+    if( PyArg_ParseTupleAndKeywords(args, kw, "iOO:ml_TrainData.getValues", (char**)keywords, &vi, &pyobj_sidx, &pyobj_values) &&
+        pyopencv_to(pyobj_sidx, sidx, ArgInfo("sidx", 0)) &&
+        pyopencv_to(pyobj_values, values, ArgInfo("values", 0)) )
     {
-        ERRWRAP2(_self_->getValues(vi, sidx, &values));
+        ERRWRAP2(_self_->getValues(vi, sidx, values));
```
Repository: kubernetes
Issue: Understand why resource usage of master components is noticeably different in Kubemark
Labels: sig/scalability,lifecycle/frozen,lifecycle/stale

We see pretty big discrepancy between what we see in kubemark clusters and real ones. It needs to be understood. Difference is mostly in the API server usage.

E.g. 99 percentile in kubemark (both results from after Density, which is run as a first test):
```
container                               cpu(cores) memory(MB)
"apiserver/apiserver"                   0.606      407.89
"controller-manager/controller-manager" 0.120      218.27
"etcd/etcd/data"                        0.120      160.75
"etcd/etcd/data-events"                 0.034      46.22
"scheduler/scheduler"                   0.080      114.16
```
and real cluster:
```json
    {
      "Name": "etcd-server-e2e-scalability-master/etcd-container",
      "Cpu": 0.167254853,
      "Mem": 371601408
    },
    {
      "Name": "etcd-server-events-e2e-scalability-master/etcd-container",
      "Cpu": 0.14851711,
      "Mem": 159068160
    },
    {
      "Name": "kube-apiserver-e2e-scalability-master/kube-apiserver",
      "Cpu": 0.972463425,
      "Mem": 787206144
    },
    {
      "Name": "kube-controller-manager-e2e-scalability-master/kube-controller-manager",
      "Cpu": 0.180771427,
      "Mem": 235991040
    },
    {
      "Name": "kube-scheduler-e2e-scalability-master/kube-scheduler",
      "Cpu": 0.169906087,
      "Mem": 113385472
    },
```

@wojtek-t @shyamjvs @kubernetes/sig-scalability-misc
Repository: TypeScript
Issue: Casting of a union type variable doesn't work if interface has all optional properties
Labels: Suggestion,In Discussion

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

**TypeScript Version:**  at least 2.0.0 - 2.3.0

**Code**

```ts
interface ITest1 { IsTest: boolean; }
interface ITest2 { IsTest?: boolean; }

let case1: ITest1 | string;
case1 = case1 as string;
case1.indexOf("_"); // <-- no error

let case2: ITest2 | string;
case2 = case2 as string;
case2.indexOf("_"); // <-- ERROR
```

**Expected behavior:**
In the second case there should be no error reported, same as in the first one.  `case2` variable should have type `string` after casting `case2 = case2 as string`

**Actual behavior:**
When union of types contain interface with all optional properties than casting as one of the types does not change the type of a variable to more specific one.
Repository: thefuck
Issue: Use type annotations and mypy
Labels: enhancement,WIP

It would be nice to have type annotations and check code with [mypy](http://mypy-lang.org/).

It can be done in a few steps:

- [X] write [type eraser](https://github.com/nvbn/thefuck/blob/types/type_eraser.py) that will remove annotations from code before release (for python 2 support);
- [ ] annotate sources;
- [ ] make sources pass mypy check.
Repository: kubernetes
Issue: Proportional scaling in Deployments in not fully re-entrant
Labels: kind/bug,area/workload-api/deployment,sig/apps,lifecycle/frozen

The fix is to avoid scaling replica sets with replica annotations synced to the actual size of the deployment. While doing that, we need to handle gracefully the case where all replica sets have their annotations synced but the sum of their spec.replicas does not match spec.replicas of the deployment.

@kubernetes/sig-apps-bugs