sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: net: isDomainName rejects valid domains
Labels: NeedsDecision

`isDomainName` is limited to hostname-compatible "preferred name" LDH labels, with an exception made for underscores per #1167. But [RFC 2181](https://tools.ietf.org/html/rfc2181#section-11) is clear about _any_ octet being valid in a DNS label:

> Those [length] restrictions aside, any binary string whatever can be used as the label of any resource record.

### What version of Go are you using (`go version`)?

go1.7.1

### What operating system and processor architecture are you using (`go env`)?

<details><summary>linux/amd64</summary>

GOARCH="amd64"
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build693750050=/tmp/go-build -gno-record-gcc-switches"
CXX="g++"
CGO_ENABLED="1"
</details>

### What did you do?

<details><summary>query uncommon domain names</summary>

```go
package main

import (
    "fmt"
    "net"
)

func main() {
    domains := []string{
        `*.golang.org`,
        `\.\.\..golang.org`,
        `\065.golang.org`,
        `\000.golang.org`,
    }
    for _, domain := range domains {
        fmt.Printf("\n%s\n", domain)
        fmt.Println(net.LookupHost(domain))
    }
}
```

</details>

### What did you expect to see?

<details><summary>successful DNS queries</summary>

```
*.golang.org
[216.58.219.209 2607:f8b0:4006:80e::2011] <nil>

\.\.\..golang.org
[216.58.219.209 2607:f8b0:4006:80e::2011] <nil>

\065.golang.org
[216.58.219.209 2607:f8b0:4006:80e::2011] <nil>

\000.golang.org
[216.58.219.209 2607:f8b0:4006:80e::2011] <nil>
```

</details>

### What did you see instead?

<details><summary>valid names were rejected</summary>

```
*.golang.org
[] lookup *.golang.org: invalid domain name

\.\.\..golang.org
[] lookup \.\.\..golang.org: no such host

\065.golang.org
[216.58.219.209 2607:f8b0:4006:80e::2011] <nil>

\000.golang.org
[] lookup \000.golang.org: no such host
```

</details>
Repository: rust
Issue: Generic Fn wrapper breaks without type annotations
Labels: C-enhancement,A-closures,T-compiler,A-inference

I have a generic `FnWrapper` struct for closures that take a `&i32` as their only parameter, and a generic `apply` function that consumes such wrappers (not directly, but via `Foo` trait).

``` rust
trait Foo {
    fn foo(self, value: &i32);
}

struct FnWrapper<F>(F);

impl<F: FnOnce(&i32)> Foo for FnWrapper<F> {
    fn foo(self, value: &i32) {
        (self.0)(value);
    }
}

fn apply<F: Foo>(_: F) {}

fn main() {
    // Error.
    apply(FnWrapper(|_| {}));

    // Ok with type annotations.
    apply(FnWrapper(|_: &i32| {}));
}
```

[Run in playground](https://play.rust-lang.org/?gist=c3b691fefa7325d69fdfc3b54eaa3c19&version=nightly&backtrace=0).

When invoking `apply` without any annotations, compiler complains about:

```
error[E0271]: type mismatch resolving `for<'r> <[closure@<anon>:17:21: 17:27] as std::ops::FnOnce<(&'r i32,)>>::Output == ()`
  --> <anon>:17:5
   |
17 |     apply(FnWrapper(|_| {}));
   |     ^^^^^ expected bound lifetime parameter , found concrete lifetime
   |
   = note: concrete lifetime that was found is lifetime '_#0r
   = note: required because of the requirements on the impl of `Foo` for `FnWrapper<[closure@<anon>:17:21: 17:27]>`
   = note: required by `apply`

error[E0281]: type mismatch: the type `[closure@<anon>:17:21: 17:27]` implements the trait `std::ops::FnOnce<(_,)>`, but the trait `for<'r> std::ops::FnOnce<(&'r i32,)>` is required (expected concrete lifetime, found bound lifetime parameter )
  --> <anon>:17:5
   |
17 |     apply(FnWrapper(|_| {}));
   |     ^^^^^
   |
   = note: required because of the requirements on the impl of `Foo` for `FnWrapper<[closure@<anon>:17:21: 17:27]>`
   = note: required by `apply`
```

