sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: cmd/compile: order.go is outdated
Labels: Performance,ToolSpeed,compiler/runtime

Many optimizations made in walk.go did not come with corresponding updates to order.go. For example, order.go makes a temporary for runtime calls for OCONVIFACE for many cases which walk special-cases not to make runtime calls. Another example is the introduction of temporaries for equality checks that walk inlines.

These do not impact correctness, but they might impact performance (if SSA cannot eliminate the pointless temporaries) and toolspeed (by generating useless nodes that then must be optimized away).

This issue is a reminder to investigate this, and decide whether it is worth the effort to modernize order.go.

cc @mdempsky
Repository: neovim
Issue: Restore cursor position when triggering undo
Labels: enhancement,normal-mode

Something that has always bothered me about vim is that when you undo you often do not get your previous cursor position back.  For example, given the following file (with the ^ character representing where the cursor is)

```
this is a test
   ^
```

If you hit `diwu`, you get this:

```
this is a test
^
```

Whereas what I would expect is for the cursor to be back at the original position.  In many cases it does follow this behaviour but in many cases it does not.  For example, typing `itest<esc>u` preserves the cursor position but typing `atest<esc>u` does not.  Typing `Du` preserves position but typing `d^u` does not.  Maybe there is some logic behind this behaviour that I'm not seeing but to me it seems odd.

Is this a change worth considering?  Or maybe this something better suited as a plugin?
Repository: kubernetes
Issue: Consider network resource management / guarantees / scheduling
Labels: sig/network,kind/feature,triage/accepted

**What keywords did you search in Kubernetes issues before filing this one?** : Network quota, congestion
 
---

**Is this a BUG REPORT or FEATURE REQUEST?** (choose one): FEATURE REQUEST

<!--
If this is a BUG REPORT, please:
  - Fill in as much of the template below as you can.  If you leave out
    information, we can't help you as well.

If this is a FEATURE REQUEST, please:
  - Describe *in detail* the feature/behavior/change you'd like to see.

In both cases, be ready for followup questions, and please respond in a timely
manner.  If we can't reproduce a bug or think a feature already exists, we
might close your issue.  If we're wrong, PLEASE feel free to reopen it and
explain why.
-->

There should be  a way to schedule pods based on network resource availability - could be on the similar lines as cpu and memory request/limits.

At the very least, kubelet or node-problem-detector should report network congestion or bottlenecks.

One specific use-case is when pods have low cpu/mem requirements, but high network bandwidth needs.

@Random-Liu @thockin thoughts?
Repository: javascript
Issue: External callback function
Labels: question

