id
int64 393k
2.82B
| repo
stringclasses 68
values | title
stringlengths 1
936
| body
stringlengths 0
256k
⌀ | labels
stringlengths 2
508
| priority
stringclasses 3
values | severity
stringclasses 3
values |
---|---|---|---|---|---|---|
143,749,793 | go | runtime: hot vars and cache lines | Naive question. The runtime has a bunch of top-level vars, some of which are fairly hot, e.g. the writeBarrier struct (checked before every write barrier call), the debug struct (checked during every malloc for e.g. allocfreetrace), and the trace struct (to know whether tracing is enabled). Some are written a lot (writeBarrier), whereas others are read-mostly (debug, trace).
They are organized for readability and thus end up potentially scattered around the final binary. However, I wonder whether it would be better to ensure that all the hottest read-mostly variables are in a single cache line and ensure that the hottest read-write variables don't trigger false sharing.
Many of these aren't easy to move around and experiment with, because of compiler integration. So first: Any instincts about whether this is likely to matter in practice?
cc @dvyukov @aclements
| NeedsInvestigation,compiler/runtime | low | Critical |
143,811,144 | go | net/http: mechanism to dynamically change MaxIdleConnsPerHost? | Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (`go version`)?
```
1.6
```
- What operating system and processor architecture are you using (`go env`)?
```
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/hernan/apps/go"
GORACE=""
GOROOT="/Users/hernan/apps/go/go-src/go"
GOTOOLDIR="/Users/hernan/apps/go/go-src/go/pkg/tool/darwin_amd64"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fdebug-prefix-map=/var/folders/vw/ht0lksb16l199rbp98p7hhfr0000gn/T/go-build001484838=/tmp/go-build -gno-record-gcc-switches -fno-common"
CXX="clang++"
CGO_ENABLED="1"
```
- What did you do?
It is not possible for clients of `http.Transport` to dynamically change MaxIdleConnsPerHost attribute. It would be great to have a `sync.RWMutex` as an attribute of `http.Transport`, so this is possible.
The use case is that for HTTP/1.1 Hosts, it would be nice for the client to have the possibility of adjusting max-idle connections base on usage.
The following gist shows the problem:
https://gist.github.com/go-loco/810fe53d8aee8879b8d1
Making the following changes to http.Transport would add this feature:
```
// MaxIdleConnsPerHost, if non-zero, controls the maximum idle
// (keep-alive) connections to keep per-host. If zero,
// DefaultMaxIdleConnsPerHost is used.
MaxIdleConnsPerHost int
// MaxIdleConnsMutex, let you dynamically change the
// MaxIdleConnsPerHost without creating a data race.
//
// Usage:
//
// MaxIdleConnsMutex.Lock()
// MaxIdleConnsPerHost = newValue
// MaxIdleConnsMutex.Unlock()
//
MaxIdleConnsMutex sync.RWMutex
```
```
func (t *Transport) tryPutIdleConn(pconn *persistConn) error {
t.MaxIdleConnsMutex.RLock()
max := t.MaxIdleConnsPerHost
t.MaxIdleConnsMutex.RUnlock()
if t.DisableKeepAlives || max < 0 {
return errKeepAlivesDisabled
}
if pconn.isBroken() {
return errConnBroken
}
key := pconn.cacheKey
if max == 0 {
max = DefaultMaxIdleConnsPerHost
}
...
```
| FeatureRequest | low | Critical |
143,811,665 | go | cmd/cgo: cgo does not link dependencies into archives | Please answer these questions before submitting your issue. Thanks!
- What version of Go are you using (`go version`)?
`go version go1.6 darwin/amd64`
- What operating system and processor architecture are you using (`go env`)?
```
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="darwin"
GOOS="darwin"
GOPATH="/Users/tamird/src/go"
GORACE=""
GOROOT="/Users/tamird/src/go1.6"
GOTOOLDIR="/Users/tamird/src/go1.6/pkg/tool/darwin_amd64"
GO15VENDOREXPERIMENT="1"
CC="clang"
GOGCCFLAGS="-fPIC -m64 -pthread -fno-caret-diagnostics -Qunused-arguments -fmessage-length=0 -fno-common"
CXX="clang++"
CGO_ENABLED="1"
```
- What did you do?
Compiling https://github.com/cockroachdb/c-rocksdb with the LDFLAGS directives at the bottom of https://github.com/cockroachdb/c-rocksdb/blob/master/cgo_flags.go removed.
c-rocksdb is a "thin" wrapper around https://github.com/facebook/rocksdb which allows it to be built using the go toolchain. However, it depends on lz4, so we bring in http://github.com/cockroachdb/c-lz4 which is a similar wrapper.
Unfortunately, c-lz4 is being linked (by cmd/link?) in a later step than the external linking used for c-rocksdb, which causes missing symbols in c-rocksdb (hence the need for the LDFLAGS directives).
Is it possible to ask the toolchain to link c-lz4.a using external linking (in the "main" linking step in c-rocksdb)?
| compiler/runtime | medium | Major |
143,818,215 | TypeScript | Better display representation for intersection types | <!--
Thank you for contributing to TypeScript! Please review this checklist
before submitting your issue.
[ ] Many common issues and suggestions are addressed in the FAQ
https://github.com/Microsoft/TypeScript/wiki/FAQ
[ ] Search for duplicates before logging new issues
https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue
[ ] Questions are best asked and answered at Stack Overflow
http://stackoverflow.com/questions/tagged/typescript
For bug reports, please include the information below.
__________________________________________________________ -->
I'm not sure if this has been discussed before, but join types are mostly unreadable. I think the type should be prettified somehow before being displayed to the user.
**TypeScript Version:**
1.8
**Code**
``` ts
type T1 = {};
type T2 = {test: number};
type J = T1 & T2;
```
**Expected behavior:**
``` ts
var x: J;
typeof x; // {test: number}
```
**Actual behavior:**
``` ts
var x: J;
typeof x; // {} & {test: number}
```
| Suggestion,Help Wanted,Effort: Difficult | low | Critical |
143,843,603 | godot | Godot doesn't support mesh collisions for RigidBody and VehicleBody | **Operating system or device:**
Any
**Issue description** (what happened, and what was expected):
In Unity you can use any convex shape for RigidBody (one can be generated from mesh).
This feature is strangely unimplemented yet.
**Steps to reproduce:**
Well, just adding convex mesh collision to RigidBody and trying to collide should do.
| enhancement,topic:physics,topic:3d | low | Major |
143,858,485 | go | x/mobile/exp/f32: Mat4.Rotate incorrectly rotates around axes with non-zero X values | I have put together the following example to demonstrate a problem with Rotate method on f32.Mat4. I attempt to rotate a ~~vector v~~ (edit: vector u) around the X axis. The resulting vector does not have the same length (in this extreme case the "rotation" has collapsed a unit vector to zero-length).
http://play.golang.org/p/INyRQCldPm
When I actually use the resulting transformation in OpenGL what I have observed is that my models gets flattened onto a plane (presumably the Y-Z plane, perpendicular to the X axis, at X=0).
I believe the problem lies in how the first row of the rotation matrix is constructed.
https://github.com/golang/mobile/blob/467d8559f22b81884dfbc37d1cef95d0fab78049/exp/f32/mat4.go#L157-L160
I kind of suck at this stuff. But you can see the subsequent rows in the matrix have a pattern which is not observed in the first row. So I tried changing the first row of the rotation matrix to the following.
```
{
c + d*a[0]*a[0],
0 + d*a[0]*a[1] + s*a[2],
0 + d*a[0]*a[2] - s*a[1],
0,
}
```
And that looks like it works.
The following demonstrates the altered Rotate function: http://play.golang.org/p/8ZrOpdv_AY
This second example confirms rotation of [1, 0, 0] around the X axis yields [1, 0, 0]. Obviously length was preserved.
| mobile | low | Minor |
143,859,212 | neovim | libsixel support? | https://github.com/saitoha/libsixel is supported by a growing number of applications. Would this be useful for neovim?
| enhancement,ui,tui | low | Major |
143,914,344 | rust | unresolved symbol imports in -pie musl binaries | I've noticed that there are two unresolved symbols when a [PIE](https://en.wikipedia.org/wiki/Position-independent_code#Position-independent_executables) is requested via the linker flags with nightly rustc's new musl target, e.g.:
`rust/bin/rustc --target=x86_64-unknown-linux-musl -C link-args="-Wl,-pie" main.rs`
yields a binary with two unresolved imports:
```
ELF X86_64 DYN @ 0x4f71
Imports (2)
26e3a0 __dso_handle (0) ~> Unknown
26e3a8 __cxa_thread_atexit_impl (0) ~> Unresolved
```
which you can see with `objdump -R main`:
```
0000000000270fd0 R_X86_64_GLOB_DAT __cxa_thread_atexit_impl
0000000000271008 R_X86_64_64 __dso_handle
```
but 0 libraries (i.e., `DT_NEEDED`), so having unresolved imports without dynamic library dependencies is essentially an incoherent binary semantics. (Not having libraries is fine, in fact that's the point of the musl target, and the `-pie` flag should just make it able to be loaded anywhere in memory, but having unresolved imports without dependencies is where it becomes problematic)
Similarly, grepping through the assembly, it looks like `__cxa_thread_atexit_impl` isn't called by anyone, but `__dso_handle` does show up in an external rust linkage symbol (I have no idea what the function of the `__rust_extern_with_linkage____X` is):
```
015: 48 8d 15 ec 7f 26 00 lea 0x267fec(%rip),%rdx # 271008 <_rust_extern_with_linkage___dso_handle>
```
As such, doesn't seem like it's a major problem, but it is very unusual, and again, the lack of dynamic library dependencies + unresolved symbol imports is a red flag, and should probably be investigated. My guess is that there is some weird interaction with the `link-args` flag and the generated link commands somehow.
| O-musl,C-bug | low | Minor |
143,997,542 | angular | Inconsistant projection behavior | version: `ng2-beta12`
For some reason the order in which templates are defined is causing issues with transclusion.
[Doesn't Work for buttons but works for link](http://plnkr.co/edit/OmMGa65bNfrrQn0i5Wwm?p=preview)
```
<template [ngIf]="href ===''">
<button [ngClass]="cssClassList">
<ng-content></ng-content>
</button>
</template>
<template [ngIf]="href !==''">
<a [ngClass]="cssClassList" href="href">
<ng-content></ng-content>
</a>
</template>
```

[Works for buttons but not for links](http://plnkr.co/edit/ccpnmdnU53B5JqZMBnxP?p=preview)
```
<template [ngIf]="href !==''">
<a [ngClass]="cssClassList" href="href">
<ng-content></ng-content>
</a>
</template>
<template [ngIf]="href ===''">
<button [ngClass]="cssClassList">
<ng-content></ng-content>
</button>
</template>
```

| type: bug/fix,freq2: medium,area: core,state: confirmed,core: content projection,design complexity: major,P3 | medium | Critical |
144,015,603 | go | cmd/compile: BLAS Idamax regression | The blas routine Idamax is seeing a regression between 1.6 and tip (go version go version devel +7e88826 Mon Mar 28 14:10:21 2016 +0000 darwin/amd64).
Idamax finds the index with maximum absolute value.
```
go get -u -t github.com/gonum/blas/native
cd $GOPATH/src/github.com/gonum/blas/native
go test -bench=Ida -tags=noasm -count=5
```
```
IdamaxSmallUnitaryInc-8 32.4ns ± 7% 39.1ns ± 6% +20.80% (p=0.008 n=5+5)
IdamaxSmallPosInc-8 28.7ns ±11% 41.1ns ±11% +43.24% (p=0.008 n=5+5)
IdamaxMediumUnitaryInc-8 1.58µs ± 2% 2.03µs ± 2% +27.83% (p=0.008 n=5+5)
IdamaxMediumPosInc-8 1.86µs ± 2% 2.38µs ±11% +27.93% (p=0.008 n=5+5)
IdamaxLargeUnitaryInc-8 150µs ± 2% 195µs ± 1% +30.23% (p=0.008 n=5+5)
IdamaxLargePosInc-8 202µs ± 1% 241µs ± 2% +19.10% (p=0.008 n=5+5)
IdamaxHugeUnitaryInc-8 15.1ms ± 1% 21.0ms ± 2% +39.67% (p=0.008 n=5+5)
IdamaxHugePosInc-8 27.9ms ± 3% 30.0ms ± 2% +7.38% (p=0.008 n=5+5)
```
@randall77 @josharian
| Performance,NeedsFix,early-in-cycle | low | Minor |
144,037,177 | go | doc: add wiki page on using text/template and html/template | I encountered [this comment](https://news.ycombinator.com/item?id=11374024) and its reply on HN. People feel that Go's template support is lacking; I had the same experience but only for lack of better reference documentation and examples. I would like a page added for Go's template support and listed under "Additional Go Programming Wikis".
| Documentation,help wanted,NeedsInvestigation | low | Minor |
144,156,534 | go | x/pkgsite: verbosity dial | I was joking to David that we should have a slider knob on godoc to choose how much crap in a package we show.
Imagine if a user loaded the net package and they only saw `Dial` and `Listen` and `Conn` by default, but then had to do something to show all the noise.
I'm kinda joking, but kinda not. Maybe there's something to do here.
We've tried to address this in the past with package docs and examples, which helps, but also just adds to the overall noise.
Low priority.
/cc @adg
| NeedsDecision,Tools,pkgsite | low | Minor |
144,157,288 | go | text/template: consider broadening the set of built-in template funcs | Some programs expect their users to write templates. One of these programs is [`docker-gen`](https://github.com/jwilder/docker-gen), and one of its users filed issue #14992 as they found the template language too restrictive for what they were trying to do.
As it happened, `docker-gen` provided the a template function to let the user do what they wanted (filter a set of structs based on the value of a field, and print something different if no structs with that field set to that specific value are found). That function is documented by the `docker-gen` README:
> `where $items $fieldPath $value`: Filters an array or slice based on the values of a field path expression `$fieldPath`. A field path expression is a dot-delimited list of map keys or struct member names specifying the path from container to a nested value. Returns an array of items having that value.
The `docker-gen` program provides many such functions (see the [README](https://github.com/jwilder/docker-gen/blob/master/README.md) for the full list). Some of them are specific to `docker-gen`'s purpose, but many of them are general purpose (such as `where` above).
Should we add some of these functions (or functions with similar behavior) to the built in set of template functions?
cc @robpike @bradfitz @JonasT
| NeedsInvestigation | low | Minor |
144,261,261 | opencv | Support custom options in AVCodecContext (av_dict_set) in FFMPEG backend | I'm looking for guidance in regards to submitting a PR that will allow you to specify raw options (i.e preset) using av_dict_set. This applies to `VideoCapture` and `VideoWriter` The use case here being that you could support encoding videos targeting a specific device (i.e Apple iPad). Or tune encoding performance for a given codec i.e. [VP9](http://www.ffmpeg.org/doxygen/3.0/libvpxenc_8c_source.html#1061)
**Specify backend options by instantiating a new VideoWriter (!?)**
``` cpp
VideoWriter::VideoWriter(const String& filename, int fourcc, double fps, Size frameSize, bool isColor=true, std::map<std::string, std::string> backendOptions)
```
| feature,category: videoio | low | Major |
144,296,632 | rust | incorrect DW_AT_location for static | I'm using rust from the Fedora COPR:
```
bapiya. rustc --version
rustc 1.7.0 (a5d1e7a59 2016-02-29)
```
Consider this program:
```
pub static AA: i32 = 5;
fn main() {
}
```
I compile with `-g` and then examine the DWARF using `readelf`. I see:
```
<2><2f>: Abbrev Number: 3 (DW_TAG_variable)
<30> DW_AT_name : (indirect string, offset: 0x48): AA
<34> DW_AT_type : <0x62>
<38> DW_AT_decl_file : 1
<39> DW_AT_decl_line : 1
<3a> DW_AT_location : 9 byte block: 3 0 0 0 0 0 0 0 0 (DW_OP_addr: 0)
<44> DW_AT_linkage_name: (indirect string, offset: 0x4f): _ZN2b12AAE
```
Now, this variable is not actually emitted. There's no ELF symbol for it. Given this, it seems strange to emit `DW_AT_linkage_name` and `DW_AT_location`, especially considering that the latter is incorrect.
| A-debuginfo,P-low,T-compiler,C-bug | low | Minor |
144,297,923 | rust | DWARF omits typedef | I'm using rustc from the Fedora COPR:
```
bapiya. rustc --version
rustc 1.7.0 (a5d1e7a59 2016-02-29)
```
Consider this program:
```
pub type Xty = fn() -> u32;
fn x() -> u32 {
return 57u32;
}
pub static AA: Xty = x;
fn main() {
println!("{}", AA());
}
```
I compile this with `-g` and then look for the type `Xty` in the DWARF using readelf. It isn't there:
```
bapiya. readelf -wi B1 | grep Xty
bapiya.
```
If I examine the type of `AA`, it ends up here:
```
<1><14b>: Abbrev Number: 11 (DW_TAG_pointer_type)
<14c> DW_AT_type : <0x154>
<150> DW_AT_name : (indirect string, offset: 0x4b): fn() -> u32
<1><154>: Abbrev Number: 12 (DW_TAG_subroutine_type)
<155> DW_AT_type : <0x159>
[...]
```
That is, the typedef has been dropped.
| A-debuginfo,P-low,T-compiler,C-bug | low | Minor |
144,378,995 | youtube-dl | support for joj.sk site | - [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.03.27**
### Before submitting an _issue_ make sure you have:
- [X] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [X] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
### What is the purpose of your _issue_?
- [ ] Bug report (encountered problems with youtube-dl)
- [X] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other
### Example URLs
- Single video: http://dizajn.joj.sk/nove-byvanie-dizajn-archiv/2016-03-06-nove-byvanie-dizajn-premiera.html
- Single video: http://zoo.joj.sk/zoo-epizody/2016-03-23-zoo.html
| site-support-request | low | Critical |
144,718,340 | TypeScript | Suggestion: execute property initializer expressions at the expected time | Currently, TS moves property initializers in a way that can be suprising and lead to subtle problems. Eg, Issue #7644, but I've seen it in other places. Another example which I ran into in a PL class (while trying to demonstrate something else...):
```
let y = 1;
class Foo {
private x = y;
constructor(y) {
}
}
```
The error message for this is confusing, but IMO it is expected since it's the _behavior_ of these things that is confusing. That's a result of moving the expressions into a different scope than the original source and also a different time (in the constructor call instead of when the class is generated).
So I think that it would be much better (and solve a bunch of issues around this area) if the emitted code would evaluate the initializer expressions at a proper time, for example, producing this code for the above:
```
var y = 1;
var Foo = (function () {
var _y_init = y;
function Foo(y) {
this.x = _y_init;
}
return Foo;
}());
```
I'm gussing that (some of) the reasons to not do that are being able to refer to `this` in these expressions, and the fact that you get values that are shared for all instances (eg, with a `private x = {}` initializer). Personally, I'd argue that neither of these is worth keeping: before I dug into this I _assumed_ that a `{}` value would be shared, and I never considered using `this.` on the RHS, since I automatically didn't assume that there exists one that can be used.
But assuming that it's hopeless to fix this completely (since it'd break code in subtle and potentially disastrous ways), so the unexpected (for me) execution order must stick. But the scope breakage is more subtle and more important, so how about fixing just _that_ with something like:
```
var y = 1;
var Foo = (function () {
function _init(_this) {
_this.x = y;
}
function Foo(y) {
_init(this);
}
return Foo;
}());
```
And it would be nice if such an `_init` thing is _consistently_ done after a `super()` when there is one, since the time when these expressions are evaluated is changed anyway, there's no reason for people to expect them to happen before a `super` (and such an expectation now is unreliable since the initialization happens, AFAICT, either before or after a `super`).
| Suggestion,Committed | low | Critical |
144,723,522 | go | cmd/compile: unnecessary branching | ```
type T struct {
x, y, z int
}
func f(x interface{}) int {
t, ok := x.(*T)
if ok && t != nil {
return 7
}
return 3
}
```
The SSA compiler for this function generates some extra branching logic that seems unnecessary.
```
0x0000 00000 (bin.go:12) LEAQ type.*"".T(SB), AX
0x0007 00007 (bin.go:8) MOVQ "".x+8(FP), CX
0x000c 00012 (bin.go:8) CMPQ AX, CX
0x000f 00015 (bin.go:8) JNE $0, 49
0x0011 00017 (bin.go:7) MOVQ "".x+16(FP), AX
0x0016 00022 (bin.go:9) JNE 29
0x0018 00024 (bin.go:9) TESTQ AX, AX
0x001b 00027 (bin.go:9) JNE $0, 39
0x001d 00029 (bin.go:12) MOVQ $3, "".~r1+24(FP)
0x0026 00038 (bin.go:12) RET
0x0027 00039 (bin.go:10) MOVQ $7, "".~r1+24(FP)
0x0030 00048 (bin.go:10) RET
0x0031 00049 (bin.go:8) MOVQ $0, AX
0x0038 00056 (bin.go:9) JMP 22
```
The 4th line there could be JNE directly to line 29. Instead it goes to 49/56, rejoins the main flow at 22, and then goes to 29.
Something wrong with the shortcircuit pass, maybe?
| Performance,compiler/runtime | low | Minor |
144,753,938 | You-Dont-Know-JS | `.constructor` not restored in Chapter 5 : "(Prototypal) Inheritance" | I generally agree with `.constructor` being unreliable and understand the explanations give in this chapter. I do worry about one detail toward the end of the "(Prototypal) Inheritance" section.
When using either `new Foo()` or `Object.create(Foo.prototype)`, you replace the default `Bar.prototype` object with the newly created one in both cases. This also removes the default `.constructor` as you mention in the section above "(Prototypal) Inheritance". I think it would be valuable to re-iterate what happens to `Bar.prototype.constructor` here as well.
Perhaps something along the lines (to match tone?), "Once you've created this new object, you can see that it's `.constructor` property returns Foo {}, which is wrong. All the more reason to avoid relying on `.constructor`!" and some reference to the section explaining why again?
| for second edition | medium | Minor |
144,967,258 | go | cmd/cgo: unexpected allocations when passing void pointers | 1. What version of Go are you using (`go version`)? **go1.6**
2. What operating system and processor architecture are you using (`go env`)? **linux/amd64**
3. What did you do?
I was helping to debug several unaccounted for allocations and we came across what we thought was very peculiar behavior. Consider the following two implementations of the same package
http://play.golang.org/p/hC-b5VSG58
http://play.golang.org/p/soCMGF1WjG
And the following benchmark
http://play.golang.org/p/e37ObBxwJP
1. What did you expect to see?
Neither implementation appears to allocate anything in the Foo function. So I expect `go test -bench` to report zero allocations for both implementations of the package.
1. What did you see instead?
For the first example (hC-b5VSG58) the command `go test -bench=. -benchmem` reports two allocations (48 bytes total) when the C function is passed a non-nil argument.
```
$ go test -bench=. -benchmem
testing: warning: no tests to run
PASS
BenchmarkFoo-4 5000000 317 ns/op 48 B/op 2 allocs/op
BenchmarkFoo_nil-4 10000000 164 ns/op 0 B/op 0 allocs/op
ok github.com/bmatsuo/lmdb-go/tmp/cgo-allocs 3.718s
```
The second example avoids any allocation.
```
$ go test -bench=. -benchmem
testing: warning: no tests to run
PASS
BenchmarkFoo-4 10000000 151 ns/op 0 B/op 0 allocs/op
BenchmarkFoo_nil-4 10000000 151 ns/op 0 B/op 0 allocs/op
ok github.com/bmatsuo/lmdb-go/tmp/cgo-allocs 3.345s
```
The first example does see a performance impact, I assume because of the allocations.
| compiler/runtime | low | Critical |
145,064,639 | thefuck | white-space safe 'thefuck' with the history line passed as a single arg? | In some shells' thefuck alias, e.g. for bash, the core part falls to:
``` bash
# https://github.com/nvbn/thefuck/blob/master/thefuck/shells/bash.py#L13
eval $(BUNCH_OF_VARIABLES=something thefuck $(fc -ln -1)))
```
But `$(fc -ln -1)` is not a safe thing to try. In python terminology, `$(fc -ln -1)` is something like:
``` Python
reduce(op.add, (glob.glob(i) or [i] for i in shell_stdout(['fc', '-ln', '-1']).split()))
```
which is almost certainly not the thing you are looking for. Similarly, `$TF_CMD` gets split and globbed and list-joined (and `' '.join()`'ed by `eval`) in `eval $TF_CMD`.
For POSIX shells like bash and zsh (well, POSIX-ish) this can be solved by passing in the whole history string and actually interpreting the results of `shlex.split(thestring)` (which seems to be done already somewhere in the source). For other shells.. perhaps a custom lexer?
tcsh seems to suffer from the same problem, but I am not a tcsh expert so I may be wrong:
``` csh
A2:~# sh -xvc ': "$@"' -- `echo 'foo bar /*'`
: "$@"
+ : foo bar /bin /boot /dev /etc /home /initrd.img /initrd.img.old /lib /lib32 /lib64 /libx32 /lost+found /media /mnt /opt /proc /pub /root /run /sbin /srv /sys /tmp /usr /var /vmlinuz /vmlinuz.old
```
(using sh for some arg dump that makes sense)
| help wanted | low | Minor |
145,088,601 | rust | Better diagnostics for error: can't find crate for `...` [E0463] | It would be nice if rustc would print the search directory for a crate and rejected crates (with matching names) in those directories when it cannot find the crate.
| C-enhancement,A-diagnostics,T-compiler | low | Critical |
145,196,149 | TypeScript | Idea: 'rest' index signatures and the 'error' type | _[This idea is still in a relatively early stage of development, but I thought it may be of worth to someone or even for the TS team itself. Feel free to share your thoughts]_
Having literal types, or unions of them, in index signatures is an idea that was brought to discussion lately (see #5683, #7656 and more general discussion in #7660):
``` ts
interface Example {
[letter: "a" | "b" | "c"]: number;
}
```
However the conventional semantics of index signatures would imply that the type checking here would be very weak, unless `noImplicitAny` is enabled:
``` ts
let x: Example;
x["a"] = 123; // OK
x["a"] = "ABCD"; // Error: type 'string' cannot be assigned to 'number'
x["d"] = 123; // No error with noImplicitAny disabled
x["d"] = "ABCD"; // No error with noImplicitAny disabled
x[123] = "ABCD"; // No error with noImplicitAny disabled
x[Symbol("ABCD")] = true; // No error with noImplicitAny disabled
let y = x["a"] // OK, 'y' gets type 'number'
let y = x["d"] // No error with noImplicitAny disabled, 'y' gets type 'any'
let y = x[123] // No error with noImplicitAny disabled, 'y' gets type 'any'
let y = x[Symbol("ABCD")] // No error with noImplicitAny disabled, 'y' gets type 'any'
```
What if it there was a way to specify the type of all the 'remaining' access keys to the interface with a special "rest" index signature (notated as `[key: ...any]: T`) that would set a particular type for everything other than that was specified in the interface?
``` ts
interface Example {
[letter: "a" | "b" | "c"]: number;
[otherKeys: ...any]: string;
}
```
This may also be useful to avoid unwanted type errors when `noImplicitAny` is **enabled**:
``` ts
interface Example {
[letter: "a" | "b" | "c"]: number;
[otherKeys: ...any]: any;
}
```
And what if it would be set to some sort of an 'error' type? I.e. a type that would not be assignable to or from anything? (perhaps except itself, still thinking about it..).
``` ts
interface Example {
[letter: "a" | "b" | "c"]: number;
[otherKeys: ...any]: <Error>;
}
```
With the `<Error>` type, any assignment to or from a key that is not `"a"`, `"b"` or `"c"` would yield an error, as it cannot be assigned to or from anything:
``` ts
let x: Example;
x["a"] = 123; // OK
x["a"] = "ABCD"; // Error: type 'string' is not assignable to 'number'
x["d"] = 123; // Error: type 'number' is not assignable to '<Error>'
x["d"] = "ABCD"; // Error: type 'string' is not assignable to '<Error>'
x[123] = "ABCD"; // Error: type 'string' is not assignable to '<Error>'
x[Symbol("ABCD")] = true; // Error: type 'boolean' is not assignable to '<Error>'
let y = x["a"] // OK, 'y' gets type 'number'
let y = x["d"] // Error: type '<Error>' cannot be assigned to anything
let y = x[123] // Error: type '<Error>' cannot be assigned to anything
let y = x[Symbol("ABCD")] // Error: type '<Error>' cannot be assigned to anything
```
Or even:
``` ts
x["d"] = <null> {}; // Error: type 'null' is not assignable to '<Error>'
x["d"] = <undefined> {}; // Error: type 'undefined' is not assignable to '<Error>'
x["d"] = <void> {}; // Error: type 'void' is not assignable to '<Error>'
x["d"] = <any> {}; // Error: type 'any' is not assignable to '<Error>'
```
**Open questions:**
1. What would be the implications in terms of indexing into an entity having this signature in its type?
2. What would be the implications in terms of assigning to an entity having this signature in its type?
3. What would be the implications in terms of assigning from an entity having this signature in its type?
4. Would adding `[key: any...]: <Error>` convert any interface to a "strict" interface? (i.e. one that cannot be assigned from a 'wider' type containing more properties). And if it would, would that be seen as desirable or useful?
_Edits: expanded and corrected examples to the actual behavior with `noImplicitAny` enabled._
_Edits: converted from 'bottom' to `<Error>` as I seemed to have used a less common interpretation of the 'bottom' type_
_Edits (13 May 2016): changed `[...]` to `[key: ...any]` for better consistency with the current syntax._
| Suggestion,Needs Proposal | low | Critical |
145,200,349 | opencv | cvflann::hierarchicalClustering doesn't compile with Hamming Distance | Hello:
**Edit:
Long story short: It is possible to cluster features using Hamming with _deprecated_ `cv::flann::hierarchicalClustering<ELEM_TYPE,DIST_TYPE>` after fixing the bug in Hamming distance code by removing spurious pointers and work with iterators instead.**
I can provide the bug-fix for the latter if someone can establish what is the future of hierarchicalClustering function.
Original problem encountered:
Function call: `cv::flann::hierarchicalClustering<cv::flann::Hamming<uchar>>` causes compilation error:
```
include/opencv2/flann/dist.h:450:31: error: reinterpret_cast from 'cvflann::ZeroIterator<unsigned char>' to 'const pop_t *' (aka 'const unsigned long long *') is not allowed
const pop_t* b2 = reinterpret_cast<const pop_t*> (b);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
```
Works fine with L2 distance.
Possibly the same problem as in [this very old issue 1346 from OpenCV 2.3.1](http://code.opencv.org/issues/1346)
## Please state the information for your system
- OpenCV version: 3.0
### Expected behaviour
hierarchical clustering of binary feature descriptors (stored as chars).
### Actual behaviour
compilation error
### Additional description
### Code example to reproduce the issue:
```
cvflann::KMeansIndexParams params;
cv::Mat words = cv::Mat::zeros(dictionarySize, features.cols, CV_32F);
int count = cv::flann::hierarchicalClustering<cv::flann::Hamming<uchar>>(features,words,params);
//works fine with L2 distance
// int count = cv::flann::hierarchicalClustering<cv::flann::L2<float>>(features,words,params);
```
Error in compiling:
```
[ 11%] Building CXX object CMakeFiles/r-bow.dir/bow.cpp.o
In file included from /home/mix/rachael/source/bow.cpp:1:
In file included from /home/mix/rachael/source/common.h:11:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann.hpp:48:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/flann_base.hpp:43:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/all_indices.h:36:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/kdtree_index.h:41:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/dynamic_bitset.h:49:
/opt/opencv-3.0.0-dbg/include/opencv2/flann/dist.h:450:31: error: reinterpret_cast from 'cvflann::ZeroIterator<unsigned char>' to 'const pop_t *' (aka 'const unsigned long long *') is not allowed
const pop_t* b2 = reinterpret_cast<const pop_t*> (b);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/opencv-3.0.0-dbg/include/opencv2/flann/kmeans_index.h:681:25: note: in instantiation of function template specialization 'cvflann::Hamming<unsigned char>::operator()<unsigned char *, cvflann::ZeroIterator<unsigned char> >' requested here
variance += distance_(vec, ZeroIterator<ElementType>(), veclen_);
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann/kmeans_index.h:444:9: note: in instantiation of member function 'cvflann::KMeansIndex<cvflann::Hamming<unsigned char> >::computeNodeStatistics' requested here
computeNodeStatistics(root_, indices_, (int)size_);
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann/flann_base.hpp:283:12: note: in instantiation of member function 'cvflann::KMeansIndex<cvflann::Hamming<unsigned char> >::buildIndex' requested here
kmeans.buildIndex();
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann.hpp:532:23: note: in instantiation of function template specialization 'cvflann::hierarchicalClustering<cvflann::Hamming<unsigned char> >' requested here
return ::cvflann::hierarchicalClustering<Distance>(m_features, m_centers, params, d);
^
/home/mix/rachael/source/bow.cpp:24:25: note: in instantiation of function template specialization 'cv::flann::hierarchicalClustering<cvflann::Hamming<unsigned char> >' requested here
int count = cv::flann::hierarchicalClustering<cv::flann::Hamming<uchar>>(features,words,params);
^
In file included from /home/mix/rachael/source/bow.cpp:1:
In file included from /home/mix/rachael/source/common.h:11:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann.hpp:48:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/flann_base.hpp:43:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/all_indices.h:36:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/kdtree_index.h:41:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/dynamic_bitset.h:49:
/opt/opencv-3.0.0-dbg/include/opencv2/flann/dist.h:450:31: error: reinterpret_cast from 'cvflann::ZeroIterator<unsigned char>' to 'const pop_t *' (aka 'const unsigned long long *') is not allowed
const pop_t* b2 = reinterpret_cast<const pop_t*> (b);
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/opt/opencv-3.0.0-dbg/include/opencv2/flann/kmeans_index.h:687:21: note: in instantiation of function template specialization 'cvflann::Hamming<unsigned char>::operator()<int *, cvflann::ZeroIterator<unsigned char> >' requested here
variance -= distance_(mean, ZeroIterator<ElementType>(), veclen_);
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann/kmeans_index.h:444:9: note: in instantiation of member function 'cvflann::KMeansIndex<cvflann::Hamming<unsigned char> >::computeNodeStatistics' requested here
computeNodeStatistics(root_, indices_, (int)size_);
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann/flann_base.hpp:283:12: note: in instantiation of member function 'cvflann::KMeansIndex<cvflann::Hamming<unsigned char> >::buildIndex' requested here
kmeans.buildIndex();
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann.hpp:532:23: note: in instantiation of function template specialization 'cvflann::hierarchicalClustering<cvflann::Hamming<unsigned char> >' requested here
return ::cvflann::hierarchicalClustering<Distance>(m_features, m_centers, params, d);
^
/home/mix/rachael/source/bow.cpp:24:25: note: in instantiation of function template specialization 'cv::flann::hierarchicalClustering<cvflann::Hamming<unsigned char> >' requested here
int count = cv::flann::hierarchicalClustering<cv::flann::Hamming<uchar>>(features,words,params);
^
In file included from /home/mix/rachael/source/bow.cpp:1:
In file included from /home/mix/rachael/source/common.h:11:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann.hpp:48:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/flann_base.hpp:43:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/all_indices.h:38:
/opt/opencv-3.0.0-dbg/include/opencv2/flann/kmeans_index.h:854:38: error: no matching function for call to object of type 'cvflann::Hamming<unsigned char>'
DistanceType d = distance_(dataset_[indices[i]], ZeroIterator<ElementType>(), veclen_);
^~~~~~~~~
/opt/opencv-3.0.0-dbg/include/opencv2/flann/kmeans_index.h:445:9: note: in instantiation of member function 'cvflann::KMeansIndex<cvflann::Hamming<unsigned char> >::computeClustering' requested here
computeClustering(root_, indices_, (int)size_, branching_,0);
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann/flann_base.hpp:283:12: note: in instantiation of member function 'cvflann::KMeansIndex<cvflann::Hamming<unsigned char> >::buildIndex' requested here
kmeans.buildIndex();
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann.hpp:532:23: note: in instantiation of function template specialization 'cvflann::hierarchicalClustering<cvflann::Hamming<unsigned char> >' requested here
return ::cvflann::hierarchicalClustering<Distance>(m_features, m_centers, params, d);
^
/home/mix/rachael/source/bow.cpp:24:25: note: in instantiation of function template specialization 'cv::flann::hierarchicalClustering<cvflann::Hamming<unsigned char> >' requested here
int count = cv::flann::hierarchicalClustering<cv::flann::Hamming<uchar>>(features,words,params);
^
/opt/opencv-3.0.0-dbg/include/opencv2/flann/dist.h:425:16: note: candidate template ignored: substitution failure [with Iterator1 = unsigned char *, Iterator2 = cvflann::ZeroIterator<unsigned char>]
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
^
In file included from /home/mix/rachael/source/bow.cpp:1:
In file included from /home/mix/rachael/source/common.h:11:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann.hpp:48:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/flann_base.hpp:43:
In file included from /opt/opencv-3.0.0-dbg/include/opencv2/flann/all_indices.h:38:
/opt/opencv-3.0.0-dbg/include/opencv2/flann/kmeans_index.h:864:25: error: no matching function for call to object of type 'cvflann::Hamming<unsigned char>'
variance -= distance_(centers[c], ZeroIterator<ElementType>(), veclen_);
^~~~~~~~~
/opt/opencv-3.0.0-dbg/include/opencv2/flann/dist.h:425:16: note: candidate template ignored: substitution failure [with Iterator1 = int *, Iterator2 = cvflann::ZeroIterator<unsigned char>]
ResultType operator()(Iterator1 a, Iterator2 b, size_t size, ResultType /*worst_dist*/ = -1) const
^
4 errors generated.
```
| RFC | low | Critical |
145,235,868 | TypeScript | add a modifier for pure functions | This is what pure means:
1. no destructive operations on parameters
2. all parameters must be guaranteed from being changed from the outside (immutable?)
2. no calls to any other callback/function/method/constructor that doesn't have the pure modifier
3. no reads from mutable values from a scope the pure function is closed over
4. no writes to values in the closed scope
| Suggestion,Needs Proposal | high | Critical |
145,306,817 | TypeScript | Suggestion: use receiver's declared type arguments as defaults to its class constructor | I run into this relatively simple pattern a lot:
``` ts
class GenericClass<T, U, V> {
a: T;
b: U;
c: V;
}
let x: GenericClass<number, string, boolean>;
x = new GenericClass();
// Which produces the error:
// Error: GenericClass<{}, {}, {}> is not assignable to GenericClass<number, string, boolean>
```
Since `x` has already been defined with a particular set of type arguments, these arguments could be implicitly assumed as defaults to its type's constructor when invoked with it being the receiver (for simplicity I'm assuming here it is the exact constructor as declared e.g. not a derived class).
I understand there will be cases where that would be very difficult or even impossible to achieve:
``` ts
let createInstance = () => new GenericClass()
x = createInstance();
```
but these are relatively rare. Most of the time it's just:
``` ts
class Example {
myMap: Map<string, Array<{n: number}>>;
constructor() {
this.myMap = new Map<string, Array<{n: number}>>(); // <-- Why repeat?
}
}
```
Which instead could have been:
``` ts
class Example {
myMap: Map<string, Array<{n: number}>>;
constructor() {
this.myMap = new Map(); // <-- Better.. :)
}
}
```
- Any possible issues with this? perhaps ones that I'm not aware of or haven't thought of?
- Potential name collisions? (though I'm not aware of any?)
- Maybe just a bit too difficult to implement? perhaps revisit later? (though #5256 appears more difficult than this and seems to be in consideration?)
- Or maybe this 'bends' the semantics of the constructor expression (`new Class<T>()`), or at least its default type arguments, in a way that's slightly unappealing from a "purist" point of view"? (though this doesn't seem like a "purist" language?). Perhaps some concept of "contextual baseline default type arguments" can be included as an integral part of the future proposal for [default type arguments](https://github.com/Microsoft/TypeScript/issues/2175)?
| Suggestion,Help Wanted,Effort: Difficult | low | Critical |
145,344,333 | rust | Lint for types where cleanup before drop is desirable | `BufWriter.drop` is broken.
`BufWriter` flushes data on `drop` and ignores the result. It is incorrect for two reasons:
- you must not ignore write errors. For example, when filesystem is full, write fails. Currently last write error is quietly ignored. This code demonstrates the problem: http://is.gd/ZdgbF9
- `drop` may indefinitly hang, for example, if `BufWrtiter` underlying stream is socket, and nobody reads on the other side
Generally, I think any `drop` must only release resources, do not do anything blocking or failing.
The similar issue was only partially fixed in #30888.
We (together with @cfallin) propose a solution:
## Proposed solution
Add another function to `BufWriter` (and probably to `Write` trait): `cancel`. User of `BufWriter` _must_ explicitly call either `flush` or `cancel` prior to drop.
`struct BufWriter` gets `unfinished` flag instead of `panicked`.
`BufWriter.write` unconditionally sets `unfinished = true`.
`BufWriter.flush` or `BufWriter.cancel` unconditionally set `unfinished = false`.
And finally, `BufWriter.drop` becomes an assertion:
```
impl Drop for BufWriter {
fn drop(&mut self) {
// check `flush` or `cancel` is explicitly called
// but it is OK to discard buffer on panic
assert!(!self.unfinished || std::thread::panicking());
}
}
```
That change is backward incompatible, however, it is not _that_ bad: developer will likely get panic on first program run, and can quickly fix the code.
Change could be transitional: no-op `cancel` function could be added in rust version current+1 and assertion added in rust version current+2.
| T-lang,T-compiler,C-feature-request | low | Critical |
145,471,451 | youtube-dl | Site Support Request Stan.com.au | ### Make sure you are using the _latest_ version: run `youtube-dl --version` and ensure your version is _2016.04.01_. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.04.01**
### Before submitting an _issue_ make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
### What is the purpose of your _issue_?
- [ ] Bug report (encountered problems with youtube-dl)
- [x] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other
---
youtube-dl -v https://play.stan.com.au/programs/387127/play
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'https://play.stan.com.au/programs/387127/play']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.01
[debug] Python version 2.7.11 - Darwin-15.2.0-x86_64-i386-64bit
[debug] exe versions: rtmpdump 2.4
[debug] Proxy map: {}
[generic] play: Requesting header
WARNING: Falling back on generic information extractor.
[generic] play: Downloading webpage
[generic] play: Extracting information
ERROR: Unsupported URL: https://play.stan.com.au/programs/387127/play
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 1348, in _real_extract
doc = compat_etree_fromstring(webpage.encode('utf-8'))
File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 278, in compat_etree_fromstring
doc = _XML(text, parser=etree.XMLParser(target=etree.TreeBuilder(element_factory=_element_factory)))
File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 267, in _XML
parser.feed(text)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1642, in feed
self._raiseerror(v)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
raise err
ParseError: mismatched tag: line 5, column 1198
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 669, in extract_info
ie_result = ie.extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 323, in extract
return self._real_extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 2012, in _real_extract
raise UnsupportedError(url)
UnsupportedError: Unsupported URL: https://play.stan.com.au/programs/387127/play
This is a video page: https://play.stan.com.au/programs/387127/play
This is another video page: https://play.stan.com.au/programs/387128/play
| site-support-request,account-needed | low | Critical |
145,562,804 | youtube-dl | skipping video download also skips non-video post-processing actions | ### Make sure you are using the _latest_ version: run `youtube-dl --version` and ensure your version is _2016.04.01_. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.04.01**
### Before submitting an _issue_ make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
### What is the purpose of your _issue_?
- [x] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other
---
### If the purpose of this _issue_ is a _bug report_, _site support request_ or you are not completely sure provide the full verbose output as follows:
Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):
```
$ youtube-dl -v --skip-download --write-sub --convert-subs srt --all-subs https://www.youtube.com/watch?v=sLEdi49XEhA
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'--skip-download', u'--write-sub', u'--convert-subs', u'srt', u'--all-subs', u'https://www.youtube.com/watch?v=sLEdi49XEhA']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.01
[debug] Python version 2.7.6 - Linux-3.13.0-83-generic-x86_64-with-Ubuntu-14.04-trusty
[debug] exe versions: none
[debug] Proxy map: {}
[youtube] sLEdi49XEhA: Downloading webpage
[youtube] sLEdi49XEhA: Downloading video info webpage
[youtube] sLEdi49XEhA: Extracting video information
[youtube] sLEdi49XEhA: Downloading MPD manifest
[info] Writing video subtitles to: The Beauty of the Dinner Scene-sLEdi49XEhA.en-US.vtt
[info] Writing video subtitles to: The Beauty of the Dinner Scene-sLEdi49XEhA.en.vtt
```
---
### Description of your _issue_, suggested solution and other information
Using the `--skip-download` option seems to skip post-processing options, or at least the `--convert-subs` option. The other post-processing options are related to the video, so it makes sense that they'd be skipped, but `--skip-download` is a handy feature for downloading subtitles but not the video (particularly for really large videos that you've already downloaded and don't want to download again), and post-processing options for the subtitles should be processed.
Either that, or for the sake of internal consistency, `--skip-download` should also skip downloading subtitles. Perhaps the ability to download subtitles but not the video was an accidental feature? Maybe `--skip-download` was always intended as a dry-run feature, to not download anything? Personally though, I would prefer there be _some_ way to download just the subtitles and post-process them.
In the example command above, the video has subtitles in vtt format. Without the `--skip-download` option, the vtt subtitles are eventually converted to srt. However with the `--skip-download` option, they're left as vtt.
| bug | low | Critical |
145,587,563 | rust | Intern strings in metadata | The lack of string interning causes the metadata for rlibs to massively bloat. `libwinapi.rlib` for example takes up 54MB, which is mostly due to strings being repeated needlessly, and exacerbated by the sheer length of many of the identifiers. Simple greps of the file indicate basically all identifiers being repeated multiple times. Even something as simple as a constant that is never referenced has its name repeated at least 3 times. Interning strings would have massive space savings.
cc @eddyb who helped in figuring this out.
| C-enhancement,A-metadata,T-compiler | low | Minor |
145,691,474 | go | x/exp/shiny/driver/x11driver: runtime error on centos-7 | Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
``` sh
$> go version
go version go1.6 linux/amd64
```
1. What operating system and processor architecture are you using (`go env`)?
``` sh
$> go env
GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/go"
GORACE=""
GOROOT="/usr/local/go"
GOTOOLDIR="/usr/local/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
```
1. What did you do?
``` sh
$> go get -t -u golang.org/x/exp/shiny/...
$> cd $GOPATH/src/golang/x/exp/shiny/example/basic
$> go build main.go
$> ./main
```
1. What did you expect to see?
a window with 3 rounded squares.
2. What did you see instead?
an empty window (with whatever was displayed behind that window, captured into that window but not refreshed) and the following error:
``` sh
$> ./main
2016/04/04 13:47:06 x11driver: xproto.WaitForEvent: BadAccess {NiceName: Access, Sequence: 17, BadValue: 92274692, MinorOpcode: 1, MajorOpcode: 130}
2016/04/04 13:47:06 x11driver: xproto.WaitForEvent: BadBadSeg {NiceName: BadSeg, Sequence: 21, BadValue: 92274691, MinorOpcode: 3, MajorOpcode: 130}
```
The "interesting" thing is that the [pointer-painting](https://github.com/BurntSushi/xgbutil/blob/master/_examples/pointer-painting/main.go) example from `xgbutil` works correctly.
So it presumably is some configuration issue on the `x11driver` end.
(I tried replacing `xgb.NewConn()` with `xgbutil.NewConn()` and adapt a bit, to no avail)
| help wanted,NeedsFix | low | Critical |
145,714,651 | go | os/exec: don't use a thread to wait on processes | See https://github.com/docker/docker/issues/11529
There's no reasons why Docker should have to work around the standard library to reduce their thread count with large numbers of processes.
We could make `os/exec.Cmd.Wait` efficient instead.
/cc @ianlancetaylor
| Performance | low | Minor |
145,719,681 | go | cmd/compile: combine AND 0xff and MOVQload into MOVBQZXload | I noticed that for uint&0xFF go tip on amd64 generates e.g.:
0x001d 00029 (main.go:10) MOVQ "".u+8(FP), DX
0x0022 00034 (main.go:10) ANDQ $255, DX
http://play.golang.org/p/CKhi_nt615
It might be possible to make these a zero latency MOV that does not require an ALU by using MOVZX for the applicable AND values or it might be possible to change the previous load to be MOVZX.
0x0022 00034 (main.go:10) MOVBQZX DL, DX
See "Intel 64 and IA-32 Architectures Optimization Reference Manual" Section: "3.5.1.13 Zero-Latency MOV Instructions"
| Performance,compiler/runtime | low | Major |
145,749,119 | go | cmd/compile: make available as a library | It would be nice if there was an interface to the gc. I had extreme difficulty reading through the source code (maybe due to the fact it was transpiled from C), but I've come to the conclusion that it is pretty unrealistic to use the gc for anything, barring use of the go tool. How difficult would it be to give it an API and/or add it to the stdlib?
| NeedsDecision | medium | Major |
145,765,602 | go | runtime: 40us pause in file-backed serve loops | Summary: An idiomatic serve loop that reads from a file (as opposed to a socket) pauses for 40us before the request goroutine starts. We isolated this from a FUSE filesystem into a small benchmark.
The idiomatic serve loop (Cf. [src/net/http/server.go Serve](https://golang.org/src/net/http/server.go#L2116) and [bazil.org/fuse/fs/serve.go Serve](https://github.com/bazil/fuse/blob/master/fs/serve.go#L383)) processes a request on a new goroutine:
```
for {
req := accept()
go process(req)
}
```
We compared it against a no-concurrency serial server:
```
for {
req := accept()
process(req)
}
```
We measured the overhead (from the end of accept() to beginning of process()). Median of 100k runs for each strategy:
Serial: 441ns
Goroutine: 38us
For context, we've found the rest of our logic can run in ~10us, so the go scheduling overhead would be 400%
We tried a channel:
```
go func() {
for {
process(<-ch)
}
}
for {
req := accept()
ch <- req
}
```
Which is comparable to a Goroutine:
Serial: 441ns
Goroutine: 38us
Channel: 40us
Most servers read/accept from a socket, which the Go runtime implements using polling via the netpoller. FUSE reads from a file, which uses a blocking syscall. AIUI, the Go runtime will let the thread make the syscall, and then another thread of the runtime will notice it's blocked after ~20 us, and then reschedule work. These numbers seem similar which makes me think they're related.
Our workaround: service one process (both accept and process) on one goroutine and hand off the next request to a new goroutine. Strategy "handoff" looks like:
```
func serve() {
req := accept()
go serve()
process(req)
}
```
Serial: 441ns
Goroutine: 38us
Channel: 40us
Handoff: 671ns
I'm seeing this on Go version 1.6 darwin/amd64
Is this a known issue? Does it affect other platforms? Is our rewriting of the serve loop a known workaround?
Our full benchmark: http://play.golang.org/p/wc6hPnN778
Build it into a binary fileping. To run:
rm a b; mkfifo a; mkfifo b; ./bin/fileping -print -strategy handoff < b > a& ./bin/fileping -strategy serial < a > b& echo 000000000000000 > a
(Modify the -strategy argument in the first command to try different strategies)
| Performance,compiler/runtime | low | Minor |
145,784,728 | go | cmd/compile: possible inlining bug with variable renaming? | A reminder for myself to investigate variable renaming for inlining. See #4326 for a test case where variable numbering is used to prevent name collisions when inlining.
Specifically, is it not possible that two different functions, when inlined, collide when variables and numbers are equal? Try to create test case.
| compiler/runtime | low | Critical |
145,861,360 | neovim | show better error message if we don't have permissions to swap/, undo/, etc. | - Neovim version: 0.1.3-dev
- Operating system: Ubuntu 15.10
- Terminal emulator: zsh
### Actual behaviour
On a fresh new install the message `Unable to open swap file for "filename", recovery impossible` always show when opening any file.
### Expected behaviour
This shouldn't be the standard behavior on a fresh new install.
### Steps to reproduce
On a fresh new Ubuntu:
- install neovim
- open file
- observe
| ux | medium | Critical |
145,934,802 | opencv | ORB_GPU generates random features on each run | Apologies if the following is insufficient, hopefully it describes the problem adequately.
- OpenCV version: 2.4.11
- Host OS: Windows 7
### In which part of the OpenCV library you got the issue?
Examples:
- cuda, features2d
- object tracking
### Expected behaviour
feature detecting should generate the same features on each run
### Actual behaviour
random features are detected, when you run the CPU implementation it generates the same features on each run
### Additional description
I've observed that when running the ORB_GPU to detect features that it will generate random features on each run on the same image, this doesn't happen when you run the CPU implementation version. I don't see any changes to the OpenCV 3 source code for orb.cpp so it doesn't look like this has been resolved.
### Code example to reproduce the issue / Steps to reproduce the issue
```
#include "opencv2/core.hpp"
#include "opencv2/features2d/features2d.hpp"
#include "opencv2/imgproc/imgproc.hpp"
#include "opencv2/calib3d/calib3d.hpp"
#include "opencv2/gpu/gpu.hpp"
using namespace std;
using namespace cv;
int main( int argc, char** argv )
{
if( argc != 3 )
{ readme(); return -1; }
Mat img_1 = imread( argv[1], CV_LOAD_IMAGE_GRAYSCALE );
GpuMat gpuImg, mask;
gpuImg.upload(img_1);
if( !img_1.data || !img_2.data )
{ std::cout<< " --(!) Error reading images " << std::endl; return -1; }
//-- Step 1: Detect the keypoints using ORB_GPU Detector
cv::gpu ORB_GPU detector;
std::vector<KeyPoint> keypoints_1, keypoints_2;
detector( gpuImg, mask, keypoints_1 );
detector( gpuImg, mask, keypoints_2 );
Mat img_keypoints_1; Mat img_keypoints_2;
drawKeypoints( img_1, keypoints_1, img_keypoints_1, Scalar::all(-1), DrawMatchesFlags::DEFAULT );
drawKeypoints( img_1, keypoints_2, img_keypoints_2, Scalar::all(-1), DrawMatchesFlags::DEFAULT );
//-- Show detected (drawn) keypoints
imshow("Keypoints 1", img_keypoints_1 );
imshow("Keypoints 2", img_keypoints_2 );
waitKey(0);
return 0;
}
/**
* @function readme
*/
void readme()
{ std::cout << " Usage: ./SURF_detector <img1> <img2>" << std::endl; }
```
| bug,affected: 2.4,category: gpu/cuda (contrib) | low | Critical |
145,948,766 | kubernetes | Support port ranges or whole IPs in services | There are several applications like SIP apps or RTP which needs a lot of ports to run multiple calls or media streams. Currently there is no way to allow a range in ports in spec. So essentially I have to do this:
```
- name: sip-udp5060
containerPort: 5060
protocol: UDP
- name: sip-udp5061
containerPort: 5061
protocol: UDP
```
Doing above for 500 ports is not pretty. Can we have a way to allow port ranges like 5060-5160?
| priority/backlog,sig/network,area/kube-proxy,kind/feature,lifecycle/rotten | high | Critical |
146,130,967 | go | git-codereview: allow git change <hash> | git mail <hash> allows one to specify which of a set of CLs to mail, but git change has no such ability. When one stacks CLs in a single branch, as I do often, it's nice to be able to manage them individually.
git rebase-work provides this functionality but it seems like there's an asymmetry between mail and change that could be fixed.
| NeedsInvestigation | low | Minor |
146,185,663 | vscode | [rtl] Add Right-to-Left editing | Please add a feature to change writing direction.
For example, I want to edit markdown documents, and my language is Persian/Farsi, a Right-to-Left language. Now, when I edit documents, always it is left aligned and direction is left-to-right, and it is not comfortable to edit documents that have both Persian text and English text.
Thanks.
| feature-request,editor-core,editor-RTL | high | Critical |
146,265,084 | nvm | Prevent of patching `$PROFILE` | Let's use unix way with `$HOME/.profile.d` directory for requiring shell scripts without dirty hacks with `~/.profile`. I've realised basic patcher [profile_patcher](https://github.com/rumkin/profile_patcher) to do so.
| feature requests,installing nvm: profile detection | low | Major |
146,302,802 | youtube-dl | Support wildcards in --match-filter | ## Please follow the guide below
- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly
- Put an `x` into all the boxes [ ] relevant to your _issue_ (like that [x])
- Use _Preview_ tab to see how your issue will actually look like
---
### Make sure you are using the _latest_ version: run `youtube-dl --version` and ensure your version is _2016.04.05_. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.04.05**
### Before submitting an _issue_ make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
### What is the purpose of your _issue_?
- [x] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other
---
### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your _issue_
---
### If the purpose of this _issue_ is a _bug report_, _site support request_ or you are not completely sure provide the full verbose output as follows:
Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):
```
$ youtube-dl -v <your command line>
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'-v', u'http://www.youtube.com/watch?v=BaW_jenozKcj']
[debug] Encodings: locale cp1251, fs mbcs, out cp866, pref cp1251
[debug] youtube-dl version 2016.04.05
[debug] Python version 2.7.11 - Windows-2003Server-5.2.3790-SP2
[debug] exe versions: ffmpeg N-75573-g1d0487f, ffprobe N-75573-g1d0487f, rtmpdump 2.4
[debug] Proxy map: {}
...
<end of log>
```
---
### If the purpose of this _issue_ is a _site support request_ please provide all kinds of example URLs support for which should be included (replace following example URLs by **yours**):
- Single video: https://www.youtube.com/watch?v=BaW_jenozKc
- Single video: https://youtu.be/BaW_jenozKc
- Playlist: https://www.youtube.com/playlist?list=PL4lCao7KL_QFVb7Iudeipvc2BCavECqzc
---
### Description of your _issue_, suggested solution and other information
Explanation of your _issue_ in arbitrary form goes here. Please make sure the [description is worded well enough to be understood](https://github.com/rg3/youtube-dl#is-the-description-of-the-issue-itself-sufficient). Provide as much context and examples as possible.
If work on your _issue_ required an account credentials please provide them or explain how one can obtain them.
Hi, the "--match-filter" does not work on the "description" key :
```
$ youtube-dl --ignore-config -v --get-title https://www.youtube.com/channel/UCFyNsaSkagjA-z-o6qf10nA/videos --match-filter "description like *karambiri*"
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--ignore-config', u'-v', u'--get-title', u'https://www.youtube.com/channel/UCFyNsaSkagjA-z-o6qf10nA/videos', u'--match-filter', u'description like *karambiri*']
[debug] Encodings: locale UTF-8, fs UTF-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.05
[debug] Python version 2.7.8 - Linux-3.16.0-44-generic-x86_64-with-Ubuntu-14.10-utopic
[debug] exe versions: avconv 11.2-6, avprobe 11.2-6, ffmpeg 3.0.1-1, ffprobe 3.0.1-1, rtmpdump 2.4
[debug] Proxy map: {}
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl", line 11, in <module>
sys.exit(main())
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 419, in main
_real_main(argv)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/__init__.py", line 409, in _real_main
retcode = ydl.download(all_urls)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1725, in download
url, force_generic_extractor=self.params.get('force_generic_extractor', False))
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 680, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 732, in process_ie_result
extra_info=extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 680, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 840, in process_ie_result
extra_info=extra)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 732, in process_ie_result
extra_info=extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 680, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 725, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1371, in process_video_result
self.process_info(new_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1442, in process_info
reason = self._match_entry(info_dict, incomplete=False)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 632, in _match_entry
ret = match_filter(info_dict)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/utils.py", line 2105, in _match_func
if match_str(filter_str, info_dict):
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/utils.py", line 2100, in match_str
_match_one(filter_part, dct) for filter_part in filter_str.split('&'))
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/utils.py", line 2100, in <genexpr>
_match_one(filter_part, dct) for filter_part in filter_str.split('&'))
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/utils.py", line 2093, in _match_one
raise ValueError('Invalid filter part %r' % filter_part)
ValueError: Invalid filter part u'description like *karambiri*'
$ echo $?
1
```
Can you help ?
| request | low | Critical |
146,389,342 | opencv | Camera is not being released. camera.release() not working | ### Please state the information for your system
- OpenCV version: 2.4.10
- Host OS: Linux (Ubuntu 14.04)
### In which part of the OpenCV library you got the issue?
- Camera capture and releasing
### Expected behaviour
I have a program that have two "programs" inside, in each one of them the camera will be open, but from a different class. When the first class close it supposed to release the camera. I have an camera.release() there, but it's not working.
### Actual behaviour
The camera keep on, the light, and it's not being released, when i try to access it from the other "program" it gives
> HIGHGUI ERROR: V4L2: Pixel format of incoming image is unsupported by OpenCV
> VIDIOC_STREAMON: Bad file descriptor
> OpenCV Error: Assertion failed (size.width>0 && size.height>0) in imshow, file /home/schirrel/Github/opencv/opencv-2.4.10/modules/highgui/src/window.cpp, line 261
> terminate called after throwing an instance of 'cv::Exception'
> what(): /home/schirrel/Github/opencv/opencv-2.4.10/modules/highgui/src/window.cpp:261: error: (-215) size.width>0 && size.height>0 in function imshow
### Code
```
while (!janela->FINALIZADA || !FIM) {
camera >> frame;
....
....
...
if (key == 99) {
cv::destroyAllWindows();
camera.release();
break;
}
}
```
| bug,affected: 2.4,category: videoio(camera) | low | Critical |
146,444,032 | nvm | install nightly? | Would it be possible to install nightly versions via nvm?
Different folder. Good news is that they have a file listing that seems to be sorted newest on top:
https://nodejs.org/download/nightly/index.tab
| installing node,feature requests | medium | Critical |
146,455,927 | TypeScript | Is there a MSBuild parameter that tells VS which `tsconfig.json` to use? | I have 2 tsconfig.json files:
- tsconfig.full.json
- tsconfig.quick.json
I want to be able to point the VS2015 to either one of them accorting to the configuration parameters in `*.targets` files. How can I do it?
| Bug,Visual Studio | medium | Major |
146,505,289 | go | cmd/compile: suboptimal compilation of struct-valued switch statements | For [CL 21627](https://golang.org/cl/21627), I evaluated replacing the switch statement in cmd/link/internal/ld.relSize with:
```
type ft struct {
af sys.ArchFamily
et byte
}
switch (ft{SysArch.Family, byte(elftype)}) {
...
case ft{sys.S390X, R_390_8}:
...
}
```
But this ends up compiling into much less efficient code than the existing idiom of combining into integer constants:
1. The integer constant cases are implemented as a binary search; the struct cases are implemented as linear search.
2. The struct temporary variables are constructed on the stack using _three_ MOVB instructions (even though they're only two bytes large; one of the MOVBs is a useless 0-initialization).
3. Both the switch and case statement's temporary struct variable needs to be loaded from memory each time, even though the switch variable ends up staying register-resident the entire time.
4. Each case statement's temporary variable is independently allocated stack memory, even though their lifetimes don't overlap.
| Performance,compiler/runtime | low | Minor |
146,526,811 | go | runtime: current heapdump format is undocumented | runtime/debug.WriteHeapDump's godocs link to https://golang.org/s/go15heapdump, but that describes a file format that starts with "go1.5 heap dump\n".
Currently, runtime.dumphdr is "go1.7 heap dump\n". Before 30f93f09, it was "go1.6 heap dump\n". So that's at least two revisions to the heap dump file format that are undocumented.
Relevant because https://go-review.googlesource.com/#/c/21647/1 might change the heap dump format again.
/cc @crawshaw
| Documentation,NeedsFix,compiler/runtime | low | Critical |
146,563,626 | go | spec: clarify assignability for non-constant untyped boolean values | Consider the initialization of `c` in the following example:
http://play.golang.org/p/iwCeX6lwkg
``` Go
package main
var (
a, b int
c bool = a > b
)
func main() {}
```
We have an untyped boolean value result of the comparison operator ("Comparison
operators compare two operands and yield an untyped boolean value.")
Regarding the declaration of `c` in the example, the specification says
(https://golang.org/ref/spec#Variable_declarations):
> (1) If a list of expressions is given, the variables are initialized with the
> expressions following the rule for assignments.
> (2) Otherwise, each variable is initialized to its zero value.
>
> (3) If a type is present, each variable is given that type.
> (4) Otherwise, each variable is given the type of the corresponding
> initialization value in the assignment. If that value is an untyped constant,
> it is first converted to its default type; if it is an untyped boolean value,
> it is first converted to type bool.
The example falls in the clauses (1) and (3). Clause (2) is not applicable,
because an initializer expression is given and (4) is not applicable, because a
type is present; in particular, the implicit conversion to `bool` in specified
by (4) does not take place.
Then, following (1) we consult the "rules for assignments"
(https://golang.org/ref/spec#Assignments)
> In assignments, each value must be assignable to the type of the operand to
> which it is assigned, with the following special cases:
> (1) Any typed value may be assigned to the blank identifier.
> (2) If an untyped constant is assigned to a variable of interface type or the
> blank identifier, the constant is first converted to its default type.
> (3) If an untyped boolean value is assigned to a variable of interface type or
> the blank identifier, it is first converted to type bool.
The special case (1) is not applicable, because neither the assignments is to
the blank identifier, nor the assigned value is untyped.
The special case (2) is not applicable, because neither the assigned value is an
untyped constant (it's not a constant), nor it is assigned to a variable of an
interface type (the type is `bool`), nor to the blank identifier
The special case (3) is not applicable, because the untyped boolean value is not
assigned to a variable of an interface type, or the blank identifier.
Therefore, the initialization of `c` must be checked according to the
assignability criteria (https://golang.org/ref/spec#Assignability) :
> A value x is assignable to a variable of type T ("x is assignable to T") in
> any of these cases:
> (1) x's type is identical to T.
> (2) x's type V and T have identical underlying types and at least one of V or T is
> not a named type.
> (3) T is an interface type and x implements T.
> (4) x is a bidirectional channel value, T is a channel type, x's type V and T have
> identical element types, and at least one of V or T is not a named type.
> (5) x is the predeclared identifier nil and T is a pointer, function, slice, map,
> channel, or interface type.
> (6) x is an untyped constant representable by a value of type T.
Clause (1) is not applicable because `T` is `bool` and the value is untyped
boolean.
Clause (2) is not applicable, because there is no way to derive an "underlying
type" (https://golang.org/ref/spec#Types) untyped boolean values.
Clause (3) is not applicable because `bool` is not an interface type.
Clause (4) is not applicable, because neither the expression's type, nor `T` is
a channel type.
Clause (5) it not applicable, because neither the expression if the `nil`, nor
`T` is one of the enumerated in the clause types.
Clause (6) is not applicable, because the expression is not an untyped constant.
In conclusion, I couldn't find a text the specification, which renders the above
example program as correct. Similar issues arise with initializations and
assignments involving the additional untyped boolean values, yielded by type
assertions, receive operators, or map index operators.
The compilers (`go`, `gccgo` and `gotypes`) all accept the example program.
It seems there's an omission in the specification. One possible way to fix it is
to add to the assignability criteria a clause, which specifies that an untyped
boolean value is assignable to `T` if the underlying type of `T` is `bool`.
| Documentation,NeedsInvestigation | low | Minor |
146,710,693 | react | Support Passive Event Listeners | https://github.com/WICG/EventListenerOptions/blob/gh-pages/explainer.md
It would be good to have everything be passive by default and only opt-in to active when needed. E.g. you could listen to text input events but only preventDefault or used controlled behavior when you have active listeners.
Similarly, we could unify this with React Native's threading model. E.g. one thing we could do there is synchronously block the UI thread when there are active listeners such as handling keystrokes.
cc @vjeux @ide
| Type: Feature Request,Component: DOM,Type: Big Picture,React Core Team | high | Critical |
146,723,885 | go | x/exp/shiny/driver/x11driver: implement back buffer | Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
1.6
1. 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/eaburns"
GORACE=""
GOROOT="/home/eaburns/src/go.googlesource.com/go"
GOTOOLDIR="/home/eaburns/src/go.googlesource.com/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"
```
1. What did you do?
Use shiny x11driver
1. What did you expect to see?
Double buffering.
1. What did you see instead?
No double buffering.
| help wanted,NeedsFix | low | Minor |
146,754,120 | electron | Working with GIFs in the clipboard / NativeImage | I'm trying to read a GIF from the clipboard and write it to a file. However only the first frame of the GIF is actually used. I assume this is because NativeImage only supports PNG/JPG so far.
Is there currently any way to work around this issue with GIFs?
| enhancement :sparkles:,component/clipboard | medium | Major |
146,845,443 | rust | Add an "inherits" key or similar to JSON target specs | Looking at #32818, most of the target spec used there is just copying the existing `i686-pc-windows-msvc` target settings. This seems a little unnecessary, especially if we add to the options in the spec. A key in the JSON that indicates an existing target to use as a base seems like it would be useful.
Potential names:
- "inherits"
- "extends"
- "base"
| C-feature-request,A-target-specs | low | Major |
146,935,502 | go | crypto/x509: support DirectoryName name constraints | I would like to request for the adoption of change [3230 ](https://go-review.googlesource.com/#/c/3230/)which is in code review for a long time.
> This change extents the Name Constraint properties by adding the Excluded property for DNSDomains and both the permitted and excluded properties for EmailDomains, IPAddresses and DirectoryNames as specified for the GeneralName property in RFC5280.
>
> The selected properties are required to create or validate a fully constrained certificate.
>
> The change also improves the validation of Name Constraints in general and allows the parsing of certificates that have Name Constraints marked as cirtial.
https://go-review.googlesource.com/#/c/3230/
Change-Id: Idaa7abafec372d5eb444cad7ee2ea5794aee3424
To be able to validate all certificates issued according to the CA / Browser Forum Baseline Requirements the full set of name constraints need to be available in GO.
A recent version of the CA / Browser Forum Baseline Requirements states that Technical Constraints in Subordinate CA Certificates MUST be applied via Name Constraints. To support strong and strict certificate path validation and to allow users to see the actual constraints it's important that GO supports the required Name Constraints.
Section 9.7 of the baseline requirements states:
> "If the Subordinate CA Certificate includes the id-kp-serverAuth extended key usage, then the Subordinate CA Certificate MUST include the Name Constraints X.509v3 extension with constraints on dNSName, iPAddress and DirectoryName as follows:-"
The full requirements can be found on: https://cabforum.org/baseline-requirements-documents/
The DirectoryName is also needed in some Microsoft environments. Forbidding all directory names would enforce domain validated certificates even if all certificates under a specific root are used and issued by the same organisation. Or could enforce all certificates to be issued with the same OV certificate details. Email addresses are not specifically handled by the CABForum because they don't cover client auth or s/mime certificates currently but likely to have the same requirements and make the set of constraints supported complete.
| NeedsDecision,FeatureRequest | medium | Critical |
146,968,152 | go | x/crypto/ssh: TestClientUnsupportedKex : use of close network connection on FreeBSD. | I noticed these failing ssh tests on a freebsd-amd64 trybot:
https://storage.googleapis.com/go-build-log/01360a64/freebsd-amd64-gce101_5e66e373.log
```
--- FAIL: TestClientAuthPublicKey (0.00s)
client_auth_test.go:97: unable to dial remote side: ssh: handshake failed: ssh: unexpected message type 21 (expected 6)
--- FAIL: TestClientUnsupportedKex (0.00s)
client_auth_test.go:256: got ssh: handshake failed: write tcp 127.0.0.1:30006->127.0.0.1:63686: use of closed network connection, expected 'common algorithm'
FAIL
FAIL golang.org/x/crypto/ssh 1.024s
```
| NeedsInvestigation | low | Critical |
147,001,687 | TypeScript | Flag for strict default function `this` types for call-site and assignability checking (`--strictThis`) | #6018 was originally going to add a `--strictThis` flag that made function `this` types default to `void` or the enclosing class (instead of `any`) for purposes of call-site and assignability checking, but that functionality was dropped ([details](https://github.com/Microsoft/TypeScript/issues/6018#issuecomment-207479337)). This is a follow-up suggestion for the dropped functionality, whatever the flag ends up being named.
| Suggestion,Awaiting More Feedback,Add a Flag | medium | Critical |
147,021,486 | neovim | Empty undo file after system crash | - Neovim version: v0.1.3-361-g5730ad9
- Vim behaves differently? No
- Operating system/version: Arch Linux
I've had my machine lock up hard while using Neovim (mouse could not be moved, SSHing did not work etc), and after restarting, an undo file for a rather important file was empty?!
> E823: Not an undo file: /home/user/.local/share/vim/undo/...
The file itself is empty (0 bytes).
The file system is ext4.
I could imagine that the behavior here could be improved by not re-writing the undofile, but `mv`ing it instead? (similar to `backupcopy`?!)
Relevant options I have set: `fsync` (default), `backup` (default), `backupcopy=yes` (default).
| robustness,bug-vim,io,system | medium | Critical |
147,035,520 | rust | Pluggable panic implementations (tracking issue for RFC 1513) | Tracking issue for rust-lang/rfcs#1513.
`-C panic=abort` is now stable, but the ability to create customized panic implementations is still unstable.
| P-low,T-lang,T-libs-api,B-unstable,B-RFC-implemented,C-tracking-issue,A-error-handling,Libs-Tracked,S-tracking-perma-unstable | medium | Critical |
147,037,803 | rust | Allocator traits and std::heap | 📢 **This feature has a dedicated working group**, please direct comments and concerns to [the working group's repo](https://github.com/rust-lang/wg-allocators).
The remainder of this post is no longer an accurate summary of the current state; see that dedicated working group instead.
<details>
<summary>Old content</summary>
Original Post:
-----
FCP proposal: https://github.com/rust-lang/rust/issues/32838#issuecomment-336957415
FCP checkboxes: https://github.com/rust-lang/rust/issues/32838#issuecomment-336980230
---
Tracking issue for rust-lang/rfcs#1398 and the `std::heap` module.
- [x] land `struct Layout`, `trait Allocator`, and default implementations in `alloc` crate (https://github.com/rust-lang/rust/pull/42313)
- [x] decide where parts should live (e.g. default impls has dependency on `alloc` crate, but `Layout`/`Allocator` _could_ be in `libcore`...) (https://github.com/rust-lang/rust/pull/42313)
- [ ] fixme from source code: audit default implementations (in `Layout` for overflow errors, (potentially switching to overflowing_add and overflowing_mul as necessary).
- [x] decide if `realloc_in_place` should be replaced with `grow_in_place` and `shrink_in_place` ([comment](https://github.com/rust-lang/rust/issues/32838#issuecomment-208141759)) (https://github.com/rust-lang/rust/pull/42313)
- [ ] review arguments for/against associated error type (see subthread [here](https://github.com/rust-lang/rfcs/pull/1398#issuecomment-204561446))
- [ ] determine what the requirements are on the alignment provided to `fn dealloc`. (See discussion on [allocator rfc](https://github.com/rust-lang/rfcs/pull/1398#issuecomment-198584430) and [global allocator rfc](https://github.com/rust-lang/rfcs/pull/1974#issuecomment-302789872) and [trait `Alloc` PR](https://github.com/rust-lang/rust/pull/42313#issuecomment-306202489).)
* Is it required to deallocate with the exact `align` that you allocate with? [Concerns have been raised](https://github.com/rust-lang/rfcs/pull/1974#issuecomment-302789872) that allocators like jemalloc don't require this, and it's difficult to envision an allocator that does require this. ([more discussion](https://github.com/rust-lang/rfcs/pull/1398#issuecomment-198584430)). @ruuda and @rkruppe look like they've got the most thoughts so far on this.
- [ ] should `AllocErr` be `Error` instead? ([comment](https://github.com/rust-lang/rust/pull/42313#discussion_r122580471))
- [x] Is it required to deallocate with the *exact* size that you allocate with? With the `usable_size` business we may wish to allow, for example, that you if you allocate with `(size, align)` you must deallocate with a size somewhere in the range of `size...usable_size(size, align)`. It appears that jemalloc is totally ok with this (doesn't require you to deallocate with a *precise* `size` you allocate with) and this would also allow `Vec` to naturally take advantage of the excess capacity jemalloc gives it when it does an allocation. (although actually doing this is also somewhat orthogonal to this decision, we're just empowering `Vec`). So far @Gankro has most of the thoughts on this. (@alexcrichton believes this was settled in https://github.com/rust-lang/rust/pull/42313 due to the definition of "fits")
- [ ] similar to previous question: Is it required to deallocate with the *exact* alignment that you allocated with? (See comment from [5 June 2017](https://github.com/rust-lang/rust/pull/42313#issuecomment-306202489))
- [x] OSX/`alloc_system` is buggy on *huge* alignments (e.g. an align of `1 << 32`) https://github.com/rust-lang/rust/issues/30170 #43217
- [ ] should `Layout` provide a `fn stride(&self)` method? (See also https://github.com/rust-lang/rfcs/issues/1397, https://github.com/rust-lang/rust/issues/17027 )
- [x] `Allocator::owns` as a method? https://github.com/rust-lang/rust/issues/44302
State of `std::heap` after https://github.com/rust-lang/rust/pull/42313:
```rust
pub struct Layout { /* ... */ }
impl Layout {
pub fn new<T>() -> Self;
pub fn for_value<T: ?Sized>(t: &T) -> Self;
pub fn array<T>(n: usize) -> Option<Self>;
pub fn from_size_align(size: usize, align: usize) -> Option<Layout>;
pub unsafe fn from_size_align_unchecked(size: usize, align: usize) -> Layout;
pub fn size(&self) -> usize;
pub fn align(&self) -> usize;
pub fn align_to(&self, align: usize) -> Self;
pub fn padding_needed_for(&self, align: usize) -> usize;
pub fn repeat(&self, n: usize) -> Option<(Self, usize)>;
pub fn extend(&self, next: Self) -> Option<(Self, usize)>;
pub fn repeat_packed(&self, n: usize) -> Option<Self>;
pub fn extend_packed(&self, next: Self) -> Option<(Self, usize)>;
}
pub enum AllocErr {
Exhausted { request: Layout },
Unsupported { details: &'static str },
}
impl AllocErr {
pub fn invalid_input(details: &'static str) -> Self;
pub fn is_memory_exhausted(&self) -> bool;
pub fn is_request_unsupported(&self) -> bool;
pub fn description(&self) -> &str;
}
pub struct CannotReallocInPlace;
pub struct Excess(pub *mut u8, pub usize);
pub unsafe trait Alloc {
// required
unsafe fn alloc(&mut self, layout: Layout) -> Result<*mut u8, AllocErr>;
unsafe fn dealloc(&mut self, ptr: *mut u8, layout: Layout);
// provided
fn oom(&mut self, _: AllocErr) -> !;
fn usable_size(&self, layout: &Layout) -> (usize, usize);
unsafe fn realloc(&mut self,
ptr: *mut u8,
layout: Layout,
new_layout: Layout) -> Result<*mut u8, AllocErr>;
unsafe fn alloc_zeroed(&mut self, layout: Layout) -> Result<*mut u8, AllocErr>;
unsafe fn alloc_excess(&mut self, layout: Layout) -> Result<Excess, AllocErr>;
unsafe fn realloc_excess(&mut self,
ptr: *mut u8,
layout: Layout,
new_layout: Layout) -> Result<Excess, AllocErr>;
unsafe fn grow_in_place(&mut self,
ptr: *mut u8,
layout: Layout,
new_layout: Layout) -> Result<(), CannotReallocInPlace>;
unsafe fn shrink_in_place(&mut self,
ptr: *mut u8,
layout: Layout,
new_layout: Layout) -> Result<(), CannotReallocInPlace>;
// convenience
fn alloc_one<T>(&mut self) -> Result<Unique<T>, AllocErr>
where Self: Sized;
unsafe fn dealloc_one<T>(&mut self, ptr: Unique<T>)
where Self: Sized;
fn alloc_array<T>(&mut self, n: usize) -> Result<Unique<T>, AllocErr>
where Self: Sized;
unsafe fn realloc_array<T>(&mut self,
ptr: Unique<T>,
n_old: usize,
n_new: usize) -> Result<Unique<T>, AllocErr>
where Self: Sized;
unsafe fn dealloc_array<T>(&mut self, ptr: Unique<T>, n: usize) -> Result<(), AllocErr>
where Self: Sized;
}
/// The global default allocator
pub struct Heap;
impl Alloc for Heap {
// ...
}
impl<'a> Alloc for &'a Heap {
// ...
}
/// The "system" allocator
pub struct System;
impl Alloc for System {
// ...
}
impl<'a> Alloc for &'a System {
// ...
}
```
</details> | B-RFC-approved,A-allocators,T-lang,T-libs-api,B-unstable,C-tracking-issue,Libs-Tracked,S-tracking-needs-summary | high | Critical |
147,065,803 | go | cmd/vet: check for http.Error followed by other statements in handler? | Using `go1.6`
I recently saw code that did the following:
```
func serveHTTP(resp http.ResponseWriter, req *http.Request) {
...
if err := foo(); err != nil {
http.Error(resp, err.Error(), http.StatusInternalServerError)
}
if err := bar(); err != nil {
http.Error(resp, err.Error(), http.StatusInternalServerError)
}
}
```
The assumption made was that http.Error() terminates the current handler in some magical way. Instead, Error simply sets the headers and writes the body message, and it is the programmer's responsibility to return. We should document this.
| Analysis | low | Critical |
147,094,816 | neovim | Suggest add the ability to filter "Tag match list" according kind type | In most situations, I want to jump to the function definition when I run `:tj tagname`, but the result will return all kinds of tags include both `prototype` and `function`.
Could we add options for `tj` liked commands, so when we run `:tj tagname kind=function`, it only return all the function tags?
Thanks.
| enhancement | low | Minor |
147,128,392 | go | proposal: spec: allow assignment-compatible values in append and copy | As discussed [here](https://groups.google.com/forum/#!searchin/golang-nuts/copy/golang-nuts/C9S-ztnDnI8/SWBNQDh7FQAJ), it might be useful to make the append and copy built-ins somewhat more accepting of different types.
I have made a proposal document here:
https://docs.google.com/document/d/1HilKzERLb521XaG0Lgi6zkkj25VlXqc1oHEUmQ1v3aI
| LanguageChange,Proposal,LanguageChangeReview | medium | Critical |
147,131,369 | youtube-dl | Site support request: Request to support downloading from http://music.raag.fm | Hello there, request you to pls add support for downloading from the site http://music.raag.fm
Example full URL's
Full Album: http://music.raag.fm/punjabi-songs/various-the-djs-1-vol-1
Single song: http://music.raag.fm/song/337802/yaari-jattan-di-malkit-singh
Playlist: http://music.raag.fm/user/16001/music-meniac
Thanks -Jay
| site-support-request | low | Minor |
147,164,896 | youtube-dl | TV2 doesn't work for sumo.tv2.no | ## Please follow the guide below
- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly
- Put an `x` into all the boxes [ ] relevant to your _issue_ (like that [x])
- Use _Preview_ tab to see how your issue will actually look like
---
### Make sure you are using the _latest_ version: run `youtube-dl --version` and ensure your version is _2016.04.06_. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.04.06**
### Before submitting an _issue_ make sure you have:
- [x] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
### What is the purpose of your _issue_?
- [ ] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [x] Other
---
### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your _issue_
---
### If the purpose of this _issue_ is a _bug report_, _site support request_ or you are not completely sure provide the full verbose output as follows:
Add `-v` flag to **your command line** you run youtube-dl with, copy the **whole** output and insert it here. It should look similar to one below (replace it with **your** log inserted between triple ```):
```
qp:TV2 Trox$ youtube-dl --verbose https://sumo.tv2.no/c-more/c-more-filmer/beck-den-siste-dagen-1032154.html
[debug] System config: []
[debug] User config: []
[debug] Command-line args: [u'--verbose', u'https://sumo.tv2.no/c-more/c-more-filmer/beck-den-siste-dagen-1032154.html']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.06
[debug] Python version 2.7.11 - Darwin-15.3.0-x86_64-i386-64bit
[debug] exe versions: avconv 11.4, avprobe 11.4, ffmpeg 3.0.1, ffprobe 3.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[generic] beck-den-siste-dagen-1032154: Requesting header
WARNING: Falling back on generic information extractor.
[generic] beck-den-siste-dagen-1032154: Downloading webpage
[generic] beck-den-siste-dagen-1032154: Extracting information
ERROR: Unsupported URL: https://sumo.tv2.no/c-more/c-more-filmer/beck-den-siste-dagen-1032154.html
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 1348, in _real_extract
doc = compat_etree_fromstring(webpage.encode('utf-8'))
File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 279, in compat_etree_fromstring
doc = _XML(text, parser=etree.XMLParser(target=etree.TreeBuilder(element_factory=_element_factory)))
File "/usr/local/bin/youtube-dl/youtube_dl/compat.py", line 268, in _XML
parser.feed(text)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1642, in feed
self._raiseerror(v)
File "/usr/local/Cellar/python/2.7.11/Frameworks/Python.framework/Versions/2.7/lib/python2.7/xml/etree/ElementTree.py", line 1506, in _raiseerror
raise err
ParseError: syntax error: line 1, column 0
Traceback (most recent call last):
File "/usr/local/bin/youtube-dl/youtube_dl/YoutubeDL.py", line 669, in extract_info
ie_result = ie.extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/common.py", line 323, in extract
return self._real_extract(url)
File "/usr/local/bin/youtube-dl/youtube_dl/extractor/generic.py", line 2012, in _real_extract
raise UnsupportedError(url)
UnsupportedError: Unsupported URL: https://sumo.tv2.no/c-more/c-more-filmer/beck-den-siste-dagen-1032154.html
...
<end of log>
```
---
### If the purpose of this _issue_ is a _site support request_ please provide all kinds of example URLs support for which should be included (replace following example URLs by **yours**):
- Single video: https://sumo.tv2.no/c-more/c-more-filmer/beck-den-siste-dagen-1032154.html
---
### Description of your _issue_, suggested solution and other information
You support tv2.no, but when I try to download a video from sumo.tv2.no, I get an unsupported URL error.
| geo-restricted,account-needed | low | Critical |
147,180,071 | TypeScript | Suggestion: stricter operators | Currently operators like "+" are defined such that they match their semantics in JS. The below are all allowed by the compiler and produce the shown values, even with `--strictNullChecks` on.
- `2 + 'a'` => `"2a"`
- `null + 'a'` => `"nulla"` (!)
- `2 - null` => `2`
I propose letting users opt in (maybe via some `--strictOperators`) to strict operator behavior. Concretely I think this means:
- restrict `+`, and `+=` to just `number` and `string`, e.g. for the former only declare
``` js
function +(a: number, b: number): number;
function +(a: string, b: string): string;
```
- restrict `-` and `-=` to just `number`
(`any` should continue to work as normal, of course.)
Relevant spec section:
https://github.com/Microsoft/TypeScript/blob/master/doc/spec.md#419-binary-operators
See also "Expression operators" in the `strictNullTypes` change: https://github.com/Microsoft/TypeScript/pull/7140
and in particular this rationale: https://github.com/Microsoft/TypeScript/pull/7140#issuecomment-186432250
This would fall under of "stricter" TypeScript, https://github.com/Microsoft/TypeScript/issues/274 .
| Suggestion,Help Wanted,Effort: Moderate | medium | Major |
147,195,947 | opencv | viz::Viz3d window closes automatically after thread being ended | ### Please state the information for your system
- OpenCV version: 3.1
- Host OS: Windows 10
### In which part of the OpenCV library you got the issue?
Examples:
- viz
- viz::Viz3d window closes automatically after thread being ended
### Expected behaviour
### Actual behaviour
### Additional description
I want to visualize a gradually growing point cloud using viz::Viz3d, and I've tried to show and update a viz::Viz3d window from within a thread, it runs just OK, but when the thread ends the viz::Viz3d window also disappears, which I think is abnormal, I expected the viz::Viz3d window to stay open so I can check out the overall quality of the point cloud when it is completed.
### Code example to reproduce the issue / Steps to reproduce the issue
``` .cpp
// the basic structure of my codes is shown below (kinda like a pseudo-code):
viz::Viz3d wnd3d("3D Window");
UINT Thread(LPVOID param)
{
for (int i = 0; i < nImgs; ++i)
{
Mat XYZs = GeneratePointCloud(vImgs[i]);
viz::WCloud cld(XYZs);
wnd3d.showWidget("cloud", cld);
wnd3d.spinOnce();
}
return TRUE;
}
void OnClickMenu()
{
// TODO: Add your command handler code here
AfxBeginThread(Thread, this, THREAD_PRIORITY_NORMAL);
}
```
| feature,category: viz | low | Minor |
147,214,866 | TypeScript | negating type constraints | Sometimes it's useful to put a limit on what a type parameter can be. In a way it is a counterpart of the `extends` constraint.
### Problem
Consider an example, a [classic function](https://msdn.microsoft.com/en-us/library/ee340357.aspx) that takes whatever and returns void:
```
function ignore<a>(value: a) : void {};
```
However we must not apply this function to Promises, because it might get us a temporal leak if we do.
```
function readFileAsync(): Promise<string>;
ignore(readFileAsync()); // <-- untracked promise, temporal leak
```
Unfortunately it is way too easy to get into a situation when a promise is passed to that function unintentionally as a result of refactoring:
```
// before
function readFileSync(): string;
ignore(readFileSync()); // typechecks, works as intended, no problem
// after refactoring
function readFileAsync(): Promise<string>; // <-- went async here
ignore(readFileAsync()); // typechecks, unintended temporal leak, big problem
```
### Solution
The situation above could have been avoided if TypeScript allowed negating constraints:
```
function ignore<a unlike Promise<any>>(value: a): void {} // <-- hypothetical syntax
```
| Suggestion,Awaiting More Feedback | medium | Critical |
147,249,080 | go | runtime: avoid unnecessary work in allocSpanLocked | [moved from #14921]
These two lines in "*mheap.allocSpanLocked" are (or hopefully will soon be) the most common source of writebarrierptr calls for which *dst == src.
```
588: h_spans[p-1] = s
603: h_spans[p+n] = s
```
(Line numbers from commit de7ee57c7ead59899d5b412a839c995de0e813b5.)
As @aclements notes, this might be best addressed by algorithmic improvements. If those assignments are doing nothing, probably lots of the surrounding code is either.
| compiler/runtime | low | Minor |
147,294,445 | go | net: use IPv4/IPv6/MAC/EUI reserved address blocks for documentation | There are reserved address blocks for documentation; https://tools.ietf.org/html/rfc5737 and https://tools.ietf.org/html/rfc3849. It'd be better to use them for documentation updates.
- IPv4 address block for doc: 192.0.2.0/24, 198.51.100.0/24 and 203.0.113.0/24
- IPv6 address block for doc: 2001:db8::/32 (also see https://tools.ietf.org/html/rfc5952)
| Documentation,help wanted,NeedsInvestigation | low | Major |
147,542,981 | TypeScript | Exported ambient variables are neither emitted nor an error | **TypeScript Version:**
1.9.0-dev.20160411
**Code**
foo.ts:
``` typescript
export type Foo = { bar: string; }
declare var foo: Foo;
export { foo };
```
bar.ts:
``` typescript
import { foo } from "./foo";
console.log(foo.bar);
```
`tsc -t es5 -m commonjs ./foo.ts ./bar.ts`
**Expected behavior:**
Either it should be an error to export an ambient variable, or it should be emitted something like this:
foo.js:
``` javascript
"use strict";
exports.foo = foo;
```
bar.js:
``` javascript
"use strict";
var foo_1 = require("./foo");
console.log(foo_1.foo.bar);
```
**Actual behavior:**
No error, and foo.js is emitted with no export, causing bar.js to blow up at runtime.
foo.js:
``` javascript
"use strict";
```
| Bug | low | Critical |
147,551,216 | go | cmd/compile: eliminate write barrier for self-referencing pointer | Go code often does something like:
```
type Buffer struct {
buf []byte
bootstrap [64]byte
}
var b *Buffer = ...
b.buf = b.bootstrap[:]
```
I don't think we need a write barrier when we write the slice pointer into b.buf, because the pointer always points from an object into (part of) itself.
But see the discussion in #14855 . Writing a pointer to the heap without a write barrier is tricky in the presence of races. Make sure the arguments in that issue don't apply here (I don't think they do, writing a self-pointer is like writing nil).
@aclements
| Performance,compiler/runtime | low | Minor |
147,870,571 | kubernetes | Multiple RateLimiters in a "single" client. | Ref. #22421
Currently one "client", or rather ClientSet consists of multiple clients (one for each API group). This makes reasoning about QPS per component much harder - clients in a single ClientSet should share a single RateLimiter.
cc @wojtek-t @krousey @wojtek-t
| sig/api-machinery,lifecycle/frozen | low | Major |
147,894,207 | go | x/build/cmd/coordinator: make trybots post their status report upon cancellation | If trybots cancel themselves due to a new patchset version or the current patchset being merged, they should post their status to Gerrit before they go away.
| Builders,NeedsFix,FeatureRequest | low | Minor |
147,896,059 | rust | DWARF doesn't distinguish struct, tuple, and tuple struct | Currently the DWARF generated by rustc doesn't distinguish a struct, a tuple, or a tuple struct. They are all represented by `DW_TAG_structure_type`.
In gdb I handle this by examining the type name and assume that if it starts with "(" then it is a tuple. A tuple struct is detected by seeing if the first field is named "__0". Neither of these methods are really very good -- they work ok with today's debuginfo but are not really in the spirit of DWARF.
This requires a DWARF addition. In the short term it would be possible to pick an extension value in the `DW_AT` user space (this must be done carefully to avoid clashing with other known extensions).
| A-debuginfo,P-low,T-compiler,C-bug | low | Critical |
147,933,595 | go | x/build: set GOTRACEBACK=2 on all builders? | Some of the bugs are fairly hard to reproduce, and without
the system function stacks, it's difficult to see the problem.
For example, #15145.
I propose that we set `GOTRACEBACK=2` on all builders.
| Builders,Proposal,Proposal-Accepted | low | Critical |
148,034,803 | go | x/text/currency: add support for arbitrary-precision currency amounts | Add support for arbitrary-precision currency amounts with math/big. The interface as-is could handle things like currency.USD.Amount(big.Rat(1, 100)).
| NeedsDecision,FeatureRequest | low | Major |
148,035,071 | TypeScript | No compile error thrown when `this` referenced before call to `super` completes | **TypeScript Version:**
1.8.9
**Code**
JSFiddle: https://jsfiddle.net/kitsonk/fs9t96ep/
TS Playground: http://goo.gl/X7cgvV
``` ts
class A {
constructor(fn: () => void) {
fn.call(this);
}
foo: string = 'foo';
}
class B extends A {
constructor() {
super(() => {
console.log(this);
});
}
bar: string = 'bar';
}
const b = new B();
```
**Expected behavior:**
Typescript should guard against the use of `this` as the call to `super` has not completed. Thus it should not compile.
**Actual behavior:**
Typescript compiles this successfully. It works fine when the target is set to `es5` but breaks the browser when target is set to `es6`.
Error is: VM89:55 Uncaught ReferenceError: this is not defined
| Suggestion,Help Wanted,Effort: Difficult | low | Critical |
148,127,806 | youtube-dl | [GameOne] Unable to extract video url | http://gameone.de/tv/220
```
$ youtube-dl --verbose 'http://gameone.de/tv/220'
[debug] System config: []
[debug] User config: ['-4', '--prefer-free-formats', '--no-cache-dir', '--no-mtime', '--youtube-skip-dash-manifest']
[debug] Command-line args: ['--verbose', 'http://gameone.de/tv/220']
[debug] Encodings: locale UTF-8, fs utf-8, out UTF-8, pref UTF-8
[debug] youtube-dl version 2016.04.13
[debug] Python version 3.5.1+ - Linux-4.5.0-gnu.nonpae-i686-with-debian-stretch-sid
[debug] exe versions: ffmpeg 3.0.1, ffprobe 3.0.1, rtmpdump 2.4
[debug] Proxy map: {}
[GameOne] 220: Downloading webpage
ERROR: Unable to extract video url; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/youtube_dl/YoutubeDL.py", line 671, in extract_info
ie_result = ie.extract(url)
File "/usr/local/lib/python3.5/dist-packages/youtube_dl/extractor/common.py", line 341, in extract
return self._real_extract(url)
File "/usr/local/lib/python3.5/dist-packages/youtube_dl/extractor/gameone.py", line 63, in _real_extract
og_video = self._og_search_video_url(webpage, secure=False)
File "/usr/local/lib/python3.5/dist-packages/youtube_dl/extractor/common.py", line 744, in _og_search_video_url
return self._html_search_regex(regexes, html, name, **kargs)
File "/usr/local/lib/python3.5/dist-packages/youtube_dl/extractor/common.py", line 653, in _html_search_regex
res = self._search_regex(pattern, string, name, default, fatal, flags, group)
File "/usr/local/lib/python3.5/dist-packages/youtube_dl/extractor/common.py", line 644, in _search_regex
raise RegexNotFoundError('Unable to extract %s' % _name)
youtube_dl.utils.RegexNotFoundError: Unable to extract video url; please report this issue on https://yt-dl.org/bug . Make sure you are using the latest version; see https://yt-dl.org/update on how to update. Be sure to call youtube-dl with the --verbose flag and include its complete output.
```
| geo-restricted | low | Critical |
148,138,176 | go | syscall: use Docker container for making auto-generated files | The auto-generation of the `syscall/z*.go` files is a mess.
Their generation depends on the headers installed on the host system, so nobody can reliably generate them without making a bunch of accidental unrelated changes.
This applies equally to pkg `syscall` and to `golang.org/x/sys/unix`.
Let's use a Dockerfile in there and then run mkwhatever.{sh,pl,go} file in Docker, and then `docker cp` the auto-generated files out of the container back to the host.
Recent chaos:
- https://go-review.googlesource.com/#/c/21971/
- https://go-review.googlesource.com/#/c/21582/
- etc (basically any change)
It's less clear what to do about other Unix, like OpenBSD (https://go-review.googlesource.com/#/c/21797/, etc). @mdempsky? Jails? But openbsd is tricky for other reasons: #15227
Windows seems to be fine.
/cc @ianlancetaylor
| compiler/runtime | medium | Critical |
148,150,565 | go | cmd/compile: sync/atomic.SwapPointer arguments escape for the wrong reason | In the implementation of sync/atomic.SwapPointer (which is in runtime/atomic_pointer.go), there's nothing that causes the "new" argument to escape, even though it needs to (because you could be swapping it in to a global). The compiler agrees:
```
$ go build -gcflags "-m -m" -a runtime |& grep sync_atomic_SwapPointer
runtime/atomic_pointer.go:58: sync_atomic_SwapPointer ptr does not escape
runtime/atomic_pointer.go:58: sync_atomic_SwapPointer new does not escape
```
However, you can't actually tickle this. For example, in principle the following program should sneak the address of stack variable y into a global variable:
```
package main
import (
"sync/atomic"
"unsafe"
)
var x unsafe.Pointer
func main() {
var y int
z := unsafe.Pointer(&y)
atomic.SwapPointer(&x, z)
}
```
But it doesn't!
```
$ go build -gcflags "-m -m" x.go
# command-line-arguments
./aesc.go:13: &x escapes to heap
./aesc.go:13: from &x (passed to function[unknown]) at ./aesc.go:13
./aesc.go:11: moved to heap: y
./aesc.go:12: &y escapes to heap
./aesc.go:12: from z (assigned) at ./aesc.go:12
./aesc.go:12: from z (passed to function[unknown]) at ./aesc.go:12
```
This happens to work right now, but for the wrong reason: because SwapPointer is defined in the runtime and we use a "go:linkname" comment to expose it from sync/atomic, there's no escape information at all when the test program calls SwapPointer (hence the "passed to function[unknown]"), so the compiler conservatively assumes everything escapes. (In fact, the first argument doesn't have to escape and we have annotations in the runtime to that effect, but they never make it through.)
This all seems very fragile.
/cc @dr2chase @randall77
| NeedsFix,compiler/runtime | low | Minor |
148,170,068 | flutter | RenderObject.debugCheckingIntrinsics mode should catch exceptions and explain what's going on | It's easy to get into situations where you throw during the RenderObject.debugCheckingIntrinsics mode.
It's hard to understand why your code is getting called in that mode.
We should catch all exceptions and include detailed information about what's going on and how to handle it.
| team,framework,P3,team-framework,triaged-framework | low | Critical |
148,189,978 | go | x/build: Windows Nano Server builders? | Per #15286, I guess we'll need Windows Nano Server builders at some point.
How? GCE? Azure?
Can Microsoft run them for us? Or give us Azure credit?
/cc @jstarks
| help wanted,OS-Windows,Builders,new-builder | low | Major |
148,215,119 | flutter | Implicit animations don't handle being animated very well | e.g. consider an `AnimatedDefaultTextStyle` being configured using a `TextStyle` derived from the current `Theme`. If the `Theme` itself is being animated from an `AnimatedTheme`, then the `AnimatedDefaultTextStyle` doesn't make any progress until the `AnimatedTheme` has finished.
| framework,a: animation,d: examples,has reproducible steps,P3,team-framework,triaged-framework,found in release: 3.19,found in release: 3.20 | low | Major |
148,218,761 | go | runtime: heavy time.Now usage cause taskgated to consume lots of cpu | Please answer these questions before submitting your issue. Thanks!
1. What version of Go are you using (`go version`)?
go version devel +bd72497 Mon Apr 11 01:52:10 2016 +0000 darwin/amd64
1. What operating system and processor architecture are you using (`go env`)?
darwin/amd64
1. What did you do?
Run this program
```
package main
import (
"fmt"
"time"
)
func main() {
t1 := time.Now().Add(-1 * time.Second) // ensure there is no collision on first iteration
for {
t2 := time.Now()
d := t2.Sub(t1)
if d == 0 {
fmt.Println("collision at", t2)
}
t1 = t2
}
}
```
1. What did you expect to see?
This program should cause 100% cpu usage.
1. What did you see instead?
The program causes 100% cpu usage, but `taskgated` is also heavily used , around 20% on my system.
https://developer.apple.com/library/mac/documentation/Darwin/Reference/ManPages/man8/taskgated.8.html
Reports that taskgated is responsible for implemting the mach `task_for_pid` syscall (?), so it looks like we're calling this syscall many times, we should probably not do that and cache the task port once per process.
| Performance,OS-Darwin,NeedsInvestigation,compiler/runtime | low | Minor |
148,237,865 | flutter | When running 'flutter' from a directory that appears to be a flutter repo but isn't the one that 'flutter' is itself from, display a warning message | We've had reports of people cloning Flutter twice (presumably months apart), and the second time, since flutter is already on their path, they get all kinds of confused because things like "flutter upgrade" upgrade the "wrong" repo.
| c: new feature,tool,P3,team-tool,triaged-tool | low | Minor |
148,330,786 | youtube-dl | Add a "--force-https" option. | Idea came from Noscript addon for Firefox.
So, when you have `http://www.youtube.com/watch?v=qn6CMz18lkQ` link, and you know its supports https and instead of adding "s" to links every time, you could just add site to config option `--force-https=www.youtube.com` and it will always force links from youtube to https for this site and others you add.
| request | low | Major |
148,380,616 | go | cmd/compile: combine extension with register loads and stores on amd64 | Extending a register load or store currently generates suboptimal code with the SSA backend. In some cases, this is a regression from the old backend. For example:
`func load8(i uint8) uint64 { return uint64(i) }`
Generates:
```
"".load8 t=1 size=16 args=0x10 locals=0x0
0x0000 00000 (extend.go:3) TEXT "".load8(SB), $0-16
0x0000 00000 (extend.go:3) FUNCDATA $0, gclocals·23e8278e2b69a3a75fa59b23c49ed6ad(SB)
0x0000 00000 (extend.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
0x0000 00000 (extend.go:3) MOVBLZX "".i+8(FP), AX
0x0005 00005 (extend.go:3) MOVBQZX AL, AX
0x0008 00008 (extend.go:3) MOVQ AX, "".~r1+16(FP)
0x000d 00013 (extend.go:3) RET
```
The old back end generates:
```
"".load8 t=1 size=16 args=0x10 locals=0x0
0x0000 00000 (extend.go:3) TEXT "".load8(SB), $0-16
0x0000 00000 (extend.go:3) FUNCDATA $0, gclocals·23e8278e2b69a3a75fa59b23c49ed6ad(SB)
0x0000 00000 (extend.go:3) FUNCDATA $1, gclocals·33cdeccccebe80329f1fdbee7f5874cb(SB)
0x0000 00000 (extend.go:3) MOVBQZX "".i+8(FP), BX
0x0005 00005 (extend.go:3) MOVQ BX, "".~r1+16(FP)
0x000a 00010 (extend.go:3) RET
```
I tried fixing this in CL 21838, but the fix was partial and probably not in the right place.
It's hard to do this as part of the arch-specific rewrite rules, because (a) you lose the type extension work that the ssa conversion did for you and have to recreate it later and (b) you don't know where all the register loads and stores will be, because regalloc hasn't run.
However, it's hard to do this as part of converting final SSA to instructions (genvalue), since that's really geared to handle one value at a time, in isolation.
Teaching regalloc to combine these MOVs seems arch-specific and would further complicate already complicated machinery. Maybe the thing to do is to add an arch-specific rewrite pass after regalloc ("peep"?), using hand-written rewrite rules. Input requested.
Related, for those extension MOVs that remain, we should test whether CWB and friends are desirable--they are shorter, but are register-restricted and the internet disagrees about whether they are as fast.
Here are some test cases:
``` go
package x
func load8(i uint8) uint64 { return uint64(i) }
func load32(i uint32) uint64 { return uint64(i) }
func store8(i uint64) uint64 { return uint64(uint8(i)) }
func store32(i uint64) uint64 { return uint64(uint32(i)) }
var p *int
func load8spill(i uint8) uint64 {
i++ // use i
print(i) // spill i
j := uint64(i) // use and extend i
return j
}
func load32spill(i uint32) uint64 {
i++ // use i
print(i) // spill i
j := uint64(i) // use and extend i
return j
}
func store8spill(i uint64) uint64 {
j := uint8(i) // convert
print(j) // spill
return uint64(j) // use
}
func store32spill(i uint64) uint64 {
j := uint32(i) // convert
print(j) // spill
return uint64(j) // use
}
```
cc @randall77
| Performance,compiler/runtime | low | Minor |
148,383,100 | go | misc/trace: switch back to lean config | https://go-review.googlesource.com/#/c/22013 updates trace-viewer to newer revision (required to unbreak visualization in chrome). But trace-viewer (catapult) is broken itself at the moment:
https://github.com/catapult-project/catapult/issues/2247
So the change uses full config instead of lean config. Full config works, but leads to larger html.
We need to switch back to lean config when the bug is fixed.
| NeedsFix | low | Critical |
148,421,943 | TypeScript | reference search doesn't work with `extends` | 
``` typescript
function asOf<b>() {
return function as<a extends b>(value: a) :a {
return value;
};
}
interface I { boom(): void; }
const value = asOf<I>()({ boom: undefined });
value.boom // <-- find me! // expected to be found in I, actual nope
```
| Bug | low | Minor |
148,461,227 | go | cmd/compile: move Type.Width and Type.Align into Extra fields | This is a placeholder issue for work I plan to do, probably not for Go 1.7 at this point. If anyone else wants to work on it, though, they are welcome to.
Only two gc.Types have potentially expensive to calculate width and alignments: structs and (maybe) arrays. We should move Type.Width and Type.Align into StructType and ArrayType, thus shrinking gc.Type for the vast majority of uses.
However, Width is currently overloaded to track some typechecking state. Plan is to change Deferwidth from a bool to a bitflag and start explicitly representing that state--has a width calculation been done? Is the width calculation deferred?
Also, most callsites refer to Width and Align directly. We'll need to switch them to use the Size method and a new Align method, remove unnecessary direct calls to dowidth, and teach the Size and Align methods the constant width and alignment for non-struct, non-array types.
| ToolSpeed,compiler/runtime | low | Major |
148,471,153 | rust | Do move forwarding on MIR | It'd be cool to rewrite chains of the form "a moves to b, b moves to c" to "a moves to c".
| I-slow,C-enhancement,T-lang,T-compiler,A-MIR,WG-embedded,A-mir-opt,A-mir-opt-nrvo,C-optimization | medium | Critical |
148,690,490 | opencv | cleaning up the internal TLS object when the core DLL is programmatically unloaded | ### Please state the information for your system
- OpenCV version: 3.1.0
- Host OS: Windows 7 x86_64
- Compiler: MSVS/VC 2012
- Options: MS memory allocation debugging used; delay load of DLLs for allowing to programatically unload them in a deterministic fashion before e.g. the main routine exits
### In which part of the OpenCV library you got the issue?
- core DLL
### Expected behaviour
all ressources should be cleaned when DLL is unloaded
### Actual behaviour
some still not released chunks of memory do pop up. (i have some idea of a solution attached but i assume several people here, the OpenCV developers, do have a deeper understanding and might pop up with an even better solution.)
### Additional description
the compiler setup was explicitely choosen like this for hardening memory consumption of the application and the used library set at the same time by successively eliminating memory leaks in all areas.
### Code example to reproduce the issue / Steps to reproduce the issue
this patch is an idea (a not yet tested proposal) on how to do a proper cleanup when the DLL is finally detached from the process it lived in.
[system-tls-delete-on-unload.zip](https://github.com/Itseez/opencv/files/221230/system-tls-delete-on-unload.zip)
add this (semicolon separated listing) for the MSVC project properties in debug build variant for ConfigurationProperties->C/C++->Preprocessor->PreprocessorDefinitions
- _CRTDBG_MAP_ALLOC
set this for the MSVC project properties in debug build variant for ConfigurationProperties->Linker->Input->DelayLoadedDlls
- opencv_core310d.dll
set this for the MSVC project properties in debug build variant for ConfigurationProperties->Linker->Advanced->UnloadDelayLoadedDLL
- Yes (/DELAY:UNLOAD)
```
// use this header
#ifdef _DEBUG
#include <stdlib.h>
#include <crtdbg.h>
#endif
// initially do this
_CrtMemState MemState;
_CrtMemCheckpoint (&MemState);
// first use something from the OpenCV core dll that triggers TLS item creation
// then call this function
__FUnloadDelayLoadedDLL2_i("opencv_core310d.dll");
// and finally check for any still allocated memory (=any memory leaks)
_CrtMemDumpAllObjectsSince (&MemState);
```
| feature,priority: low,category: core | low | Critical |
148,771,064 | rust | inconsistent stepping in gdb | While experimenting with gdb I found I couldn't really predict what statements I might step to. Consider this test program:
```
fn main () {
let a = ();
let b : [i32; 0] = [];
let mut c = 27;
let d = c = 99;
let e = "hi bob";
let f = b"hi bob";
let g = b'9';
let h = ["whatever"; 8];
let i = [1,2,3,4];
let j = (23, "hi");
let k = 2..3;
let l = &i[k];
let m: *const() = &a;
}
```
If I `break step::main` and `run` in gdb, stepping stops on many of these lines, but not all of them:
```
Breakpoint 1, step::main () at step.rs:4
4 let mut c = 27;
(gdb) n
5 let d = c = 99;
(gdb)
7 let f = b"hi bob";
(gdb)
8 let g = b'9';
(gdb)
12 let k = 2..3;
(gdb)
13 let l = &i[k];
(gdb)
14 let m: *const() = &a;
(gdb)
15 }
```
| A-debuginfo,E-needs-test,T-compiler,C-bug | low | Major |
148,778,292 | rust | gdb needs to know what traits a type implements | I'd like to make operator overloading work for Rust in gdb. That is, I'd like something like `print x+y` to call the appropriate method on the `Add` trait. I'd also like to make ordinary method calls work, where the method is defined in some trait that is impl'd for the concrete type of the object.
Right now I think this can't be done. There is no information in the debug info about what traits are implemented by a type.
Consider:
```
pub trait What {
fn what(&self);
}
impl What for i32 {
fn what(&self) {
println!("{}", self);
}
}
fn main() {
let v = 23;
let x = &v as &What;
x.what();
()
}
```
Here `i32` is described as just a base type:
```
<1><5e7>: Abbrev Number: 16 (DW_TAG_base_type)
<5e8> DW_AT_name : (indirect string, offset: 0x46a): i32
<5ec> DW_AT_encoding : 5 (signed)
<5ed> DW_AT_byte_size : 4
```
I think this might be a good spot to list all the impl'd traits. Perhaps they can be represented as DWARF interfaces; or maybe some Rust extension to DWARF would be preferable.
`i32.What` is emitted as a namespace:
```
<2><2f>: Abbrev Number: 2 (DW_TAG_namespace)
<30> DW_AT_name : (indirect string, offset: 0x48): i32.What
```
... but this isn't directly useful as it would require an iteration over all the namespace DIEs looking for matches. Maybe I could do this; but I'd rather not as it is very inefficient.
| A-debuginfo,A-trait-system,P-low,T-compiler,C-feature-request | medium | Critical |
148,856,316 | vscode | Add support for mixed tab/spaces indentation | Traditional Unix editors (emacs, vim etc) use a mix of tabs and spaces for indentation. The tab length is always assumed to be 8 and if the indentation size is different, indentation is created by inserting as much tabs as possible and inserting spaces for the remainder. Right now, in order to view such files correctly one needs to set the tab size to 8, convert the file to use only spaces and then set the indentation size to the correct value. However, when working on legacy code it is desired to keep the indentation method the same to avoid unnecessary commits. Therefore VSCode should support this method of indentation, auto detect it and allow to easily convert from and to it.
- VSCode Version: 1.0.0
- OS Version: OS X 10.11.4
Steps to Reproduce:
1. Load a file with mixed indentation
2. VSCode won't display the file correctly
| feature-request,editor-core,editor-rendering | high | Critical |
148,892,492 | vscode | Improved column selection (Alt+select) | The column selection implemented in #1515 is a start, but it's a bit awkward and unintuitive compared to other editors.
With the following editors or IDEs, you can create a column selection starting from where the mouse is clicked/dragged:
- Atom (with Sublime Style Column Selection)
- Eclipse
- Notepad++
- Programmer's Notepad
- Sublime
- Visual Studio 2015
At least Eclipse, Programmer's Notepad, and VS2015 support virtual whitespace as well, creating a complete square/rectangle.
Some of them also don't show multiple cursors, which I think looks better.
Other users were also expecting this behaviour (see [here](https://github.com/Microsoft/vscode/issues/1515#issuecomment-199464559) and [here](https://github.com/Microsoft/vscode/issues/1515#issuecomment-205910037)).
| feature-request,editor-columnselect | high | Critical |
148,911,550 | TypeScript | Runtime parameter info (name, optional, default) | <!--
Thank you for contributing to TypeScript! Please review this checklist
before submitting your issue.
[ ] Many common issues and suggestions are addressed in the FAQ
https://github.com/Microsoft/TypeScript/wiki/FAQ
[ ] Search for duplicates before logging new issues
https://github.com/Microsoft/TypeScript/issues?utf8=%E2%9C%93&q=is%3Aissue
[ ] Questions are best asked and answered at Stack Overflow
http://stackoverflow.com/questions/tagged/typescript
For bug reports, please include the information below.
__________________________________________________________ -->
**TypeScript Version:**
1.8.9
**Code**
I'm trying to leverage decorators to create runtime contracts to check against incoming parameters.
Below is the ts code
``` ts
class Foo {
@contract
test (a : integer, b : string) : boolean {
return true
}
@contract
testOptional (a : integer, b? : string) : boolean {
return true
}
@contract
testDefault (a : integer, b : string = 'hello') : boolean {
return true
}
}
```
The above generated the following Javascript.
``` js
var Foo = (function () {
function Foo() {
}
Foo.prototype.test = function (a, b) {
return true;
};
Foo.prototype.testOptional = function (a, b) {
return true;
};
Foo.prototype.testDefault = function (a, b) {
if (b === void 0) { b = 'hello'; }
return true;
};
__decorate([
contract,
__metadata('design:type', Function),
__metadata('design:paramtypes', [integer, String]),
__metadata('design:returntype', Boolean)
], Foo.prototype, "test", null);
__decorate([
contract,
__metadata('design:type', Function),
__metadata('design:paramtypes', [integer, String]), // same as above
__metadata('design:returntype', Boolean)
], Foo.prototype, "testOptional", null);
__decorate([
contract,
__metadata('design:type', Function),
__metadata('design:paramtypes', [integer, String]), // same as above
__metadata('design:returntype', Boolean)
], Foo.prototype, "testDefault", null);
return Foo;
}());
```
Note that the three different ts functions generated the exact sets of `__metadata` calls. The `design:paramtypes` alone cannot distinguish whether a particular parameter is optional or has default values, and thus insufficient for building a runtime contract.
It would be great for TypeScript to support a full parameter info so decorators can be made more capable.
| Suggestion,Revisit,Domain: Decorators | low | Critical |
148,951,010 | youtube-dl | Post processing fails after renaming in progress hook on status=finished | ### What is the purpose of your _issue_?
- [x] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [ ] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other
### If the purpose of this _issue_ is a _bug report_, _site support request_ or you are not completely sure provide the full verbose output as follows:
```
WARNING:tldextract:unable to cache TLDs in file /usr/local/lib/python2.7/dist-packages/tldextract/.tld_set: [Errno 13] Permission denied: '/usr/local/lib/python2.7/dist-packages/tldextract/.tld_set'
[debug] Encodings: locale UTF-8, fs UTF-8, out utf-8, pref UTF-8
[debug] youtube-dl version 2016.04.13
[debug] Python version 2.7.9 - Linux-3.16.0-4-amd64-x86_64-with-debian-8.4
[debug] exe versions: avconv 2.6.8, avprobe 2.6.8, ffmpeg 2.6.8, ffprobe 2.6.8, rtmpdump 2.4
[debug] Proxy map: {}
[debug] Public IP address: 109.201.154.177
Finished downloading /home/user/pub/video/www/youtube/Dexbonus/20160414 - ♡ TY! ♡ - March 2016.mp4
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20160414 - TY - March 2016.mp4
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20160414 - TY - March 2016.annotations.xml
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20160414 - TY - March 2016.description
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20160414 - TY - March 2016.info.json
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20160414 - TY - March 2016.jpg
Finished downloading /home/user/pub/video/www/youtube/Dexbonus/20130330 - LONDON DAY 2 - Westminster, Buckingham Palace, and Friendship.mp4
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20130330 - LONDON DAY 2 - Westminster Buckingham Palace and Friendship.mp4
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20130330 - LONDON DAY 2 - Westminster Buckingham Palace and Friendship.annotations.xml
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20130330 - LONDON DAY 2 - Westminster Buckingham Palace and Friendship.description
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20130330 - LONDON DAY 2 - Westminster Buckingham Palace and Friendship.info.json
Renaming to: /home/user/pub/video/www/youtube/Dexbonus/20130330 - LONDON DAY 2 - Westminster Buckingham Palace and Friendship.jpg
Traceback (most recent call last):
File "/home/user/dev/youtube-dl-automate/youtube-dl-automate/youtube-dl-automate.py", line 158, in <module>
main()
File "/home/user/dev/youtube-dl-automate/youtube-dl-automate/youtube-dl-automate.py", line 152, in main
ydl.download([line])
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1730, in download
url, force_generic_extractor=self.params.get('force_generic_extractor', False))
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 682, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 734, in process_ie_result
extra_info=extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 682, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 842, in process_ie_result
extra_info=extra)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 734, in process_ie_result
extra_info=extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 682, in extract_info
return self.process_ie_result(ie_result, download, extra_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 727, in process_ie_result
return self.process_video_result(ie_result, download=download)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1376, in process_video_result
self.process_info(new_info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1712, in process_info
self.post_process(filename, info_dict)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/YoutubeDL.py", line 1776, in post_process
files_to_delete, info = pp.run(info)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 470, in run
self.run_ffmpeg(filename, temp_filename, options)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 172, in run_ffmpeg
self.run_ffmpeg_multiple_files([path], out_path, opts)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 146, in run_ffmpeg_multiple_files
os.stat(encodeFilename(path)).st_mtime for path in input_paths)
File "/usr/local/lib/python2.7/dist-packages/youtube_dl/postprocessor/ffmpeg.py", line 146, in <genexpr>
os.stat(encodeFilename(path)).st_mtime for path in input_paths)
OSError: [Errno 2] No such file or directory: '/home/user/pub/video/www/youtube/Dexbonus/20130330 - LONDON DAY 2 - Westminster, Buckingham Palace, and Friendship.mp4'
...
<end of log>
```
### Description of your _issue_, suggested solution and other information
When renaming a file at status=finished using a progress hook youtube-dl tries to post process the file using the old filename. Would it be possible to delay status=finished until post processing is also finished? Or to provide another status for the progress hook (status=postprocessed)?
### Other information
#### Relevant program code
```
def rename_files(path):
#TODO: os.rename() doesn't automatically overwrite on Windows
if not os.path.isfile(path):
print('Could not find file: ' + filename)
sys.exit()
# Extensions for extra files (which should also be renamed)
extensions = [ '.annotations.xml', '.description', '.info.json', '.jpg' ]
# We only want to change the filename
filename = os.path.basename(path)
# Don't need the extension until later
newfilename = os.path.splitext(filename)[0]
# Replace all '_\/' characters with spaces
newfilename = re.sub('[_\/]+',' ',newfilename)
# Remove all characters not in 'A-Za-z0-9 -'
newfilename = re.sub('[^A-Za-z0-9 -]+','',newfilename)
# Filename should not contain multiple spaces in a row
newfilename = " ".join(newfilename.split())
# Filename should not contain spaces at the beginning or end
newfilename = newfilename.strip()
# Filename should not contain trailing dashes
newfilename = newfilename.rstrip('-')
# Filename should not contain trailing spaces after removing trailing dashes
newfilename = newfilename.rstrip()
# Put back the extension
newfilename = newfilename + os.path.splitext(filename)[1]
# Append new filename to path
newfilepath = os.path.dirname(path) + os.path.sep + newfilename
os.rename(path, newfilepath)
print('Renaming to: ' + newfilepath)
# Rename extra files
for extension in extensions:
filename = os.path.splitext(path)[0] + extension
newfilename = os.path.splitext(newfilepath)[0] + extension
if os.path.isfile(filename):
os.rename(filename, newfilename)
print('Renaming to: ' + newfilename)
else:
print('Missing file: ' + filename)
sys.exit()
def my_hook(d):
if d['status'] == 'downloading':
pass
if d['status'] == 'finished':
print('Finished downloading ' + d['filename'])
rename_files(d['filename'])
if d['status'] == 'error':
print('Error during downloading ' + d['filename'])
sys.exit()
def main():
....
# See YoutubeDL.py for options
ydl_opts = {
'sleep_interval': 10,
#'playlistreverse': 'true',
'format': 'best',
'age_limit': 30,
'writedescription': 'true',
'writeinfojson': 'true',
'writeannotations': 'true',
'writethumbnail': 'true',
'download_archive': outputdir + os.path.sep + sitename +
os.path.sep + archivefile,
'outtmpl': outputdir + os.path.sep + sitename + os.path.sep +
'%(uploader)s' + os.path.sep +
'%(upload_date)s - %(title)s.%(ext)s',
'logger': MyLogger(),
'progress_hooks': [my_hook],
'prefer_ffmpeg': 'true',
'call_home': 'true',
'verbose': 'true',
#'simulate': 'true',
}
with youtube_dl.YoutubeDL(ydl_opts) as ydl:
ydl.download([line])
...
```
| request | low | Critical |
148,957,032 | youtube-dl | Request for supporting youku&tudou account logining | ## Please follow the guide below
- You will be asked some questions and requested to provide some information, please read them **carefully** and answer honestly
- Put an `x` into all the boxes [ ] relevant to your _issue_ (like that [x])
- Use _Preview_ tab to see how your issue will actually look like
---
### Make sure you are using the _latest_ version: run `youtube-dl --version` and ensure your version is _2016.04.13_. If it's not read [this FAQ entry](https://github.com/rg3/youtube-dl/blob/master/README.md#how-do-i-update-youtube-dl) and update. Issues with outdated version will be rejected.
- [x] I've **verified** and **I assure** that I'm running youtube-dl **2016.04.13**
### Before submitting an _issue_ make sure you have:
- [ ] At least skimmed through [README](https://github.com/rg3/youtube-dl/blob/master/README.md) and **most notably** [FAQ](https://github.com/rg3/youtube-dl#faq) and [BUGS](https://github.com/rg3/youtube-dl#bugs) sections
- [x] [Searched](https://github.com/rg3/youtube-dl/search?type=Issues) the bugtracker for similar issues including closed ones
### What is the purpose of your _issue_?
- [ ] Bug report (encountered problems with youtube-dl)
- [ ] Site support request (request for adding support for a new site)
- [x] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other
---
### The following sections concretize particular purposed issues, you can erase any section (the contents between triple ---) not applicable to your _issue_
---
### Description of your _issue_, suggested solution and other information
Now youtube-dl can download youku&tudou video, and it can download videos that only open for VIP accounts with browser cookies.
However, I find the browser cookies for youku&tudou will expire in only a few hours. So I must export the cookies every time before I download the VIP-only videos. This is too annoying.
Then, I find youtube-dl supports logining with account ID in the Authentication Options as:
-u, --username USERNAME Login with this account ID
-p, --password PASSWORD Account password. If this option is left
out, youtube-dl will ask interactively.
But youtube-dl does not support youku&tudou account logining now.
Thus, I request for this functionality.
The VIP youku&tudou accounts can be obtained in these websites:
http://www.vipfenxiang.com/youku/
http://yk.aiqiyivip.com/
http://www.mdouvip.com/youku
| request,account-needed | low | Critical |
Subsets and Splits
No saved queries yet
Save your SQL queries to embed, download, and access them later. Queries will appear here once saved.