Simply adding type annotation to the closure parameter will make this compile, so it looks like a bug to me.
Repository: go
Issue: x/net/html: Allow getting HTML attribute values without unescape
Labels: FeatureRequest

### What version of Go are you using?

go1.7.3
### What operating system and processor architecture are you using?

linux/amd64
### What did you do?

I'm working on an HTML sanitizer, where I want to access the original escaped HTML attribute values during the parse.
### What did you expect to see?

An ideal solution to me would be a flag in the `Tokenizer` which could indicate if unescaping is required or not when calling `TagAttr()`.
If you find this useful, i can implement it, or if you have any better idea, please reply.
### What did you see instead?

As I see, currently the only option is `Tokenizer.TagAttr()` which automatically unescapes attribute values: https://github.com/golang/net/blob/master/html/token.go#L1158 .
Escaping again the unescaped attribute values can be a solution, but that re-escaping adds computational and structural complexity to the program what I want to avoid if possible.

thanks,
a
Repository: TypeScript
Issue: TypeScript refuses to emit files from node_modules with getEmitOutput()
Labels: Bug

Hi. In out company we use workflow when all packages are written in pure TypeScript and we publish and consume them as-is, without any pre-compilation. I know that it's slower, but it's very convenient for developers, because they don't need to run several parallel `tsc --watch` processes.

