sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: database/sql: common interface for query functions in sql.DB and sql.Tx
Labels: NeedsInvestigation

Hi,

I'm proposing a interface that implements all functions in `sql.DB` and `sql.Tx` that takes a `query string` as one of its arguments. This could be useful when implementing "dumb" functions that retrieves information but in itself dose not need to be prepared however might be used to verify whether to commit or rollback.

The interface I'm proposing is: (The name can of course be changed)

``` go
type QueryAble interface {
    Exec(query string, args ...interface{}) (sql.Result, error)
    Prepare(query string) (*sql.Stmt, error)
    Query(query string, args ...interface{}) (*sql.Rows, error)
    QueryRow(query string, args ...interface{}) *sql.Row
}
```

This is an example function `Get` that can be used with or without transactions.

``` go
func Get (q Queryable)(int){
    var test int
    res , _ := q.Query("SELECT COUNT(*) FROM table;")
    res.Next()
    res.Scan(&test)
    res.Close()
    return test
}

func GetExample(db *sql.DB){

    //When you just want to retrieve the information, no need for a transaction
    fmt.Printf("Current len of Table %d\n", Get(db))

    //Make a change
    tx, _ :=db.Begin()
    // Add data to table
    if  Get(tx) > 2 {
        fmt.Printf("Table to large: %d robacking to: %d \n", Get(tx) , Get(db))
        tx.Rollback()
    } else {
        fmt.Printf("Table update new len %d\n", Get(tx))
        tx.Commit()
    }
}
```
Repository: go
Issue: tour: Add tests for web crawler task
Labels: Documentation,help wanted,NeedsInvestigation

Context: https://tour.golang.org/concurrency/10

