sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: react-native
Issue: Memory leak when programmatically changing 'source' prop of Image
Labels: Good first issue,Platform: iOS,Component: Image,Bug

### Description

If you use an Image component in render and use the parent component's state to manage the source prop, each time the source is changed the previous source is not deallocated. Even when the parent component is unmounted, the previous images still use memory.

<img width="800" alt="imagetest_memory_leak" src="https://cloud.githubusercontent.com/assets/4549380/22629970/dd31d43c-ebe8-11e6-8637-3f563a6fafd3.png">

### Reproduction

I've made a simple [ImageTest project](https://github.com/tomchambers2/ImageTest) that demonstrates the bug. **(IMPORTANT: run app in release mode to experience the issue)**

Code:
```
/**
 * Sample React Native App
 * https://github.com/facebook/react-native
 * @flow
 */

import React, { Component } from 'react';
import {
  AppRegistry,
  StyleSheet,
  Text,
  View,
  Image,
  TouchableHighlight,
  Dimensions,
} from 'react-native';

import image0 from './images/0.png'
import image1 from './images/1.png'
import image2 from './images/2.png'
import image3 from './images/3.png'
import image4 from './images/4.png'

const images = [
  image0,
  image1,
  image2,
  image3,
  image4,
]

export default class ImageTest extends Component {
  constructor() {
    super()

    this.state = ({
      counter: 0,
    })
  }

  increment = () => {
    this.setState({
      counter: this.state.counter + 1
    })
  }

  render() {
    const imageSource = images[this.state.counter]

    return (
      <View>
        <Image
          source={imageSource}
          style={styles.image}
        />
        <TouchableHighlight onPress={this.increment} style={styles.highlight}>
          <Text style={styles.text}>NEXT IMAGE</Text>
        </TouchableHighlight>
      </View>
    );
  }
}

const window = Dimensions.get('window')

const styles = StyleSheet.create({
  highlight: {
    backgroundColor: 'yellow',
    position: 'absolute',
    bottom: 0,
    left: 0,
  },
  text: {
    fontSize: 50,
  },
  image: {
    width: window.width,
    height: window.height,
  },
});

AppRegistry.registerComponent('ImageTest', () => ImageTest);
```

### Solution

Presumably when the source is changed the underlying UIImage/UIImageView needs to be destroyed.

### Additional Information

* React Native version: 0.41.0
* Platform: iOS
* Operating System: MacOS 10.12.3 / xcode 8.2
Repository: vscode
Issue: Suggestion - Add a line-spacing or line-margin option
Labels: feature-request,editor-core

i create a new post because i didn't see anything that exactly correspond to my demand in already existing tickets.

What i suggest is to add a line-spacing flag in the editor category, that should add a space, who is 0px by default BETWEEN lines.

It is different from lineHeight flag because line height also modify the size of the carret, line hightlight, etc...

it seems to be very capricious suggestion, and i don't know if it is possible in the actual software architecture, but i let it here, in case of. I used to use this in sublime text before, and it greatly helped me to read the code easier.

An alternative could be to change carret and line-highlight to always scales to the font size instead of line-height size.

Due to my frenshyness, please, excuse me for my approximative english.
I hope this is understandable. Do not hesitate to question me otherwise.

thanks
Guema
Repository: youtube-dl
Issue: Export fragments list with ism and f4m protocols
Labels: request

- [x] I've **verified** and **I assure** that I'm running youtube-dl **2017.02.04.1**
- [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)
- [x] Feature request (request for a new functionality)
- [ ] Question
- [ ] Other

---

Like it's possible now with mpd/dash manifests right now, would it be possible to export ism/f4m fragments list with JSON output? FFmpeg/mpv doesn't demuxing the manifests directly.
Repository: opencv
Issue: Video file playback fail to open with Microsoft Media Foundation (CV_CAP_MSMF) 
Labels: bug,priority: low,category: videoio,category: documentation

- OpenCV => 3.0
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2013

##### Detailed description

VideoCapture Video "file" playback using Media Foundation (CV_CAP_MSMF) is failed to open given various video format I had tested, mostly in mp4, wmv, and avi format.

I used `VideoCapture cap(fileName, CV_CAP_MSMF);`
By rebuilding from source of OpenCV 3.0, 3.1, 3.2 (-with_msmf), I always get `cap.isOpened()` to return false.