We used `webpack` and `awesome-typescript-loader` for this and everything worked fine. But I see that now TypeScript refuses to emit files from `node_modules` directory using `getEmitOutput()`, because of `isSourceFileFromExternalLibrary` check [here](https://github.com/Microsoft/TypeScript/blob/master/src/compiler/utilities.ts#L2622).

Can we make this configurable?
Repository: angular
Issue: Allow CanActivate[Child] Guards to be "blocking"
Labels: feature,area: router,feature: under consideration

**I'm submitting a ...**  (check one with "x")
```
[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
```

**Current behavior**
CanActivate[Child] Guards run, parent-first, in parallel, meaning there is no way to resolve data in a parent that may be needed in child guards, unless managed explicitly elsewhere.

**Expected behavior**
A CanActivate[Child] guard's behavior could possibly be set to block children guards from.

**Minimal reproduction of the problem with instructions**
```javascript
{
        path: 'parent',
        canActivateChild: [FiveSecondObservableGuard], // Takes a long time
        children: [
            {
                path: 'child',
                component: ChildComponent, // waits a long time, as expected
                canActivate: [AuthGuard] // Runs immediately
            }
]
}
```

**What is the motivation / use case for changing the behavior?**
Loading server information/flags that are required in all Guards can now be done in two ways:
- in `APP_INITIALIZER`, which severely hinders UX choices/flexibility
- Making all requests for server data asynchronous, making the whole codebase needlessly complex.

When a certain branch of routes is behind an AuthGuard that may need asynchronous loading, while the components respect the Guard the Guards themselves (which may require user identification to be complete) won't necessarily have access to that (unless all data is made asynchronous, as mentioned above)

* **Angular version:** 2.0.X

* **Browser:** all
 
* **Language:** all
Repository: three.js
Issue: Proposed: Order Independent Transparency
Labels: Suggestion,Bounty

##### Description of the problem 

We (@Jozain and myself) are currently implementing out-of-order transparency for ThreeJS for a project of ours.  We'd like to contribute it back.  We are implementing the method of Morgan Mcguire, Weighted-Blended Order Independent Transparency: http://casual-effects.blogspot.ca/2014/03/weighted-blended-order-independent.html

We are helped a lot by @arose's example OIT code on which our stuff will be partially based, just our stuff will be designed into the core of Three.JS: https://github.com/mrdoob/three.js/issues/4814

Here is an proposed example of how to enable this mode:

```javascript
var renderer = new THREE.WebGLRendererer( .... );

// add new "transparency" variable to renderer to select the transparency rendering mode
//renderer.transparency = THREE.PaintersTransparency; // the current ThreeJS method, the painter's algorithm
renderer.transparency = THREE.OrderIndependentTransperancy; // the new OIT method
```

This mode will be implemented by a new WebGLOrderIndependentTransparency class that will be responsible for managing the buffers.  It will create two additional RenderTargets that will track the size of the current render buffer.  The first will be the accumulation buffer which we will render all transparency objects to and then we will render the objects as well to some alpha product buffers - thus two separate renders.  This will be followed by a "resolve" stage that renders the transparent objects over top of the existing beauty render of the opaque objects.

This workflow will work with base WebGL and work with multi-sample buffers as well.  It can obviously be speed up using multiple render targets, but this shouldn't be that slow for non-huge numbers of transparent objects.

We are going to implement this now, just wanted to give a heads up as to our design so that if you have feedback on it, we can incorporate it now.

/ping @WestLangley @arose @spidersharma03
Repository: go
Issue: x/tools/refactor/rename: doesn't work on Windows
Labels: OS-Windows,Tools,Refactoring

Go 1.7
Windows 64 Bit

I hope, I fixed the problem with go move package under windows.

bradfitz outcommented the tests for windows.
Now they work.


There was a tiny replace oversight - 
from [unix] package path to [windows] file path.

https://play.golang.org/p/76oMBOgedE

Here is the patch

```patch
diff --git a/refactor/rename/mvpkg.go b/refactor/rename/mvpkg.go
index cd416c5..eed338a 100644
--- a/refactor/rename/mvpkg.go
+++ b/refactor/rename/mvpkg.go
@@ -80,7 +80,8 @@ func Move(ctxt *build.Context, from, to, moveTmpl string) error {
 			affectedPackages[r] = true
 		}
 		// Ensure directories have a trailing separator.
-		dest := strings.Replace(pkg,
+		dest := strings.Replace(
+			filepath.Join(pkg, ""),
 			filepath.Join(from, ""),
 			filepath.Join(to, ""),
 			1)
diff --git a/refactor/rename/mvpkg_test.go b/refactor/rename/mvpkg_test.go
index 674fe6c..ba2536a 100644
--- a/refactor/rename/mvpkg_test.go
+++ b/refactor/rename/mvpkg_test.go
@@ -12,7 +12,6 @@ import (
 	"path/filepath"
 	"reflect"
 	"regexp"
-	"runtime"
 	"strings"
 	"testing"
 
@@ -114,9 +113,9 @@ var _ foo.T
 }
 
 func TestMoves(t *testing.T) {
-	if runtime.GOOS == "windows" {
-		t.Skip("broken on Windows; see golang.org/issue/16384")
-	}
+	// if runtime.GOOS == "windows" {
+	// 	t.Skip("broken on Windows; see golang.org/issue/16384")
+	// }
 	tests := []struct {
 		ctxt         *build.Context
 		from, to     string

```
Repository: go
Issue: fmt: support bounded buffers (Snprint, Snprintf, etc.)
Labels: NeedsFix,FeatureRequest

Right now, printing large compound objects with %v or %#v can be very expensive, in terms of both CPU and RAM. It would be great to have a way for callers to tell formatting code to stop after N runes have been output. The current alternative is formatting everything anyway, only to discard most of the work after the call returns.
Repository: TypeScript
Issue: Dynamic Super Types
Labels: Suggestion,Awaiting More Feedback

Now, that #11929 is PR landed. I would really love to have some syntax to specify an arbitrary `super type of T`. This can be especially helpful in creating strongly typed ORM database frameworks.

## Proposal

If `K` is constrained to be a key of `T` i.e `K extends keyof T`. Then the syntax:

```
{ ...K: ...T[K] }
```
Means spread the keys `K` and values of `T` in `{}`.

## Example
Here is an example usage of an envisioned ORM framework:
```ts
interface IUser {
    id: string;
    name: string;
    email: string;
    createdAt: string;
    updatedAt: string;
    password: string;
    // ...
}

interface Options<T, K extends keyof T> {
     attributes: T[K][];
}

interface Model<IInstance> {
     findOne<K extends keyof IInstance>(options: Options<IInstance, K>): { ...K: ...IInstance[K] };
}

declare namespace DbContext {
   define<T>(): Model<T>;
}

const Users = DbContext.define<IUser>({
   id: { type: DbContext.STRING(50), allowNull: false },
   // ...
});

const user = Users.findOne({
    attributes: ['id', 'email', 'name'],
    where: {
        id: 1,
    }
});

user.id // no error
user.email // no error
user.name // no error

user.password // error 
user.createdAt // error
user.updatedAt // error
```
Repository: go
Issue: runtime: preemption takes longer on OpenBSD
Labels: OS-OpenBSD,NeedsInvestigation,compiler/runtime

    TestGCFairness2 (0.12s)
	    proc_test.go:351: want OK
		    , got goroutine 1 did not run

https://storage.googleapis.com/go-build-log/bc7889a5/openbsd-amd64-gce58_a614fab1.log

/cc @aclements @RLH 

I don't see any evidence that this is a known flake in the issue tracker, so filing a bug and tagging Go1.8Maybe in case it's of interest.
Repository: flutter
Issue: Hot reload should be even less verbose
Labels: tool,t: hot reload,from: study,P3,team-tool,triaged-tool

This should be collapsed into one line when you hit "r":
```
Syncing files to device...                           96ms
Performing hot reload...                             1793ms
Reloaded 260 of 439 libraries.
```
Repository: youtube-dl
Issue: Please add feature for video.yaplakal.com
Labels: site-support-request

Good times,

Please add feature for video.yaplakal.com

Example link:
http://www.yaplakal.com/forum28/topic1481239.html

Kind regards,
Timur
Repository: rust
Issue: Consider storing auto-generated error message strings in separate object file
Labels: I-slow,C-enhancement,A-codegen,I-compiletime,T-compiler,A-incr-comp

Some kinds of expression can generate a runtime panic with a compiler generated error message containing the source location of that expression. Examples are arithmetic expressions that can cause integer overflow or division by zero, and expressions that result in array bounds checks.

So far we are allocating string constants in the same codegen unit as the expression, which has two disadvantages:

* Because we do not check whether there is already a constant for that source location, we will have copies of the same data for each monomorphized instance of a function. (Or does LLVM merge equal constants if there address is never taken?)

* Since the source location is contained in machine code, the whole object file often has to be re-compiled during incremental compilation even if just formatting has changed or comments have been added.

This could be solved by interning all those constants into a separate object file with a (semi-)stable symbol name (e.g. symbol_name = function_symbol_name + index within function). That way, only the error-message-object-file has to be regenerated when nothing but formatting has changed.
Repository: rust
Issue: Command::spawn has weird rules for finding binaries on Windows
Labels: O-windows,C-feature-request,T-libs,A-process

The offending code is [here](https://github.com/rust-lang/rust/blob/ac968c466451cb9aafd9e8598ddb396ed0e6fe31/src/libstd/sys/windows/process.rs#L130-L149) which is apparently to have it search the child's `%Path%` for the binary to fix #15149. It has a few issues though.

1. It is only triggered when the child's environment has been customised. This means `Command::new("foo.exe").spawn()` and `Command::new("foo.exe").env("Thing", "").spawn()` uses different rules for finding the binary which seems unexpected.
2. It will replace any extension on the program name with `.exe`. This means `Command::new("foo.bar").env("Thing", "").spawn()` attempts to launch `foo.exe` first. `Command::new("foo.bar").spawn()` correctly tries to launch `foo.bar` as [`CreateProcess`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx) will not replace the extension.
3. If the program name is an absolute path then this is still triggered but will just try that path for every item in the child's `%Path%`. For example `Command::new(r"C:\foo.bar").env("Thing", "").spawn()` looks for `C:\foo.exe` several times.
4. The use of `.to_str().unwrap()` means it `panic!`s if the program name is not valid Unicode.
5. Prehaps the biggest issue, but maybe it's itentional, is that none of the logic for finding binaries seems to be documented ([`std::process::Command`](https://doc.rust-lang.org/nightly/std/process/struct.Command.html)).

An easy way to fix this is to just remove the hack so we just rely on the behaviour of [`CreateProcess`](https://msdn.microsoft.com/en-us/library/windows/desktop/ms682425(v=vs.85).aspx) on Windows which is a least documented. The behaviour is already very different between Windows and Linux and we should probably just accept that in order to get reliable results cross-platform it's best to use absolute paths.
Repository: go
Issue: runtime, cmd/compile: remove all pointers from type information
Labels: compiler/runtime

For Go 1.7 I started replacing the pointers in Go's run time type information with offsets from the beginning of the type section. (The motivation was significantly reduced binary size, as 8-bytes for the pointer + 32-bytes for the dynamic relocation is significantly more than a 4-byte offset multiplied through by several pointers in each type and thousands of types.)

This work is not yet complete, and in its partial state it leads to subtle bugs like #17709. When using a binary built with -buildmode=shared or -buildmode=plugin, there are multiple type information sections, one for each module. An offset into this region (represented by either a ```typeOff``` or a ```nameOff```) needs to be resolved against the correct type region. But when you follow one of the old pointers in a type, it is entirely possible the dynamic relocation processed by ld.so will jump you to the types section of a different module.

This can lead to an offset from one module being resolved against the wrong type region, meaning garbage data is used for the type. This will manifest as subtle bugs: types incorrectly mapping (or not) onto interfaces, the reflect package returning wrong results, or bad garbage collection.

The likelihood of misplacing an offset decreases significantly if we remove the pointers, as we will not have to consider the interaction of two separate relocation systems. Let's do that.
Repository: TypeScript
Issue: module_resolution=none or =explicit
Labels: Suggestion,Needs More Info,VS Code Tracked

Discussed in-person with @DanielRosenwasser 

In google we have performance issues with tsc and with editor plugins. We have tracked this down to the node moduleResolutionKind looking in many locations on a network-mounted disk.

We don't actually want the node moduleResolution, we only want the baseUrl/paths/rootDirs feature known as "path mapping". Put another way, we explicitly list locations for all inputs, and we never want the compiler to stat a file outside of the explicit input locations.

For tsc, we provide a custom CompilerHost that avoids touching the disk, we implement fileExists and directoryExists purely by consulting our file manifest. However, we can't do this trick for editors, which are becoming increasingly unusable.

As an example, we provide interop with Closure Compiler code that declares `goog.module`, by naming these `goog:some.module`. This results in the language services looking for a file like `goog:some.module.d.ts` all over the network-mounted filesystem, even though a later sourceFile in the program has `declare module 'goog:some.module'`

cc @vikerman @rkirov
Repository: go
Issue: cmd/compile: merge order/walk/instrument into buildssa
Labels: ToolSpeed,compiler/runtime

Currently the compiler backend performs several stages of Node AST rewrites before generating SSA. We should investigate generating SSA directly from the AST produced by the frontend. Rationale:

  1. order.go exists as a separate pass primarily to simplify maintaining order-of-evaluation in walk.go, but we can probably just as easily handle this when directly producing SSA.
  2. order.go and walk.go iterate across the entire function AST a couple times, reading and writing to every pointer slot.  Usually the values written are also identical to the values already in memory too.
  3. AST rewrites requires the intermediary format to be representable in the AST too, which may complicate transitioning to package syntax.  There are currently several gc.Ops generated and used only within the backend (e.g., OSQRT, OINDREGSP, OEFACE, ...).
  4. The AST invariants between these phases are poorly documented or at least poorly understood.

/cc @randall77 @josharian
Repository: flutter
Issue: Hide complexity of dropdown testing
Labels: a: tests,c: new feature,framework,customer: money (g3),P3,team-framework,triaged-framework

Internal: b/153422899

This is the code required to properly switch from value A to value B in a widget tester:

```Dart
changeDropDown(
    WidgetTester tester,
    String currentValue,
    String newValue,
  ) async {
    await tester.tap(find.text(currentValue).last);
    await tester.pump();
    await tester.pump(const Duration(seconds: 1)); // finish the menu animation
    await tester.tap(find.text(newValue).last);
    await tester.pump();
    await tester.pump(const Duration(seconds: 1)); // finish the menu animation
  }
```

This logic should be hidden from app tests as it looks fragile and should be maintained by framework instead.
Repository: vscode
Issue: Add "find all occurences" in the current file feature
Labels: feature-request,search,editor-find


Using Search sidebar to find all items in current file requires too much clicks.
VS has a find all option

- VSCode Version: 1.6.1
- OS Version: Windows Server 2008

Steps to Reproduce:

1. Ctrl + F
2. Type search test

## Expected

option to see all occurrences

## Actual

No such option

## Visual Studio

![snip_20161103091325](https://cloud.githubusercontent.com/assets/7656611/19957237/e3a25dec-a1a5-11e6-9db4-0dc46b832d11.png)

## VS Code

![snip_20161103091454](https://cloud.githubusercontent.com/assets/7656611/19957425/a9ebc03c-a1a7-11e6-83da-e1add97fb265.png)