I think web crawler task is harder than it looks. I saw a lot of solutions and all of them are wrong, even the [official one](https://github.com/golang/tour/blob/master/solutions/webcrawler.go).
In order to prove that I have written [some tests](https://github.com/amorgun/go-tour-crawler) and script to run them on multiple solutions. You can see results [here](https://travis-ci.org/amorgun/go-tour-crawler/builds/111213009).
I suggest adding these tests to the task the same way as in the [word count task](https://tour.golang.org/moretypes/20).
Repository: youtube-dl
Issue: add support for LCP replay
Labels: site-support-request

LCP (aka La Chaîne Parlementaire) is the french national assembly TV channel.
It has a replay web site that doesn't seems to be handled by youtube-dl.
e.g. http://www.lcp.fr/emissions/transportez-moi 
could youtube-dl support this web site ?
Repository: vscode
Issue: [folding] Collapse ending brace to the same line
Labels: feature-request,editor-folding

Consider a large JavaScript file

``` js
function a() {
  ...
}

function b() {
  ...
}

function c() {
  ...
}

and so on...
```

Collapsing all currently yields:

``` js
function a() { ...
}

function b() { ...
}

function c() { ...
}

and so on...
```

This would be more readable if the closing brace was on the same line:

``` js
function a() { ... }

function b() { ... }

function c() { ... }

and so on...
```

---

Here is how other prominent editors handle the above:

**Atom**

![image](https://cloud.githubusercontent.com/assets/2193314/13259023/7d4c38d2-da0a-11e5-9407-f1c7de7c4a61.png)

**Brackets**

![image](https://cloud.githubusercontent.com/assets/2193314/13259033/8d71e2f2-da0a-11e5-9934-378ecb450179.png)

**Sublime Text 3**

![image](https://cloud.githubusercontent.com/assets/2193314/13259075/aeb3e97e-da0a-11e5-9b0a-7ff709146520.png)

---

**VS Code**

![image](https://cloud.githubusercontent.com/assets/2193314/13259189/29190a8c-da0b-11e5-97bd-3513fb837097.png)
Repository: rust
Issue: Tracking issue for specialization (RFC 1210)
Labels: A-trait-system,B-RFC-approved,T-lang,B-unstable,I-unsound,A-specialization,B-RFC-implemented,C-tracking-issue,requires-nightly,F-specialization,S-tracking-design-concerns

This is a tracking issue for specialization (rust-lang/rfcs#1210).

Major implementation steps:
- [x] Land https://github.com/rust-lang/rust/pull/30652 =)
- [ ] Restrictions around lifetime dispatch (currently a **soundness hole**)
- [ ] `default impl` (https://github.com/rust-lang/rust/issues/37653)
- [ ] Integration with associated consts
- [ ] Bounds not always properly enforced (https://github.com/rust-lang/rust/issues/33017)
- [ ] Should we permit empty impls if parent has no `default` members? https://github.com/rust-lang/rust/issues/48444
- [ ] implement "always applicable" impls https://github.com/rust-lang/rust/issues/48538
- [ ] describe and test the precise cycle conditions around creating the specialization graph (see e.g. [this comment](https://github.com/rust-lang/rust/pull/70535#discussion_r401685535), which noted that we have some very careful logic here today)

Unresolved questions from the RFC:
- Should associated type be specializable at all?
- When should projection reveal a `default type`? Never during typeck? Or when monomorphic?
- Should default trait items be considered `default` (i.e. specializable)?
- Should we have `default impl` (where all items are `default`) or `partial impl` (where `default` is opt-in); see https://github.com/rust-lang/rust/issues/37653#issuecomment-616116577 for some relevant examples of where `default impl` is limiting.
- How should we deal with lifetime dispatchability?

Note that the `specialization` feature as implemented currently is *unsound*, which means that it can cause Undefined Behavior without `unsafe` code. [`min_specialization` avoids most of the pitfalls](https://github.com/rust-lang/rust/pull/68970).

---

Tracking issues have a tendency to become unmanageable. Please open a dedicated new issue and label it with F-specialization for absolutely any topics you want to discuss or have questions about. See https://github.com/rust-lang/compiler-team/issues/739 for details and discussions on this prospective policy.
Repository: javascript
Issue: single return vs multiple returns
Labels: question

I see some examples of multiple returns but don't see any guidelines defined that say it explicitly.
Is there a preference between a single return where a variable is assigned the output value vs just having multiple return statements?

```
function isGood(battery) {
  if (battery.charge) {
    return true;
  }

  if (battery.cycles < 10) {
    return true;
  }

  return false;
}
```

vs. 

```
function isGood(battery) {
  let out = false;
  if (battery.charge) {
    out = true;
  }

  if (battery.cycles < 10) {
    out = true;
  }

  return out;
}
```
Repository: rust
Issue: Allow linking against dylibs in LTO mode
Labels: A-linkage,C-feature-request,-Cprefer-dynamic

I would like to build a binary that links against some crates using LTO and others dynamically.  (Why?  Because I have a dynamic library that contains all of LLVM and is 30MB, slowing down linking.  Note that this is not LLVM's own dynamic library, it's a Rust crate compiled to dylib that itself links LLVM statically.  One might imagine more generic use cases, e.g. LTOing small dependencies and dynamically linking large ones.)  Here's a model:

`xa.rs`:

``` rust
#![crate_type = "bin"]
extern crate xb;
extern crate xc;
pub fn main() { xb::b(); xc::c(); }
```

`xb.rs`:

``` rust
#![crate_type = "rlib"]
pub fn b() {}
```

`xc.rs`:

``` rust
#![crate_type = "dylib"]
pub fn c() {}
```

This can be built successfully without LTO, albeit only if the dylib links libstd dynamically (otherwise you get "cannot satisfy dependencies so `std` only shows up once"):

```
rustc ../xc.rs -C prefer-dynamic -L. && rustc ../xb.rs -L. && rustc ../xa.rs -L.
```

The binary `xa` contains the code from `xa.rs` and `xb.rs` linked statically (but with a conventional linker rather than LTO), and dynamically links against `libxc.dylib` and libstd.

But if the last command includes `-C lto`, I just get:

```
error: could not find rlib for: `xc`
```

It would be nice if rustc supported this.

In principle support could also be added for combining LTO and non-LTO static linking, but that would require some method to identify which is desired, since both types refer to `.rlib` files.
Repository: go
Issue: net: TestCgoLookupIP fails on brillo
Labels: Testing

 Reproducible on Qualcomm Dragonboard 410c, Brillo image built with BDK 7.5.4.

```
go_android_exec: adb shell mkdir -p /mnt/media_rw/tmp/net.test-55266
go_android_exec: adb push /var/folders/00/1b8h8000h01000cxqpysvccm005d21/T/go-build559449628/net/_test/net.test /mnt/media_rw/tmp/net.test-55266/net.test-55266-tmp
1358 KB/s (5223788 bytes in 3.754s)
go_android_exec: adb shell cp '/mnt/media_rw/tmp/net.test-55266/net.test-55266-tmp' '/mnt/media_rw/tmp/net.test-55266/net.test-55266'
go_android_exec: adb shell rm '/mnt/media_rw/tmp/net.test-55266/net.test-55266-tmp'
go_android_exec: adb shell export TMPDIR="/mnt/media_rw/tmp/net.test-55266"; export GOROOT="/mnt/media_rw/goroot/"; export GOPATH="/mnt/media_rw/gopath/"; cd "/mnt/media_rw/goroot/src/net"; '/mnt/media_rw/tmp/net.test-55266/net.test-55266' -test.short=true -test.timeout=6m0s; echo -n exitcode=$?
--- FAIL: TestCgoLookupIP (0.01s)
    cgo_unix_test.go:19: lookup localhost: No address associated with hostname
    cgo_unix_test.go:22: lookup localhost on [::1]:53: read udp [::1]:58014->[::1]:53: read: connection refused
FAIL
```
Repository: go
Issue: syscall: TestLinuxDeathSignal fails on brillo
Labels: compiler/runtime

Reproducible on Qualcomm Dragonboard 410c, Brillo image built with BDK 7.5.4.

```
go_android_exec: adb shell mkdir -p /mnt/media_rw/tmp/syscall.test-55724
go_android_exec: adb push /var/folders/00/1b8h8000h01000cxqpysvccm005d21/T/go-build559449628/syscall/_test/syscall.test /mnt/media_rw/tmp/syscall.test-55724/syscall.test-55724-tmp
2842 KB/s (3472036 bytes in 1.192s)
go_android_exec: adb shell cp '/mnt/media_rw/tmp/syscall.test-55724/syscall.test-55724-tmp' '/mnt/media_rw/tmp/syscall.test-55724/syscall.test-55724'
go_android_exec: adb shell rm '/mnt/media_rw/tmp/syscall.test-55724/syscall.test-55724-tmp'
go_android_exec: adb shell export TMPDIR="/mnt/media_rw/tmp/syscall.test-55724"; export GOROOT="/mnt/media_rw/goroot/"; export GOPATH="/mnt/media_rw/gopath/"; cd "/mnt/media_rw/goroot/src/syscall"; '/mnt/media_rw/tmp/syscall.test-55724/syscall.test-55724' -test.short=true -test.timeout=6m0s; echo -n exitcode=$?
death signal parent error: fork/exec /mnt/media_rw/tmp/syscall.test-55724/TestDeathSignal002741875/syscall.test-55724: permission denied
--- FAIL: TestLinuxDeathSignal (0.12s)
    syscall_linux_test.go:98: did not receive start from child, received "", EOF
FAIL
exitcode=1go_android_exec: adb shell rm -rf /mnt/media_rw/tmp/syscall.test-55724
FAIL    syscall 2.616s
```
Repository: TypeScript
Issue: noImplicitAny incorrectly permits 'any' when returned via arrow function
Labels: Bug,Help Wanted

_Apologies for the vague title, I can't quite pin down the cause of this, hence the poor wording_

```
$ tsc --version
1.9.0-dev.20160208
```

The problem is best described using the following example:

``` typescript
// using --noImplicitAny

let a = undefined;  // OK: error as expected: Variable 'a' implicitly has an 'any' type.

function mine<T>(meth: () => T): T {
    return meth();
}

// **Problem**: x has type 'any' below
// Should be a compiler error
let x = mine(() => {
    return undefined;
});
```
Repository: flutter
Issue: RenderBlockViewport should override debugAssertDoesMeetConstraints to verify intrinsics match itemExtent
Labels: team,framework,P3,team-framework,triaged-framework

If itemExtent is set, then the totalExtentCallback's return value should be an even multiple of the itemExtent.
Repository: neovim
Issue: Implement :gui in at least a minimal form?
Labels: enhancement,ui,server,ui-extensibility,remote

One of the main things keeping me from using neovim is that my workflow centers too heavily around starting with vim in a terminal, then using `:gui` to reclaim the terminal once I've determined whether I want to keep it around.

I was thinking about how one might implement `:gui` without forcing a GUI to be built into neovim and here's the best idea I came up with:
1. `:gui` causes nvim to relinquish the terminal and launch a configurable command with persistence of state achieved via some kind of command-line argument, either representing a socket or serialized into some sort of state identifier as used by the X Session Management Protocol.
2. The command is configured via `init.vim` with the default being something like `xterm -e nvim <state token>`.

(If you wanted to be smarter about it, there's an `xdg-terminal` companion to `xdg-open` which apparently just needs a little maintainership to graduate into being part of the `xdg-utils` tarballs.)

On my system, I'd probably set it to `screen nvim <state token>` since I use GNU screen to implement tabbing in my urxvt_kuake terminal.

If someone wanted a more traditional GUI, they could use something like `urxvt -name neovim -e nvim <state token>` or, with appropriate adjustments to neovim-qt, `nvim-qt <state token>`.
Repository: kubernetes
Issue: All controllers should raise events when they can't create objects as expected
Labels: priority/important-soon,area/controller-manager,sig/autoscaling,kind/feature,sig/apps,lifecycle/frozen

This is coming from https://github.com/kubernetes/kubernetes/issues/21079#issuecomment-182967854:

All controllers should raise events when they can't create objects as expected (Pods, ReplicaSets, whatever), except when namespace deletion is in progress.

cc @piosz @mwielgus @jszczepkowski @madhusudancs @janetkuo @kargakis @mikedanese @erictune @bgrant0607
Repository: vscode
Issue: [themes] Themes don't support background styling
Labels: feature-request,debt,themes

.tmTheme files allow specification of background colors which don't seem to be supported, for example:

``` xml
<dict>
  <key>name</key>
  <string>Separator</string>
  <key>scope</key>
  <string>meta.separator</string>
  <key>settings</key>
  <dict>
    <key>background</key>
    <string>#E0E0E0</string>
    <key>foreground</key>
    <string>#373B41</string>
  </dict>
</dict>
```

This is especially problematic for themes that attempt to invert background and use a similar foreground to the text view's background color (https://github.com/Microsoft/vscode/issues/2158)
Repository: rust
Issue: Error to enable feature gate prevents error from incorrect placement of feature gate
Labels: A-diagnostics,A-stability,T-compiler,C-bug

Suppose I'm on nightly and I try to use gated syntax in a module (other than the crate root).  As expected, I get an error:

```
feature_gated.rs:3:5: 3:10 error: box expression syntax is experimental; you can call `Box::new` instead. (see issue #27779)
feature_gated.rs:3     box 2;
                       ^~~~~
feature_gated.rs:3:5: 3:10 help: add #![feature(box_syntax)] to the crate attributes to enable
```

An easy mistake to make is to misunderstand "crate attributes" and add the suggested feature attribute to the top of the current file instead.  The problem is that if I do so, rustc doesn't tell me what I did wrong: it just seems to silently ignore the attribute.

In fact, there is a lint that triggers on the attribute:

```
feature_gated.rs:1:1: 1:24 warning: crate-level attribute should be in the root module, #[warn(unused_attributes)] on by default
feature_gated.rs:1 #![feature(box_syntax)]
```

...but it only shows up if I remove the gated syntax to allow compilation to proceed to that phase.  This doesn't help someone stuck on the original error.
Repository: youtube-dl
Issue: Support for mixcrate.com
Labels: site-support-request

Example url: http://www.mixcrate.com/kanyeasada/kiss-kiss-bang-bang-volume-4-10313280

Starting to play the song the mp3 source file is visible in the network manager so shouldn't be too big a task to parse?
Repository: TypeScript
Issue: JSDoc property and memberof does not work in salsa
Labels: Suggestion,In Discussion,Domain: JSDoc,Domain: JavaScript

Since we cannot register intellisense by set a value directly. salsa should support `@memberof` or `@property` tag

![image](https://cloud.githubusercontent.com/assets/1042507/13315767/5cdd23f0-dbdf-11e5-9b32-8caebbae1705.png)

It also useful for extension method, set a prototype like this cannot registered in intellisense

![image](https://cloud.githubusercontent.com/assets/1042507/13315841/bed7f558-dbdf-11e5-9018-6cbb0fa51b26.png)

Which, I think we don't need automatic intellisense in case like this, but please provide some way we could write JSDoc to register custom member on intellisense
Repository: go
Issue: regexp: match additional Unicode properties
Labels: NeedsDecision,FeatureRequest,early-in-cycle

The [docs](https://golang.org/pkg/regexp/syntax/) (and [the RE2 docs](https://github.com/google/re2/wiki/Syntax)) describe how to match Unicode properties by using `\p{…}` inside a character class:

> [snip]
> 
> <table>
> <tr><td><code>[\p{Name}]</code></td><td>named Unicode property inside character class (≡ <code>\p{Name}</code>)</td></tr>
> <tr><td><code>[^\p{Name}]</code></td><td>named Unicode property inside negated character class (≡ <code>\P{Name}</code>)</td></tr>
> </table>
> 
> [snip]

The current implementation doesn't seem to do it, though. The [code which matches `\p`](https://github.com/golang/go/blob/30f93f09944c54147bec9e5c39631f17addd94c7/src/regexp/syntax/parse.go#L1501) uses a single [`unicodeTable()`](https://github.com/golang/go/blob/30f93f09944c54147bec9e5c39631f17addd94c7/src/regexp/syntax/parse.go#L1442-L1454) helper function which only looks at `unicode.Categories` and `unicode.Scripts`. There probably needs to be a separate helper, or a flag passed to this one, which makes it look at properties.
Repository: go
Issue: tour: [confusing description of interfaces]
Labels: NeedsInvestigation

Context: https://tour.golang.org/methods/9

The text on the left reads

> A value of interface type can hold any value that implements those methods.

I'm not an advanced Go programmer and this is the first time I encounter this expression

> any value that implements those methods

in the Tour.

Because I don't find its semantics obvious, I'm interested in knowing whether I should the first quote along the lines of 

> A value of interface type can hold any value whose type appears as the receiver of a method whose signature is listed in the interface type

In any case, could you please consider rephrasing the original expression so that it's clearer?

Thanks!
Repository: go
Issue: cmd/link: include declared constants in DWARF
Labels: Debugging,compiler/runtime

Currently the DWARF information does not include constant symbols (such as `const x = 1`). This can make debugging more difficult, as constants available to the program are not available in the debugger. It also causes problems for debugging helpers. For example, our own runtime-gdb.py GDB helper hard-codes the G status constant values. This list gets out of date and means we can't cull now-unused G statuses.

We should include constants in the DWARF information. DWARF has a DW_TAG_constant for exactly this. The DW_AT_const_value attribute can be a string or any constant form, including DW_FORM_sdata, which is encoded as a LEB128, so in principle it can store arbitrary precision integers (though I don't know how well this is supported in practice). It's not clear to me how to represent floating point constants, though I suspect we'd have to truncate them to 64-bit precision to get them to actually work (despite DWARF's dizzying array of numeric type encodings; scaled packed decimal anyone?).

Doing this would be difficult right now because the compiler would have to emit constants in a way the linker could consume to produce DWARF information. It would probably be relatively straightforward if we switched to producing DWARF directly in the compiler.

/cc @ribrdb @derekparker
Repository: opencv
Issue: Bad ORB descriptors match on Mac
Labels: bug,category: features2d

I am doing some tests using ORB for both features detection and descriptors extraction on Windows and Mac. I get good results on Windows but the ones on Mac do not make any sense to me.
Here is a simple code snippet to reproduce the problem, I'm loading two example images found in openCV package

```
   ` // load images
cv::Mat img1 = cv::Mat(imread("./box.png", cv::IMREAD_GRAYSCALE));
cv::Mat img2 = cv::Mat(imread("./box_in_scene.png", cv::IMREAD_GRAYSCALE));

if (!img1.data || !img2.data) {
    std::cout << " --(!) Error reading images " << std::endl; return -1;
}

// find key points
cv::Ptr<cv::ORB> orb;
orb = cv::ORB::create();

// img 1
std::vector<cv::KeyPoint> image1KeyPoints;
cv::Mat image1Descriptors;
try {
    orb->detectAndCompute(img1, cv::Mat(), image1KeyPoints, image1Descriptors);
}
catch (const cv::Exception &ee) {
    std::cout << " --(!) Error finding key points on image 1 " << ee.what() << std::endl; return;
}
std::cout << " --Found " << image1KeyPoints.size() << " key points on image 1 " << std::endl;

// img 2
std::vector<cv::KeyPoint> image2KeyPoints;
cv::Mat image2Descriptors;
try {
    orb->detectAndCompute(img2, cv::Mat(), image2KeyPoints, image2Descriptors);
}
catch (const cv::Exception &ee) {
    std::cout << " --(!) Error finding key points on image 2 " << ee.what() << std::endl; return;
}
std::cout << " --Found " << image2KeyPoints.size() << " key points on image 2 " << std::endl;


// find matching points
cv::BFMatcher matcher(cv::NORM_HAMMING, true);
std::vector<cv::DMatch> matches;
// return all matches
try {
    matcher.match(image1Descriptors, image2Descriptors, matches);
}
catch (const cv::Exception &ee) {
    std::cout << " --(!) Error matching points! " << ee.what() << std::endl; return;
}
// sort matches by distance
std::sort(matches.begin(), matches.end());

for(int i = 0; i < 10; i++) {
    printf("%d MATCH dist %.4f\n", i, matches[i].distance);
}`
```

The output I get on Windows is 

--Found 500 key points on image 1
 --Found 500 key points on image 2

0 MATCH dist 18.0000
1 MATCH dist 23.0000
2 MATCH dist 23.0000
3 MATCH dist 28.0000
4 MATCH dist 31.0000
5 MATCH dist 31.0000
6 MATCH dist 33.0000
7 MATCH dist 33.0000
8 MATCH dist 34.0000
9 MATCH dist 34.0000

The output I get on Mac is

--Found 500 key points on image 1
 --Found 500 key points on image 2
0 MATCH dist 3.0000
1 MATCH dist 3.0000
2 MATCH dist 7.0000
3 MATCH dist 7.0000
4 MATCH dist 9.0000
5 MATCH dist 9.0000
6 MATCH dist 10.0000
7 MATCH dist 10.0000
8 MATCH dist 11.0000
9 MATCH dist 11.0000

The distance between matches is completly different.

I'm doing this test on a Windows 7 machine with openCV lib compiled in 32 bit and on a Mac OS X 10.10.5 with openCV compiled in 32 bit.
Repository: go
Issue: gccgo: too many syntax errors for a simple mistake
Labels: NeedsInvestigation

Reduced from feedback I received from a student taking a class using Go.

The mistake in this program is the `int` in `for int i := 0`.

```
$ cat x.go
package p

func f() {
    for int i := 0; i < n; i++ {
        println(i)
    }
}
```

The gc compiler and the go/parser both print two not terribly helpful syntax errors, but probably good enough:

```
$ go tool compile x.go
x.go:4: syntax error: unexpected name, expecting {
x.go:7: syntax error: unexpected }

$ gofmt x.go
x.go:4:10: expected '{', found 'IDENT' i
x.go:7:3: expected '}', found 'EOF'
```

Gccgo prints lots of errors:

```
$ gccgo x.go
x.go:4:10: error: expected ‘{’
  for int i := 0; i < n; i++ {
          ^
x.go:4:10: error: expected ‘;’ or ‘}’ or newline
x.go:4:29: error: expected ‘;’ or ‘}’ or newline
  for int i := 0; i < n; i++ {
                             ^
x.go:7:1: error: expected declaration
 }
 ^
x.go:4:18: error: reference to undefined name ‘i’
  for int i := 0; i < n; i++ {
                  ^
x.go:4:22: error: reference to undefined name ‘n’
  for int i := 0; i < n; i++ {
                      ^
x.go:4:25: error: reference to undefined name ‘i’
  for int i := 0; i < n; i++ {
                         ^
x.go:4:6: error: expected boolean expression
  for int i := 0; i < n; i++ {
      ^
x.go:4:6: error: invalid use of type
x.go:4:20: error: value computed is not used
  for int i := 0; i < n; i++ {
                    ^
```

It does seem a little excessive. I'm a bit surprised that gccgo tries to type-check a program with syntax errors at all.

/cc @ianlancetaylor @paranoiacblack