When digging into the cap_msmf.cpp source, in line 3864, my multiple video(s) can not match this particular MFVideoFormat_RGB24. It makes me wonder if there is a limitation of OpenCV's media foundation implementation. If there is, it should be stated in the document, like what particular video format it can support, or does it only work with video device (instead of file)

In cap_msmf.cpp of line 3864
```
MediaType MT = FormatReader::Read(pType.Get());
// We can capture only RGB video.
if( MT.MF_MT_SUBTYPE == MFVideoFormat_RGB24 )

```
I had spent couple days on confirming this bug, and hope to get some confirmation. Thanks a lot!


##### Steps to reproduce

1. First build opencv from source with_msmf, and remove ffmpeg dependency
2. Try out this code:
```
VideoCapture cap(fileName, CV_CAP_MSMF);
if(cap.isOpened()){ 
     //Will always return, no matter what file 
     return;
}
```
3. It will return without success in opening this file
Repository: react
Issue: Clear button on iOS date input does not return correct event value
Labels: Type: Bug,Component: DOM

**Bug**
For iOS only.
When pressing `clear` on a date input, the `onChange` event is fired but` event.target.value` is showing the original value rather than an empty string.

**What is the current behavior?**
On Chrome and Android, when the clear button is pressed the onChange event has a value of `''`.
On iOS when the clear button is pressed the onChange event has a value of `previousValue`.

**Demo**
https://output.jsbin.com/zojuteloto/5/
Try on Chrome/Android. Then on iOS.

**What is the expected behavior?**
Value should be returned an an empty string.

**Versions**
Affects React 15+ & iOS 10. Unsure of previous versions.
Repository: vscode
Issue: Code snippet control indentation
Labels: feature-request,snippets

<!-- Do you have a question? Please ask it on http://stackoverflow.com/questions/tagged/vscode -->

How can I  control unindentation in code snippets?

```json
{
    "Create migration helper execute statement": {
        "prefix": "mhe",
        "body": [
            "\\$helper->execute(<<<SQL",
            "\t$0",
            "\rSQL",
            ");"
        ]
    }
}
```

When invoking it in indented context:

```php
class Migration {
→   public function up(Helper $helper) {
→   →   mhe<tab complete snippet>
→   }
}
```

Expected behavior:

```php
class Migration {
→   public function up(Helper $helper) {
→   →   $helper->execute(<<<SQL
→   →   →   |<cursor>
SQL
→   →   );
→   }
}
```

Actual behavior:

```php
class Migration {
→   public function up(Helper $helper) {
→   →   $helper->execute(<<<SQL
→   →   →   |<cursor>
→   →   
→   →   SQL
→   →   );
→   }
}
```

This is invalid behavior when using heredoc.

I tried to insert `\r` <carriage return> to try removing all indentation,
but it is just translated to a newline and indented according to snippet context.

- VSCode Version: 1.9.0
- OS Version: macOS Sierra
Repository: TypeScript
Issue: Suggestion: DeepReadonly<T> type
Labels: Suggestion,Needs More Info

**TypeScript Version:**  2.1.1 / nightly (2.2.0-dev.201xxxxx)

**Code**

It would be nice to have a shard, standard library type that allows to express deep readonly-ness (not really const, since methods are out of scope, but still...):

```ts
interface Y { a: number; }
interface X { y: Y; }
let x: Readonly<X> = {y: {a: 1}};
x.y.a = 2;  // Succeeds, which is expected, but it'd be nice to have a common way to express deep readonly

type DeepReadonly<T> = {
  readonly [P in keyof T]: DeepReadonly<T[P]>;
}
let deepX: DeepReadonly<X> = {y: {a: 1}};
deepX.y.a = 2; // Fails as expected!
```
Repository: go
Issue: cmd/compile: Fannkuch11 on AMD64 slow down 6% after removing assembler backend instruction reordering
Labels: Performance,compiler/runtime

CL https://go-review.googlesource.com/c/36205/ deletes assembler backend instruction reordering. This makes Fannkuch-11 on AMD64 slow down 6%. Figure out why and improve the compiler.
Repository: neovim
Issue: UI: externalize 'cursorline'/'cursorcolumn'
Labels: performance,api,ui,ui-extensibility

