sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: rust
Issue: Potential optimization: eager nulling of Weak references
Labels: I-slow,C-enhancement,T-libs-api,C-optimization

[Apparently](https://www.mikeash.com/pyblog/friday-qa-2015-12-11-swift-weak-references.html) Swift does this:

> When a weak reference is loaded, the runtime checks the target's state. If the target is a zombie, then it zeroes the weak reference, decrements the weak reference count, and returns nil.

In our world, this would mean `Weak` would store a `Cell`, which would be `set` to null in `upgrade()` if the strong count was found to be zero. This could allow the allocation to be freed earlier than it otherwise would be. I'm not sure if it would be a significant pessimization in any other respects?

(I just checked what other operations are available on `Weak` - this could also potentially be done in `clone()`.)
Repository: vscode
Issue: Support regex in files.exclude => when
Labels: feature-request,file-explorer,file-glob

I would like to ignore JS files in my project when there's a matching TS _or_ matching TSX file.  Right now I have to choose one or the other.  Please support making the "when" directive in the "files.exclude" workspace setting use a regex, so I could do this:

``` javascript
{
  "files.exclude": {
        "**/*.js": { "when": "$(basename).tsx?"},
  }
}
```
Repository: TypeScript
Issue: No completion builder present after a '<'
Labels: Bug,Help Wanted

Input `>` key on a following code.

``` ts
<T
```

expected:

``` ts
<T>
```

actual:

``` ts
<TemplateStringsArray>
```

experience:

``` ts
// writing an arrow function with generics
let f = <TemplateStringsArray>
```
Repository: go
Issue: x/net/http2: investigate client write buffering
Labels: NeedsInvestigation

testClientWrite in http2 mode with CL https://go-review.googlesource.com/#/c/17751/1 fails, but the fails aren't that consistent

Run 1:

``` shell
$ go test -cover
--- FAIL: TestClientWrites_h2 (0.00s)
    client_test.go:578: Get request did 8 Write calls, want 1
    client_test.go:587: Post request did 3 Write calls, want 1
FAIL
coverage: 78.6% of statements
exit status 1
FAIL    net/http    23.081s
```

Run 2:

``` shell
$ go test -cover
--- FAIL: TestClientWrites_h2 (0.01s)
    client_test.go:578: Get request did 8 Write calls, want 1
FAIL
coverage: 78.5% of statements
exit status 1
```

The diff that produced this is

``` diff
diff --git a/src/net/http/client_test.go b/src/net/http/client_test.go
index e72f3bc..05a543c 100644
--- a/src/net/http/client_test.go
+++ b/src/net/http/client_test.go
@@ -550,11 +550,14 @@ func (c *writeCountingConn) Write(p []byte) (int, error) {

 // TestClientWrites verifies that client requests are buffered and we
 // don't send a TCP packet per line of the http request + body.
-func TestClientWrites(t *testing.T) {
+func TestClientWrites_h1(t *testing.T) { testClientWrites(t, h1Mode) }
+func TestClientWrites_h2(t *testing.T) { testClientWrites(t, h2Mode) }
+
+func testClientWrites(t *testing.T, h2 bool) {
    defer afterTest(t)
-   ts := httptest.NewServer(HandlerFunc(func(w ResponseWriter, r *Request) {
+   cst := newClientServerTest(t, h2, HandlerFunc(func(w ResponseWriter, r *Request) {
    }))
-   defer ts.Close()
+   defer cst.close()

    writes := 0
    dialer := func(netz string, addr string) (net.Conn, error) {
@@ -564,9 +567,10 @@ func TestClientWrites(t *testing.T) {
        }
        return c, err
    }
-   c := &Client{Transport: &Transport{Dial: dialer}}
+   cst.c.Transport.(*Transport).Dial = dialer

-   _, err := c.Get(ts.URL)
+   c := cst.c
+   _, err := c.Get(cst.ts.URL)
    if err != nil {
        t.Fatal(err)
    }
@@ -575,7 +579,7 @@ func TestClientWrites(t *testing.T) {
    }

    writes = 0
-   _, err = c.PostForm(ts.URL, url.Values{"foo": {"bar"}})
+   _, err = c.PostForm(cst.ts.URL, url.Values{"foo": {"bar"}})
    if err != nil {
        t.Fatal(err)
    }
```
Repository: kubernetes
Issue: Using dynamic resource usage statistics from heapster for pod scheduling
Labels: priority/backlog,sig/scheduling,lifecycle/frozen

As per the master branch, a pod's _resource usages_ are taken as its _resource requests_. We have extended it to be the maximum of the pod's _resource requests_ and 95th percentile of its resource usages in past hour(taken from heapster). [Here](https://github.com/nishantsny/kubernetes/tree/dynamicScheduling) is the repository. The significant changes are in _predicates.go_ and _priorities.go_

We need help on the following issues:
1. We do not know how to access the heapster api-endpoint directly. Right now, we have hardcoded it  as _https://10.245.1.2/api/v1/proxy/namespaces/kube-system/services/heapster/_ (it is the heapster endpoint for vagrant setup). Some way to get the kubernetes master ip address would also work.
2.  We are not sure if maximum of requests and 95th percentile of last hour is a good idea. Please suggest some other statistic.

PS: In our code there is a new resource request parameter named _softRequests_ which is same as _requests_. We will remove it shortly.
Repository: neovim
Issue: shada: add support for `set shada+=` and `set shada-=`
Labels: enhancement,options

It would be useful if `+=` and `-=` would be supported with `set shada`.

Currently `set shada+='500` won't replace the existing `'100`.

I've noticed that `set shada+=nfoo` twice won't re-add it, but `set shada+=nbar` would result in `nfoo,nbar` at the end.

This is required for only changing some of the defaults, especially with the `n` option to use a different name, e.g. if you want to use different files for different sessions/workspaces.
Repository: electron
Issue: Add FreeBSD support to electron
Labels: enhancement :sparkles:

[![Bountysource](https://api.bountysource.com/badge/issue?issue_id=29075473)](https://www.bountysource.com/issues/29075473-add-freebsd-support-to-electron?utm_source=29075473&utm_medium=shield&utm_campaign=ISSUE_BADGE)

Related: #2452
Repository: vscode
Issue: vscode/releases page missing binaries
Labels: feature-request

Just wondering... why doesn't the [releases](https://github.com/Microsoft/vscode/releases) page have vscode binaries? I only see the source code downloads. [Atom](https://github.com/atom/atom/releases) and [Brackets](https://github.com/adobe/brackets) both use GitHub to publish binaries...

Would be handy in case someone wanted to download an older release or if Microsoft's servers were down.

Inspired by [#1084](https://github.com/Microsoft/vscode/issues/1084)
Repository: godot
Issue: -w switch is not in effect when opening projects from the project manager
Labels: enhancement,topic:editor

The new -w switch works properly for opening a scene with "godot -e -w scene.scn", but if opening the project from the project manager, it will try to maximize like if the switch wasn't in effect.
Repository: opencv
Issue: Bug in Superres modules
Labels: bug,priority: normal,category: superres

In the supperres(Super resolution) modules, in the btv_l1.cpp, the calcRelativeMotions function is wrong. Its goal is to get the big motions between two far away frames by making use of the small motions between adjacent frames between them. However, the combination way of motions should not be addition. You should remap the whole image iteratively.
Repository: vscode
Issue: Support contributing different keybindings based on keyboard layout
Labels: feature-request,keyboard-layout

VSCode should ship out of the box with multiple keymaps (based on/optimized for each keyboard layout).
e.g. toggle line comment should be `ctrl+7` on swiss keyboards, etc.

VSCode should detect at runtime the current system keyboard layout and employ different defaults, based on the keyboard layout.
Repository: go
Issue: image/jpeg: add a jpeg option to disable chroma subsampling
Labels: NeedsInvestigation,FeatureRequest

It seems that golang's jpeg encoder only supports downsampling. It would be nice to be able to fine-tune what kind of subsampling is used when encoding jpegs, or alternatively disable downsampling when using a large quality value.

This is a continuation of:
https://groups.google.com/forum/#!topic/golang-nuts/VJY87VQpgws
Repository: go
Issue: cmd/internal/obj: -trimpath help text is misleading
Labels: Documentation,NeedsInvestigation,compiler/runtime

Tested with Go 1.5.2.

The -trimpath option is documented as follows:

```
$ go tool asm -help 2>&1|grep -A1 trimpath
  -trimpath string
        remove prefix from recorded source file paths
...
$ go tool compile -help|grep -A1 trimpath
  -trimpath prefix
        remove prefix from recorded source file paths
```

However, it would appear that it mistakenly removes the leading '/' from the resulting path:

```
$ export PROTO_DIR=/builds/go-proto-area
$ cd $(PROTO_DIR)/usr/lib/gocode/1.5/src/golang.org/x/crypto/blowfish
$ go install -asmflags -trimpath=$PROTO_DIR -gcflags -trimpath=$PROTO_DIR
$ strings ../../../../../pkg/solaris_amd64/golang.org/x/crypto/blowfish.a | grep 'lib\/'
xusr/lib/gocode/1.5/src/golang.org/x/crypto/blowfish/block.go
xusr/lib/gocode/1.5/src/golang.org/x/crypto/blowfish/block.go
...
```

If I add a terminating slash, then it fails to trim entirely:

```
$ export PROTO_DIR=/builds/go-proto-area/
$ cd $(PROTO_DIR)/usr/lib/gocode/1.5/src/golang.org/x/crypto/blowfish
$ go install -asmflags -trimpath=$PROTO_DIR -gcflags -trimpath=$PROTO_DIR
$ strings ../../../../../pkg/solaris_amd64/golang.org/x/crypto/blowfish.a | grep 'lib\/'
/builds/go-proto-area/usr/lib/gocode/1.5/src/golang.org/x/crypto/blowfish/block.go
/builds/go-proto-area/usr/lib/gocode/1.5/src/golang.org/x/crypto/blowfish/block.go
...
```

This appears to be due to a off-by-one error (or bad assumption) made in src/cmd/internal/obj/obj.go in setFile():

```
        // Remove leading TrimPathPrefix, or else rewrite $GOROOT to $GOROOT_FINAL.
        if h.TrimPathPrefix != "" && hasPathPrefix(abs, h.TrimPathPrefix) {
                if abs == h.TrimPathPrefix {
                        abs = ""
                } else {
                        abs = abs[len(h.TrimPathPrefix)+1:]
                }
```
Repository: opencv
Issue: real_time_pose_estimation tutorial could use new vtk mesh functionality
Labels: feature,category: viz

Right now the [real_time_pose_estimation](https://github.com/Itseez/opencv/tree/master/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation) tutorial takes in a [split of .ply for the mesh only, and .yaml for the textures](https://github.com/Itseez/opencv/blob/master/samples/cpp/tutorial_code/calib3d/real_time_pose_estimation/src/main_detection.cpp#L119). This isn't very useful for any real existing data as far as I'm aware, so I suggest using viz3d to support ply and obj files, especially when the ply can hold textures. Here is what is hopefully the vtk loading test and tutorial: [tests_simple.cpp](https://github.com/Itseez/opencv/blob/master/modules/viz/test/tests_simple.cpp), [test_tutorial3.cpp](https://github.com/Itseez/opencv/blob/master/modules/viz/test/test_tutorial3.cpp).

@edgarriba you may be interested in this issue since it pertains to your changes.
Repository: TypeScript
Issue: Grammar checking errors should be reported during binding phases instead of type-checking phase
Labels: Suggestion,Committed,VS Code Tracked

_From @StrongRef on December 15, 2015 9:32_

When declaring an octal literal, an error is shown.
![error1](https://cloud.githubusercontent.com/assets/16247609/11806897/601b9f94-a316-11e5-901c-d3a59257fb5f.png)

However, if another error is introduced, the error for octal literal usage is omitted.
![error2](https://cloud.githubusercontent.com/assets/16247609/11806917/7d572592-a316-11e5-8913-9faa08df0f89.png)

Another strict rule violation, this time both errors are visible.
![error3](https://cloud.githubusercontent.com/assets/16247609/11806958/c402e9b8-a316-11e5-9bbb-b6d2ca665e3d.png)

I could like into this one, just want to make sure this is an actual error.

_Copied from original issue: Microsoft/vscode#1318_
Repository: opencv
Issue: grabcut error
Labels: RFC

I'm getting the following error using grabcut:

`OpenCV/opencv/modules/imgproc/src/grabcut.cpp:216: error: (-215) dtrm > std::numeric_limits<double>::epsilon() in function calcInverseCovAndDeterm`

It seems like [this](http://stackoverflow.com/questions/13007926/opencv-grabcut-cpp-error) issue has either resurfaced or the patch has never made it to the master branch.
Repository: go
Issue: cmd/cgo: cgo gets confused by equivalent #defined types
Labels: compiler/runtime

Unfortunately I don't have a simple example for this one. I observed it while working with a .h file that was conditionally including all sorts of other .h files and having its own defines. The problem occurred with __u8 and u8 types. They were both eventually defined as "unsigned char" but cgo considered them different and even got confused in the following case:
- a C call returned a `[16]C.__u8`   (checked with a Printf %#v)
- I created a Go function that took a `[16]C.__u8` as the only argument and passed it the value I got above:
  `func uuidBytesToString(ub [16]C.__u8) string {...}`

When trying to compile it I got this error message:
`cannot use cHandle.id.b (type [16]C.__u8) as type [16]C.u8 in argument to uuidBytesToString`

It thinks that the func signature is `[16]C.u8` instead of `[16]C.__u8`, but even so these 2 types are eventually `unsigned char`
Repository: opencv
Issue: Unexpected numerical problem in cv::warpAffine
Labels: category: imgproc,affected: 2.4,affected: 3.4,RFC

Hi,
we have encountered a small numerical problem in warpAffine which leads to intensity differences of up to 5 pixels, where 0 is expected (and almost everywhere visible).

Normally, I would not mention such an issue, since some problems/differences are to be expected but in this specific case, the error looks systematic.

The issue can be reproduced with OpenCV 3.0.0 (I think we use PPL for parallelization but I would need to double check) and the attached code below:

[main.txt](https://github.com/Itseez/opencv/files/64028/main.txt) (the main.cpp for reproducing this issue)

Regards,
Hauke
Repository: go
Issue: gccgo, runtime:  runtime-gdb.py does not exist for gccgo
Labels: compiler/runtime

I have been working on the runtime-gdb.py script so it can be used with gccgo for use in displaying the goroutine information.

I'd like to include it somewhere in the gccgo install for others to use but not sure where would be best.  Possibly under the share directory.

I don't think it needs to be found automatically on gdb startup like it is in golang, just make it available somewhere so it can be used.
Repository: rust
Issue: Avoid type mismatch error where a variable is bound with different ref-ness
Labels: C-enhancement,A-diagnostics,T-compiler,D-verbose

e.g.,

```
match x {
      opts::a(ref i) | opts::b(i) => {}
      //~^ ERROR variable `i` is bound with different mode in pattern #2 than in pattern #1
      //~^^ ERROR mismatched types
```

Where the field of `a` and `b` has the same type

cc #30320
Repository: kubernetes
Issue: Kubelet should enforce access to images after they've already been pulled to a node
Labels: priority/backlog,sig/node,kind/feature,sig/auth,help wanted,lifecycle/frozen

# Problem statement

Some images require pull secrets in order to be used by the Kubelet. Pull secrets are per namespace. Imagine the following scenario:
1. If a pod in namespaceA has valid pull secrets for `foo/bar:stable`, when it is scheduled to a given node, the Kubelet uses the pull secrets to pull the image to the node
2. If a pod in namespaceB also refers to `foo/bar:stable` but does not have valid pull secrets for it, if it happens to be scheduled to the same node as the pod in step 1, the Kubelet respects the image pull policy
3. Because the image already exists on the node, if the pull policy is Never or IfNotPresent, the Kubelet runs the pod, even though namespaceB shouldn't be able to use that image.
# Proposed solutions
## Option 1 - Kubelet flag to ignore pull policy and always try to pull

Add a flag to the kubelet, `--always-pull-images` (or something similarly named) that, if true, would force the Kubelet to attempt to pull every image prior to running a pod, regardless of the image's pull policy.

Pros:
- Easy to implement
- Guarantees that a namespace is allowed to use an image

Cons:
- Overrides user-specified intent in image pull policy
- Requires remote registry to be online to check authorization
- Introduces small amount of latency to pod startup time (because of the additional network requests to the registry)
## Option 2 - Keep an in-memory cache of which namespaces are allowed to use which images

After an image has been successfully pulled, record the mapping from namespace to image in an in-memory cache in the Kubelet. Subsequent attempts by pods in the same namespace to use the same image would respect the image pull policy. Any attempts by pods in other namespaces to use this image would ignore the image pull policy and instead force a pull attempt.

Pros:
- Doesn't override user-specified intent in image pull policy
- No added latency to pod startup time

Cons:
- Doesn't handle authorization revocation; if the credentials to pull an image have changed in the remote registry, there is no way to evict an entry from the cache, possibly allowing access to an image that would otherwise fail with option 1. This could be mitigated if the entries in the cache have a TTL.
# Suggested path forward

Looking for feedback from the community on this one. I'd like to implement option 1 in the short term, with the default being false (so image pull policy is respected) to keep the status quo. If we can come to an agreement on option 2, I'd like to move to that eventually.

@kubernetes/goog-node @kubernetes/rh-cluster-infra @kubernetes/sig-node
Repository: rust
Issue: Manual does not define "data reached through a shared reference".
Labels: C-enhancement,T-lang

The manual uses the expression "data reached through a shared reference" but does not define it. In the following code, is `x` reached through a shared reference?

``` rust
pub unsafe fn a() -> u8 {
    let mut x = 11;
    b(&x as *const u8 as *mut u8);
    x
}

unsafe fn b(x: *mut u8) {
    *x = 22;
}
```
Repository: TypeScript
Issue: No completion builder present after a '('
Labels: Bug,Help Wanted

Input `:` key.

``` ts
let f: (val
```

expected:

``` ts
let f: (val:
```

actual:

``` ts
let f: (ValidityState:
```

Divides #6079.
Repository: go
Issue: tour: is there an example about operators?
Labels: NeedsInvestigation

Context: https://tour.golang.org/basics/11

I couldn't found a talk about operators, it would be good if there was one, specially about the more advanced bitwise ones.
Repository: TypeScript
Issue: Why do multiple ES6 imports compile to multiple requires / define() deps with suffixed names?
Labels: Bug,Help Wanted,Effort: Moderate

I didn't find any existing issue for this, but why does

``` typescript
import { foo } from "a";
foo();
import { bar } from "a";
bar();
```

compile to

``` javascript
define(["require", "exports", "a", "a"], function (require, exports, a_1, a_2) {
    a_1.foo();
    a_2.bar();
});
```

instead of

``` javascript
define(["require", "exports", "a"], function (require, exports, a) {
    a.foo();
    a.bar();
});
```

and similar for cjs output? The latter is how one would write the JS, and does away with the `_1` `_2` names as well.

---

Of course in this example they can be combined. My original code has a mix of import-from and export-from.

``` typescript
import * as set from "./utility/set";
export { Set } from "./utility/set";

// Do things with set
```

I _could_ change that to

``` typescript
import * as set from "./utility/set";
const Set = set.Set;
export { Set };

// Do things with set
```

but even a single import still has the `_1` name in the generated JS, which is what I'm really curious about.
Repository: go
Issue: net/http: Transport.RoundTrip errors could be more informative
Labels: Testing,help wanted,NeedsFix,early-in-cycle

```
go version go1.5 linux/amd64
```

```
Ubuntu 14.04.3 LTS
```

I made an HTTP request to a server that accepts all TCP connections and then immediately closes them. I was expecting a meaningful error such as "connection closed before request could be sent" but http.RoundTrip returned EOF.

Here are client and server snippets that reproduce this. The client:

```
package main

import (
    "fmt"
    "net"
    "net/http"
)

func main() {
    dialer := &net.Dialer{}
    transport := &http.Transport{
        Dial: dialer.Dial,
    }

    request, _ := http.NewRequest("GET", "http://127.0.0.1:19870/", nil)
    _, err := transport.RoundTrip(request)
    fmt.Println(err)
}
```

Output is:

```
EOF
```

And the server:

``` go
package main

import "net"

func main() {
    ln, _ := net.Listen("tcp", ":19870")
    conn, _ := ln.Accept()
    conn.Close()
}
```

Here is a dump of the TCP exchange:

```
17:16:31.017342 IP localhost.52287 > localhost.19870: Flags [S], seq 3991906392, win 43690, options [mss 65495,sackOK,TS val 27880590 ecr 0,nop,wscale 7], length 0
E..<..@.@.w..........?M....X.........0.........
..l.........
17:16:31.017356 IP localhost.19870 > localhost.52287: Flags [S.], seq 530413255, ack 3991906393, win 43690, options [mss 65495,sackOK,TS val 27880590 ecr 27880590,nop,wscale 7], length 0
E..<..@.@.<.........M..?..v....Y.....0.........
..l...l.....
17:16:31.017367 IP localhost.52287 > localhost.19870: Flags [.], ack 1, win 342, options [nop,nop,TS val 27880590 ecr 27880590], length 0
E..4..@.@.w..........?M....Y..v....V.(.....
..l...l.
17:16:31.017514 IP localhost.19870 > localhost.52287: Flags [F.], seq 1, ack 1, win 342, options [nop,nop,TS val 27880591 ecr 27880590], length 0
E..4.F@.@."|........M..?..v....Y...V.(.....
..l...l.
17:16:31.019472 IP localhost.52287 > localhost.19870: Flags [F.], seq 1, ack 2, win 342, options [nop,nop,TS val 27880591 ecr 27880591], length 0
E..4..@.@.w..........?M....Y..v....V.(.....
..l...l.
17:16:31.019493 IP localhost.19870 > localhost.52287: Flags [.], ack 2, win 342, options [nop,nop,TS val 27880591 ecr 27880591], length 0
E..4.G@.@."{........M..?..v....Z...V.(.....
..l...l.
```
Repository: go
Issue: cmd/cgo: signal arrived during external code execution that calls setjmp on Windows
Labels: help wanted,OS-Windows,NeedsFix

Processor Intel(R) Core(TM) i7-4790 CPU @ 3.60GHz
OS: Windows 7 64
golang:1.5.2
gcc:mingw-w64 version 5.2.0 x86_64-posix-seh-rt_v4-rev1

When I compile golang with some external c code which using the setjmp and longjmp,the program crash.

My c code is here (It's in a c file in a directory which implements package lua)

```
#include <stdio.h>
#include <setjmp.h>
void Print(){
    jmp_buf c;
    if(setjmp(c)==0){
        longjmp(c,1);
    }
    else{
        printf("receive an exception\n");
    }
}
```

My go code

```
package main
import "github.com/redstorm-fyy/go-lua/lua"
func main() {
    lua.Print()
}
```

Important!
It crashes when the c code is in an external file.When the c code is just up the .go file's import "C",It does not crash.

Crash information
Exception 0xc0000028 0x0 0x0 0x77b096f8
PC=0x77b096f8
signal arrived during external code execution

github.com/redstorm-fyy/go-lua/lua._Cfunc_Print()
    ??:0 +0x38
github.com/redstorm-fyy/go-lua/lua.Print()
    E:/GolangRoot/src/github.com/redstorm-fyy/go-lua/lua/luago.go:587 +0x1b
main.main()
    E:/GolangRoot/src/github.com/redstorm-fyy/go-lua/example/exam.go:6 +0x1b

goroutine 17 [syscall, locked to thread]:
runtime.goexit()
    c:/go/src/runtime/asm_amd64.s:1721 +0x1
rax     0xf
rbx     0xc0000028
rcx     0x22ebd0
rdi     0x22c000
rsi     0x22f7b0
rbp     0x22f230
rsp     0x22eb10
r8      0x0
r9      0x400000
r10     0x0
r11     0x22f330
r12     0x22fe60
r13     0x22fdb0
r14     0x4013e8
r15     0x584024
rip     0x77b096f8
rflags  0x202
cs      0x33
fs      0x53
gs      0x2b