_The following examples are based (but no dependent) on [Express router](https://expressjs.com/en/guide/routing.html)._

**Considering the following correct case:**

[8.1 When you must use function expressions (as when passing an anonymous function), use arrow function notation. ](https://github.com/airbnb/javascript#arrows--use-them)

```
router.get('/url', (req, res) => {
  ...
});
```

**Should you?**

Write the callback function as an arrow function as well, if called from an external place?

```
// controllers.js
export const getUrlController = (req, res) => {
  ...
});
```

```
// routes.js
import { getUrlController } from './controllers'

router.get('/url', urlController);
```

Or should it rather be a function in this case?

```
// controllers.js
export const getUrlController = function getUrl(req, res) {
  ...
};
```
Repository: javascript
Issue: Export-ing conventions
Labels: question

Airbnb style guides [[10]](https://github.com/airbnb/javascript#modules--use-them) do not define any specific `export` style, other than:

[10.6 In modules with a single export, prefer default export over named export.](https://github.com/airbnb/javascript#modules--prefer-default-export)

Which one is the preferred style in the following cases (feel free to suggest better ones):

**Single export**

- Inline export
```
export default foo = () => { ... }
```
- Separate export (after definition)
```
const foo = () => { ... };
export default foo;
const other = () => { ... };
```
- Separate export (at the end of file)
```
const foo = () => { ... };
const boo = () => { ... };
export default foo;
```

**Multiple exports**

- Inline exports
```
export foo = () => { ... }
export boo = () => { ... }
```
- Separate export (after definition)
```
const foo = () => { ... }
export foo;
const boo = () => { ... }
export boo;
```
- Separate export (at the end of file)
```
const foo = () => { ... }
const boo = () => { ... }
export { foo, boo };
```
- Wrapper export
```
export const wrapper = {
  foo: () => { ... }
  boo: () => { ... }
}
```
Repository: angular
Issue: There is no FormControl instance attached to form control element with name: xxx
Labels: type: bug/fix,freq2: medium,area: forms,state: confirmed,P3

<!--
IF YOU DON'T FILL OUT THE FOLLOWING INFORMATION WE MIGHT CLOSE YOUR ISSUE WITHOUT INVESTIGATING
-->

**I'm submitting a ...**  (check one with "x")
```
[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question
```

**Current behavior**
<!-- Describe how the bug manifests. -->
When using ReactiveForms and we override old form group with the new one (using for example `this.form = new FormGroup(...)`) an error occurs (the error is mentioned in the title).
(The error can be seen in console).

**Expected behavior**
<!-- Describe what the behavior would be without the bug. -->
No error happens.

**Minimal reproduction of the problem with instructions**
<!--
If the current behavior is a bug or you can illustrate your feature request better with an example, 
please provide the *STEPS TO REPRODUCE* and if possible a *MINIMAL DEMO* of the problem via
https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).
-->
http://plnkr.co/jVMbtQGKeYhPsCkrzQN8
The error can be seen after 3 seconds (I used set timeout in the example). Error should be visible in console.

**What is the motivation / use case for changing the behavior?**
<!-- Describe the motivation or the concrete use case -->
I understand that this is not the best way to use form groups, i should check if they are already created, and create it only if necessary. However, this bug indicates (I concluded this from stacktrace) that control set-up doesn't work after it's been cleaned up. This should not be the case. Problem occurs because Angular's cleanUpControl function sets up change callback to its own handler (the handler just throws error), and then in setUpControl function, Angular calls write value BEFORE it registers callback handler. It means that the last handler remembered by the custom control was cleanUpControl's handler which only throws an error. Functions setUpControl and cleanUpControl can be found in `@angular/forms/src/directives/shared.js`

**Please tell us about your environment:**
<!-- Operating system, IDE, package manager, HTTP server, ... -->
Project is set-up using angular-cli, but it doesn't really affect the problem if I change the setup.

* **Angular version:** 2.0.X
<!-- Check whether this is still an issue in the most recent Angular version -->
2.4.4

* **Browser:** [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
<!-- All browsers where this could be reproduced -->

I tested this on Chrome and Firefox, they both reproduce the problem
 
* **Language:** [all | TypeScript X.X | ES6/7 | ES5]

Typescript

* **Node (for AoT issues):** `node --version` =
Repository: TypeScript
Issue: Type annotations for default export
Labels: Suggestion,Awaiting More Feedback

**TypeScript Version:**  2.1.1 

**Code**

```ts
import * as webpack from 'webpack';
export default: webpack.Configuration {
};
```

**Expected behavior:**
No error

**Actual behavior:**

`[ts] Expression expected.` error at `default:`

I couldn't find an issue for this but it's very likely it's a duplicate 

<hr>
Please 👍 on this issue if you want to see this feature in TypeScript and avoid adding "me too" comments. Thank you!
Repository: neovim
Issue: CursorMovedI and TextChangedI triggered unexpectedly for completion without changes
Labels: bug-vim,completion,events

### Steps to reproduce using `nvim -u NORC`

```
nvim -u NORC
:source foo.vim
```

Hit the Enter key, you will see that popup menu disapear, nothing has changed, except a CursorMovedI message at the bottom.

foo.vim

```vim
set noshowmode
set completeopt=menu,menuone,noinsert,noselect
set shortmess+=c

augroup foo
        autocmd!
        autocmd CursorMovedI * echom 'moved: ' . reltimestr(reltime())
augroup end

call feedkeys("Goab\<c-r>=g:Foo()\<CR>")

func! g:Foo()
        call complete(1,['abc'])
        return ''
endfunc
```

If you replace the autocmd with this. The changed message will be fired too.

```vim
        autocmd TextChangedI * echom 'changed: ' . b:changedtick
```

- `nvim --version`:

```
NVIM v0.1.7-437-g0542baa
Build type: Release
Compilation: /usr/bin/cc -Wconversion -O2 -DNDEBUG -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/data/roxma/.local_software/tmp/neovim/build/config -I/data/roxma/.local_software/tmp/neovim/src -I/data/roxma/.local_software/tmp/neovim/.deps/usr/include -I/data/roxma/.local_software/tmp/neovim/.deps/usr/include -I/data/roxma/.local_software/tmp/neovim/.deps/usr/include -I/data/roxma/.local_software/tmp/neovim/.deps/usr/include -I/data/roxma/.local_software/tmp/neovim/.deps/usr/include -I/data/roxma/.local_software/tmp/neovim/.deps/usr/include -I/usr/include -I/data/roxma/.local_software/tmp/neovim/build/src/nvim/auto -I/data/roxma/.local_software/tmp/neovim/build/include
Compiled by roxma@VM_67_229_centos

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: "/data/roxma/.local_software/neovim/share/nvim"
```

- Operating system/version:

```
uname -a
Linux VM_67_229_centos 3.10.0-327.10.1.el7.x86_64 #1 SMP Tue Feb 16 17:03:50 UTC 2016 x86_64 x86_64 x86_64 GNU/Linux
```

- Terminal name/version:
- `$TERM`: xterm-256color
Repository: TypeScript
Issue: [BUG] Docs say es6 modules can't export class objects, but that's not true.
Labels: Help Wanted,Docs

The docs [say](https://www.typescriptlang.org/docs/handbook/declaration-files/templates/module-class-d-ts.html) that

> ```
> /*~ Note that ES6 modules cannot directly export class objects.
> ```

but modules can export classes, as in

```ts
export default
class Foo { /*...*/ }
```
Repository: javascript
Issue: Documentation/docblocks
Labels: pull request wanted,editorial

I am wondering why there is no section of documentation or docblocks. Is it conventional to leave them out? What is the reason I don't see any docblocks in the open-sourced projects you guys have?

I would love to hear thoughts about using docblocks in Javascript. I find them really helpful when I am programming PHP. Especially if your IDE has support for it and can help you out with the documentation.
Repository: go
Issue: x/time/rate: Limiter depends on implementation-defined float to int conversion
Labels: NeedsInvestigation

### What version of Go are you using (`go version`)?

```
Audrius@Audrius foo $ go version
go version go1.8rc2 windows/amd64
```

### What operating system and processor architecture are you using (`go env`)?

```
Audrius@Audrius foo $ go env
set GOARCH=amd64
set GOBIN=
set GOEXE=.exe
set GOHOSTARCH=amd64
set GOHOSTOS=windows
set GOOS=windows
set GOPATH=C:\Gohome
set GORACE=
set GOROOT=C:\Go
set GOTOOLDIR=C:\Go\pkg\tool\windows_amd64
set GCCGO=gccgo
set CC=gcc
set GOGCCFLAGS=-m64 -mthreads -fmessage-length=0 -fdebug-prefix-map=C:\cygwin64\tmp\go-build503767043=/tmp/go-build -gno-record-gcc-switches
set CXX=g++
set CGO_ENABLED=1
set PKG_CONFIG=pkg-config
set CGO_CFLAGS=-g -O2
set CGO_CPPFLAGS=
set CGO_CXXFLAGS=-g -O2
set CGO_FFLAGS=-g -O2
set CGO_LDFLAGS=-g -O2
```

### What did you do?

Compile two binaries using the following:

```
package main

import (
        "golang.org/x/time/rate"
        "fmt"
)

func main() {
        r := rate.NewLimiter(0, 100)
        if r.Allow() {
                fmt.Println("broken")
        } else {
                fmt.Println("ok")
        }
}
```

Compile as:
```
Audrius@Audrius foo $ GOOS=linux GOARCH=arm GOARM=5 go build main.go; mv main main-arm
Audrius@Audrius foo $ GOOS=linux GOARCH=arm64 GOARM=5 go build main.go; mv main main-arm64
```

Run them on arm64 device (Pixel XL):

```
marlin:/data/data/com.nutomic.syncthingandroid.debug $ ./main-arm
broken
marlin:/data/data/com.nutomic.syncthingandroid.debug $ ./main-arm64
ok
```

Run the same code on amd64 device:
```
Audrius@Audrius foo $ go run main.go
broken
```

### What did you expect to see?

The behaviour between the binaries on should be the same.
I suspect it's related to how floats are handled between the arches.

### What did you see instead?

Binaries return different results based on how they were compiled.
Repository: rust
Issue: [rustdoc] Placeholder for search field makes no sense
Labels: T-rustdoc,C-enhancement

Currently `rustdoc` generated documentation has this for the placeholder of search field:

> Click or press 'S' to search, '?' for more options…

Now, the problem here, to summarize, is that this placeholder is not really a placeholder, but rather a call-to-action, half of which is even a feature unrelated to search. Not only this call-to-action won’t be visible with text alraedy entered, it does not really help with identifying the purpose of the field.

I realised this when got to a windows machine for some screen reader tests (for https://github.com/rust-lang/rust/pull/39246) and had the placeholder read out to me. Screen reader, when focused on the field read out:

> Click or press S to search, ? for more options editable field

and I realised that this placeholder doesn’t make sense even when I’m able to see the page, much less when I don’t.

![Quick prototype with `Search terms` for placeholder](https://cloud.githubusercontent.com/assets/679122/22225998/4081782e-e1cd-11e6-80ed-a8f2c992da5b.png)

I quickly prototyped a potential change and filled this issue so anybody with better ideas could chime in.
Repository: thefuck
Issue: Strange behaviour in Windows (Git Bash)
Labels: windows

I've installed Python (to get pip) and then ran pip install thefuck.
It seems to have installed `the fuck` okay, but it's acting strangely in Git Bash.
In GitBash, it displays the menu, but doesn't accept `Enter`. It just executes whatever I enter when I press Ctrl-C (but not the unfucked command) - see this example:
![gitbash example](https://cloud.githubusercontent.com/assets/9005382/22250061/7cfcf33a-e23d-11e6-9876-28491485fe05.gif)

Any ideas what the problem may be, and how to fix it?
Repository: opencv
Issue: Corrupted OpenGL stencil after ogl::Texture2D::copyFrom and copyTo
Labels: bug,category: core,incomplete

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015

##### Detailed description

We use cv::ogl::Texture2D::copyFrom() to convert an OpenGL texture (depth + stencil) to an ogl::Texture2D, then convert back using cv::ogl::Texture2D::copyTo(). The stencil in the resulting OpenGL texture gets corrupted. The corruption really seems to be in these functions, since we don't do anything on the cv::ogl::texture2D between the two conversions. 

##### Steps to reproduce
Repository: opencv
Issue: Imgproc.Sobel() called with dx=1, dy=0 wrongly gives exactly same results as dx=0, dy=1 if the OpenCV Manager app is used (Android)
Labels: wontfix

<!--
If you have a question rather than reporting a bug please go to http://answers.opencv.org where you get much faster responses.
If you need further assistance please read [How To Contribute](https://github.com/opencv/opencv/wiki/How_to_contribute).

This is a template helping you to create an issue which can be processed as quickly as possible. This is the bug reporting section for the OpenCV library.
-->

##### System information (version)
<!-- Example
- OpenCV => 3.1
- Operating System / Platform => Windows 64 Bit
- Compiler => Visual Studio 2015
-->

- OpenCV => 3.2
- Operating System / Platform => Android 6.0.1
- Compiler => Android Studio 2.2.2

##### Detailed description

There is a bug in the Imgproc.Sobel() implementation in OpenCV Manager for Android.
If called with parameters: dx = 1, dy = 0, the function wrongly returns the same result as if it was called with dx = 0, dy = 1.

##### Steps to reproduce

<!-- to add code example fence it with triple backticks and optional file extension
    ```.cpp
    // C++ code example
    ```
 or attach as .txt or .zip file
-->

Compiling this code, and NOT linking the OpenCV library statically, and using the OpenCV Manager App on Android, will result in these two lines giving exactly same results.

```.java
Mat gradX = new Mat();
Mat gradY = new Mat();
Mat gray = new Mat();
Mat gradient = new Mat()

Imgproc.cvtColor( cameraSnapshotFrame, gray, COLOR_BGR2GRAY );

Imgproc.Sobel( gray, gradX, CV_32F, 1, 0, -1, 1.0, 0 );
Imgproc.Sobel( gray, gradY, CV_32F, 0, 1, -1, 1.0, 0 ); // for some reason this gives the same result as the line above

Core.subtract( gradX, gradY, gradient );
Core.convertScaleAbs( gradient, gradient ); // gradient is an empty black image
```

If the usage of OpenCV Manager is dropped, and the library is linked statically within the project, then the issue disappears (the calls produce differing gradients).
Repository: TypeScript
Issue: Error in find-all-references for 3 spread types
Labels: Bug

**TypeScript Version:**  nightly (2.2.0-dev.20170124)

**Code**

(based on `tests/cases/fourslash/findAlRefsObjectSpread.ts`)

```ts
interface A1 { a: string };
interface A2 { a?: number };
interface A3 { a?: RegExp };
declare let a1: A1;
declare let a2: A2;
declare let a3: A3;
let a12 = { ...a1, ...a2, ...a3 };
a12.a;
```

**Expected behavior:**

Find-all-refs for `a` in `a123.a` matches the `a` in all of `A1`, `A2`, `A3`.

**Actual behavior:**

It only matches the `a` in `A3`. If one of the spread elements in the definition of `a123` is removed, then it will correctly highlight both remaining spread elements.

CC @sandersn
Repository: TypeScript
Issue: Diagnostic about "left-hand side of a 'for...in' statement" type is out of date
Labels: Suggestion,Experience Enhancement

**TypeScript Version:**  2.1.5

Now that the left side of a 'for...in' statement is apparently allowed to be `keyof` the right side, the diagnostic for when the left side has the wrong type needs to be updated to account for that possibility.

(Aside: Is it intentional that the left side won't be _inferred_ to have the `keyof` type because of the unsoundness described in #12314, but it is allowed to be _explicitly declared_ as that type?)

**Code**

```ts
interface Foo {
  x: number;
  y: string;
}

function scan(f: Foo) {
  let k: number;
  for (k in f) {  // Error: "The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."
    console.log(k);
  }
  let k2: keyof Foo;
  for (k2 in f) {  // No error
    console.log(k2);
  }
}
```

**Expected behavior:**
Something like "The index type of the right side of a 'for...in' statement must be assignable to the left side" perhaps, with details on the failure of assignability?

**Actual behavior:**
"The left-hand side of a 'for...in' statement must be of type 'string' or 'any'."
Repository: angular
Issue: RouterModule does not initialize correctly when using UpgradeModule
Labels: type: bug/fix,area: core,workaround2: non-obvious,area: upgrade,state: confirmed,P3

**I'm submitting a ...** 
```
[x] bug report
[ ] feature request
[ ] support request 
```

**Current behavior**
`initialRouterNavigation` (from [upgrade.ts](https://github.com/angular/angular/blob/master/modules/%40angular/router/upgrade.ts)) is not called during bootstrap. As a consequence, RouterModule does not navigate to the initial URL, and does not subscribe to location changes caused by `ngRoute`, causing it to not deactivate a route when navigating to a route managed by `ngRoute`.

**Expected behavior**
`initialRouterNavigation` is invoked, the RouterModule navigates to the initial URL, subscribes to location changes caused by `ngRoute` and deactivates the current route when `ngRoute` changes location.

**Minimal reproduction of the problem with instructions**

I have been trying to follow the approach documented at [@angular/router/upgrade.ts](https://github.com/angular/angular/blob/master/modules/%40angular/router/upgrade.ts):

main.ts:
```
platformBrowserDynamic().bootstrapModule(AppModule).then(platformRef => {
  (<any>window).angular.module("angularschulung").directive('appRoot', downgradeComponent({component: AppComponent}));
  const upgrade = platformRef.injector.get(UpgradeModule) as UpgradeModule;
  upgrade.bootstrap(document.body, ['angularschulung'], {strictDi: true});
});
```

app.module.ts:
```
const routes : Routes = [
  {path: "ng2/issue/new", component: ReportIssueComponent},
  {path: "**", component: EmptyComponent}  // for routes managed by ngRoute
]

@NgModule({
  declarations: [
    AppComponent,
    EmptyComponent,
    NgViewComponent,  // upgraded ng-view for use by AppComponent
    ReportIssueComponent,
  ],
  entryComponents: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    RouterModule.forRoot(routes),
    UpgradeModule
  ],
  providers: [
    RouterUpgradeInitializer
  ],
})
export class AppModule {
  // suppress automatic bootstrapping
  ngDoBootstrap() { }
}
```


**Please tell us about your environment:**

```
                             _                           _  _
  __ _  _ __    __ _  _   _ | |  __ _  _ __         ___ | |(_)
 / _` || '_ \  / _` || | | || | / _` || '__|_____  / __|| || |
| (_| || | | || (_| || |_| || || (_| || |  |_____|| (__ | || |
 \__,_||_| |_| \__, | \__,_||_| \__,_||_|          \___||_||_|
               |___/
angular-cli: 1.0.0-beta.25.5
node: 7.4.0
os: win32 x64
@angular/common: 2.4.3
@angular/compiler: 2.4.3
@angular/core: 2.4.3
@angular/forms: 2.4.3
@angular/http: 2.4.3
@angular/platform-browser: 2.4.3
@angular/platform-browser-dynamic: 2.4.3
@angular/router: 3.4.3
@angular/upgrade: 2.4.3
@angular/compiler-cli: 2.4.3
```

* **Browser:** all (verified in Firefox and Chrome. Bootstrapping issues are probably not browser related)

* **Language:** TypeScript