```
$ nvim --version
NVIM 0.2.0-dev
Build type: RelWithDebInfo
Compilation: /usr/bin/x86_64-linux-gnu-gcc -g -O2 -fstack-protector-strong -Wformat -Werror=format-security -Wconversion -U_FORTIFY_SOURCE -D_FORTIFY_SOURCE=1 -O2 -g -DDISABLE_LOG -Wall -Wextra -pedantic -Wno-unused-parameter -Wstrict-prototypes -std=gnu99 -Wvla -fstack-protector-strong -fdiagnostics-color=auto -DINCLUDE_GENERATED_DECLARATIONS -DHAVE_CONFIG_H -D_GNU_SOURCE -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/build/config -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/src -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/.deps/usr/include -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/.deps/usr/include -I/usr/include -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/build/src/nvim/auto -I/build/neovim-TT51tV/neovim-0.1.7ubuntu1+git201702021745+3100+23~ubuntu16.04.1/build/include
Compiled by root@lgw01-18

Optional features included (+) or not (-): +acl   +iconv    +jemalloc +tui      
For differences from Vim, see :help vim-differences

   system vimrc file: "$VIM/sysinit.vim"
  fall-back for $VIM: "/usr/share/nvim"
```

- Vim (version: ) behaves differently?

vim 8 is just as slow. maybe even - if possible - slower.

- Operating system/version:

Ubuntu 16.04 LTS 64-bit.

- Terminal name/version:

gnome-terminal running `tmux 2.1-3build1` or plain xterm without tmux. same results.

- `$TERM`:

```
xterm-256color
```

### Steps to reproduce using `nvim -u NORC`

```
wget https://gist.githubusercontent.com/hholst80/2531dad506f45812ef036c762d55e5b3/raw/75fe1d4dd19349863d96e3ff147032bba903c8cc/test.yml
nvim -u NORC test.yml
```
Repository: angular
Issue: patchValue of Select with value not in options keeps the form valid
Labels: type: bug/fix,area: forms,forms: validators,forms: Controls API,P4

**I'm submitting a ...**  (check one with "x")
```
[x] bug report => search github for a similar issue or PR before submitting
```

**Current behavior**
Using patchValue to set a value to a Select box (a value that *doesn't* exist in the Select options), sets the model to that value (and makes the field valid).
(The select box *doesn't* show the "invalid" value, which is OK, since its not one of the options).

**Expected behavior**
For Select boxes, using patchValue or setValue may/can/should/need not set the value (or set an empty one) if the value doesn't exist in the options.

**Minimal reproduction of the problem with instructions**
1. Have a reactive form with a select box, with `Validators.required`.
2. The select box has several options ("a", "b", and "c")
3. Using `patchValue`, set the value of the select to "d".

Plunkr: http://plnkr.co/mo9aCu?p=preview


--> I do understand that creating a `FormGroup` has nothing to do with the HTML template, and that a `FormControl` isn't related to either `input type="text"` or `select` for example. I'm not sure if this should be a bug or a feature request.


**What is the motivation / use case for changing the behavior?**
I let the user import previously saved form data, and need to patch the current form with the user's supplied data. If possible values have changed over time in a Select box, and user has old data, the field (and the form) will remain valid after import, but no data will be displayed in the Select.

**Please tell us about your environment:**
Plunkr, CentOS 6.8

* **Angular version:**
4.0.0-beta.6

* **Browser:**
Chrome 56
 
Thanks.
Repository: TypeScript
Issue: Ignore __proto__
Labels: Suggestion,Awaiting More Feedback

**TypeScript Version:** 2.2.0

**Code:**
```ts
{ __proto__: {} } as { [key: string]: string }
```

**Expected behavior:**
Ok

**Actual behavior:**
`Type '{ __proto__: {}; }' cannot be converted to type '{ [key: string]: string; }'.`
Repository: go
Issue: proposal: how to specify mechanical code updates after API changes?
Labels: Proposal,Proposal-Hold

Go should adopt conventions for packages to explain to potential clients how to update their code in response to API changes in a mechanical way. That is, a package developer should have  a way to write down the significant changes of API and compiler and/or tools can *apply* or *fix* them.

See also #18130 and https://github.com/golang/go/issues/18130#issuecomment-278136380
Repository: TypeScript
Issue: Accept Input Source Maps
Labels: Suggestion,In Discussion

The typescript compiler produces sources maps mapping from the javascript it produces to the typescript sources it compiled.  This is great, but doesn't go far enough if there are tools which generate the sources that are consumed by the typescript compiler.

For example, [Tsickle](https://github.com/angular/tsickle) preprocesses typescript sources before passing them to the typescript compiler.  As things stand we've had to implement a hack to get our source maps to work.  We use a compiler host which performs the tsickle transforms as the typescript compiler reads files, saves the resulting source maps and then compose them with the source maps produced by the typescript compiler as they're emitted.

Instead the typescript compiler could accept source maps as input alongside sources, and compose the input source maps with the source maps produced by the compiler.

The ideal api would be that the typescript compiler would look for either a. an inline source map as a comment in the source file or b. a file in the same directory with the name {source file name}.ts.map, which shouldn't require any crazy file resolution.
Repository: TypeScript
Issue: Computed property key names should not be widened
Labels: Bug

**TypeScript Version:**  2.1.5

**Code**
The latest `@types/react` (`v15.0.6`) use `Pick<S,K>` to correctly type the `setState` method of `React.Component`s. While this makes it now possible to merge the `state` of a component instead of replacing it, it also makes it harder to write a dynamic update function that uses computed properties.

```ts
import * as React from 'react';

interface Person {
  name: string;
  age: number|undefined;
}

export default class PersonComponent extends React.Component<void, Person> {
  constructor(props:any) {
    super(props);

    this.state = { 
      name: '',
      age: undefined
    };
    this.handleUpdate = this.handleUpdate.bind(this);
  }

  handleUpdate (e:React.SyntheticEvent<HTMLInputElement>) {
    const key = e.currentTarget.name as keyof Person;
    const value = e.currentTarget.value;
    this.setState({ [key]: value }); // <-- Error
  }

  render() {
    return (
      <form>
        <input type="text" name="name" value={this.state.name} onChange={this.handleUpdate} />
        <input type="text" name="age" value={this.state.age} onChange={this.handleUpdate} />
      </form>
    );
  }
}
```

The above should show an actual use case of the issue, but it can be reduced to:

```ts
const key = 'name';
const value = 'Bob';
const o:Pick<Person, 'name'|'age'> = { [key]: value };
``` 

which will result in the same error. [Link to the TS playground](http://www.typescriptlang.org/play/index.html#src=interface%20Person%20%7B%0D%0A%20%20name%3A%20string%3B%0D%0A%20%20age%3A%20number%7Cundefined%3B%0D%0A%7D%0D%0A%0D%0Aconst%20key%20%3D%20'name'%3B%0D%0Aconst%20value%20%3D%20'Bob'%3B%0D%0Aconst%20o%3APick%3CPerson%2C%20'name'%7C'age'%3E%20%3D%20%7B%20%5Bkey%5D%3A%20value%20%7D%3B)

**Expected behavior:**
No error, because `key` is a `keyof Person`, which will result in the literal type `"name" | "age"`. Both values that are valid keys for`state`.

**Actual behavior:**
The compiler will throw the following error:

```
[ts] Argument of type '{ [x: string]: string; }' is not assignable 
     to parameter of type 'Pick<Person, "name" | "age">'.
       Property 'name' is missing in type '{ [x: string]: string; }'.
```

My uninformed guess is that the constant `key` is (incorrectly) widened to `string`.
Repository: rust
Issue: Document unwind-safety without referencing an RFC
Labels: C-enhancement,P-medium,T-lang,A-docs

https://doc.rust-lang.org/std/panic/trait.UnwindSafe.html currently says:

> for more information about unwind safety and how it applies to Rust, see an [associated RFC](https://github.com/rust-lang/rfcs/blob/master/text/1236-stabilize-catch-panic.md).

While this RFC is very informative, much of it is dedicated to Rust as it was before the RFC was implemented, possible alternatives, and trade-offs. This can be a distraction for someone not involved in programming language design and who just wants to learn how to safely use FFI in today’s Rust. (Which is admittedly intrinsically hard.)

Perhaps the Nomicon would be an appropriate alternative?

https://doc.rust-lang.org/nomicon/unwinding.html
https://doc.rust-lang.org/nomicon/exception-safety.html
https://doc.rust-lang.org/nomicon/poisoning.html
Repository: kubernetes
Issue: Stricter checking/validation of statefulset pvcs
Labels: kind/bug,area/stateful-apps,sig/apps,lifecycle/frozen

Currently theren's no enforcement around statefulset volume templates, which means the burden is on the user to make sure there's no collision. A user can create:

Petset 1: petset  Claim: alpha-beta
Petset 2: beta-petset Claim: alpha

and end up with a collision. The controller should be smarter, maybe we need something like parent-ref? 
@kubernetes/sig-apps-bugs @jingxu97
Repository: opencv
Issue: cv::VideoCapture leaks memory on ethernet cams
Labels: incomplete

##### System information (version)

- OpenCV => 3.2
- Operating System / Platform => Linux 64 Bit
- Compiler => GCC

##### Detailed description
I have been noticing my software memory usage grows (slowly) over time.

I used to believe it was some kind of buffer. But after I let it running overnight, and it crashed because it was out of memory, I had to debug.

My software uses 8 VideoCapture instances in RTSP Ethernet Cameras, each one in it's thread, at around 5FPS.

I found out if disable grab() and replace retrieve() for a still image, memory usage doesn't grow. A still image runs my algorithm normally.

After I re-enabled grab(), but not retrieve, the process memory grown 80MB in 1h23m.
After I re-enabled grab and retrieve, the process memory grown 120MB in 16min.

##### Steps to reproduce
I could reproduce the problem with the following code. More cameras make the memory usage grows faster.

	cv::VideoCapture fb;

	fb[0].open("rtsp://admin:admin@CAM_IP:554/ucast/11");

	cv::Mat test;

	while(true){
		fb.grab();
		fb.retrieve(test);
		std::cout << "size: " << test.size() << std::endl;
	}

It gave some warnings while running.:
[Output.txt](https://github.com/opencv/opencv/files/761908/Output.txt)
(I believe this is the source of the growing memory.)

##### More Info
- I sometimes get an error : " [rtsp @ 0xXXXXXXXXXXXX] Too short data for FU-A H.264 RTP packet"
- I have to do 5 grabs for 1 retrieve, so my image don't get delays.
- grab() and retrieve() happen in different threads.


##### Build details
[OpenCV_Build.txt](https://github.com/opencv/opencv/files/761794/OpenCV_Build.txt)
Repository: go
Issue: net/http/httptrace: add ServerTrace hooks
Labels: FeatureRequest,early-in-cycle

## Problem

A very common pattern in Go HTTP servers is to implement an `http.ResponseWriter` that wraps another `http.ResponseWriter` and captures the status code.  This is often used for logging and metrics collection.

For example,

```
type statusCaptureWriter struct {
    http.ResponseWriter
    status int
}

func (scw *statusCaptureWriter) WriteHeader(status int) {
    scw.status = status
    scw.ResponseWriter.WriteHeader(status)
}

type loggedHandler struct {
    handler http.Handler
    logger SomeLogger
}

func (h *loggedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    scw := &statusCaptureWriter{ResponseWriter: w}
    h.handler.ServeHTTP(scw, r)
    h.logger.Logf("status=%d ...", scw.status)
}
```

I've written something like this a bunch of times.  You can find examples in nearly every Go web framework out there.  One example is https://github.com/urfave/negroni/blob/master/response_writer.go#L13-L26.

There are some issues with this approach.  For instance, my `statusCaptureWriter` doesn't implement other interfaces like `http.Flusher`, `http.CloseNotifier` or `http.Pusher`.  I can't determine at compile time whether the underlying `http.ResponseWriter` implementation implements any of these interfaces, so if I choose to implement them I might lie to callers at higher levels of the stack and inadvertently break things.  (This particularly a problem with CloseNotifier.)

## Proposal (rejected, see below)

I'd like to propose an additional interface, `http.Statuser` (better name welcome) that exposes the status code within a `http.ResponseWriter` implementation.  The internal `http.(*response)` implementation already tracks the status code written, so this can just be exposed and it will automatically implement this interface.

Software could avoid wrapping the `http.ResponseWriter` by instead type asserting it to `http.Statuser` and getting the status as needed there.  (And it could optionally continue to wrap the ResponseWriter as needed until this is widely deployed.)

```
type loggedHandler struct {
    handler http.Handler
    logger SomeLogger
}

func (h *loggedHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
    // Could check for http.Statuser implementation here and wrap http.ResponseWriter 
    // if necessary, but omitting for brevity

    h.handler.ServeHTTP(w, r)

    status := 0
    if s, ok := w.(http.Statuser); ok {
        status = s.Status()
    }

    h.logger.Logf("status=%d ...", status)
}
```

## Alternative proposal

Implement an `httptrace.ServerTrace` struct that is analogous to the `ClientTrace` already there.  See https://github.com/golang/go/issues/18997#issuecomment-279611928 for more info.