sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: opencv
Issue: Why not use the default in FileNode::operator >> ?
Labels: category: core,RFC

<!--
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)
- OpenCV => 3.2

##### Detailed description

The `cv::read(const FileNode& node, value, default )` [here](https://github.com/opencv/opencv/blob/3.2.0/modules/core/include/opencv2/core/persistence.hpp#L713) uses a default value but not the related `FileNode::operator >>` 

It would be useful to keep same behaviour on the operator side and quite easy to implement.
For example the operator defined [here](https://github.com/opencv/opencv/blob/3.2.0/modules/core/include/opencv2/core/persistence.hpp#L1166) might become:
```.cpp
template<typename _Tp> static inline
void operator >> (const FileNode& n, _Tp& value)
{
    //OLD read( n, value, _Tp());
    read( n, value, value);   // NEW
}
```
I can agree that `_Tp()` object constructor should create the object in its default state but what with simple type like int and others ?

Using suggested change should help to use application based defaults both for objects and simple types.

Same for the [FileNodeIterator version](https://github.com/opencv/opencv/blob/3.2.0/modules/core/include/opencv2/core/persistence.hpp#L1142) and [std::string version](https://github.com/opencv/opencv/blob/3.2.0/modules/core/include/opencv2/core/cvstd.inl.hpp#L152) 

In addiciton, about the std::string version it would be also useful to add a cv::read version for it [here](https://github.com/opencv/opencv/blob/3.2.0/modules/core/include/opencv2/core/persistence.hpp#L716) because of unsupported cast of `value` by reference 
```.cpp
...
// available
CV_EXPORTS void read(const FileNode& node, String& value, const String& default_value);
// to add
CV_EXPORTS void read(const FileNode& node, std::string& value, const std::string& default_value);
```

##### Steps to reproduce
For example 

```.cpp
class MyClass
{
    Init()
    {
        m_myParam(5); // typical class initialization
    }
    bool ReadConfig()
    {
        Init();
        ...
        // IF node["myParam"] IS NOT DEFINED

        // this is bad because  m_myParam will become 0
        node["myParam"] >> m_myParam;

        // to keep application default value:
        if(!node["myParam"].empty())
                node["myParam"] >> m_myParam;

        // or
        cv::read(node["myParam"], m_myParam, m_myParam);
        ...
    }
}
```
Repository: nvm
Issue: Documenting how to install NVM for all users
Labels: root / multiuser issues

I needed a global install of NVM because I have some node based cron jobs and a few legacy applications that are rather picky about which version of node they are able to work on. For a time I worked around this by sourcing the nvm script everywhere but that seems to be a somewhat unmaintainable solution. 

The requirements I have:
- NVM should just work in non-interactive sessions
- Every user should be able to select a installed version of node (or use ```$ nvm exec```)
- Some users should be able to install newer versions of node

This is the solution I came up with: (shout out to @icecoldphp, for the initial version)

0. I've done this on a debian 8 machine, as the root user
1. Create a group called "nvm", ```# groupadd nvm```
2. Add root to the nvm group ```# usermod -aG nvm root```
3. Goto the ```/opt``` directory and create a directory called nvm  
    - Make sure the groupd owner is nvm ```# chown :nvm ./nvm```
    - Set the permissions so that the group is allowed to write in there and all file will inherit the group ```# chmod g+ws ./nvm```
4. Follow the [git install](https://github.com/creationix/nvm#git-install) steps using ```/opt/nvm``` as the directory 
    - To make sure the group can also write aliases, cache downloads and install global packages make sure the directories exist and have the correct permissions:
    ```
    # mkdir /opt/nvm/.cache
    # mkdir /opt/nvm/versions
    # mkdir /opt/nvm/alias 
    
    # chmod -R g+ws /opt/nvm/.cache
    # chmod -R g+ws /opt/nvm/versions
    # chmod -R g+ws /opt/nvm/alias
    ```
5. Using the following snippet create ```/etc/profile.d/nvm.sh```:
    ```#/etc/profile.d/nvm.sh
    #!/bin/bash

    export NVM_DIR="/opt/nvm"
    [ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

    ```
6. Ensure that the script is executable ```# chmod +x /etc/profile.d/nvm.sh```
7. If you want to use nvm in non-interactive sessions as well make sure to source the nvm file in ```/etc/bash.bashrc``` before the line saying ```# If not running interactively, don't do anything``` by adding ```. /etc/profile.d/nvm.sh```.
8. For bash completion (which is inherently interactive ;) add ```[ -s "$NVM_DIR/bash_completion" ] && \. "$NVM_DIR/bash_completion"``` after the section about bash completion.

Every user can select a version of node (as the permissions for public are ```r-x```) and users in the nvm group can install and remove versions of node (permissions for the group are ```rwx```).

My questions are:
- As a developer I know next to nothing about linux, could this be improved, is it bad style, etc? Any feedback is welcome.
- Should this be documented in the NVM README.md?
Repository: TypeScript
Issue: AllowJs and duplicate identifier
Labels: Suggestion,Awaiting More Feedback,Domain: JavaScript

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

Potential bug, potential feature, depending on how you look at it :)

In a javascript file, using allowJs, shouldn't all valid javascript be valid to the typescript compiler? I found several of the other duplicate identifier issues that have been brought up. I don't see this being exactly the same thing though.

**TypeScript Version:**  2.2.3

**Code**
This is technically valid JS code. I wouldn't ever do it myself, but it happens in large codebases.
```js
var amount = amount();
function amount() {
  return 123;
}
```

It results in a duplicate identifier error on the `amount` symbol.

I can definitely see this being the type of thing that typescript should prevent, but being that it's a .js file I'm kind of on the fence.
Repository: go
Issue: time: time.Local is always UTC on Android
Labels: NeedsInvestigation

initLocal() in zoneinfo_android.go is hard-coded to UTC: https://github.com/golang/go/blob/bc495c5751201854366b422e5a642ac55b42414a/src/time/zoneinfo_android.go#L43-L46

```golang
func initLocal() {
	// TODO(elias.naur): getprop persist.sys.timezone
	localLoc = *UTC
}
```

x/mobile currently uses a hack to set time.Local for gomobile android apps (https://github.com/golang/mobile/commit/730f563fbc4684e73445e98ea49d9f2b5b09a58c), but that predates the availability of tzdata on android (80b31c05e6ae37c09162406590b9e3b99f0fff9b).

cc @eliasnaur @crawshaw #13581 #10857
Repository: angular
Issue: ReactiveForms: FormArray.at could return undefined
Labels: type: bug/fix,help wanted,freq1: low,area: forms,state: confirmed,cross-cutting: types,P4

<!--
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. -->
The `FormArray.at` method signature declares the return value to be `AbstractControl`.

**Expected behavior**
<!-- Describe what the behavior would be without the bug. -->
The `FormArray.at` method signature declares the return value to be `AbstractControl | undefined`.

Since:
`FormArray.at` returns the result of accessing the contained `controls` array.
`undefined` is returned when the supplied index is out-of-range, with respect to the target `FormArray`.

Note: `Typescript` does not point out an issue, even with `strictNullChecks: true`.

**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).
-->

```typescript
    const formBuilder: FormBuilder = new FormBuilder();
    const formArray: FormArray = formBuilder.array([]);

    const outOfRangeItemPositiveAt: AbstractControl = formArray.at(5);
    const outOfRangeItemNegativeAt: AbstractControl = formArray.at(-1);

    console.log(`outOfRangeItemPositiveAt is defined = [${!!outOfRangeItemPositiveAt}]`);
    console.log(`outOfRangeItemNegativeAt is defined = [${!!outOfRangeItemNegativeAt}]`);

    console.log(`outOfRangeItemPositiveAt = [${outOfRangeItemPositiveAt}]`);
    console.log(`outOfRangeItemNegativeAt = [${outOfRangeItemNegativeAt}]`);
```
**What is the motivation / use case for changing the behavior?**
<!-- Describe the motivation or the concrete use case -->
To indicate the possibility of an `undefined` result.

**Please tell us about your environment:**
<!-- Operating system, IDE, package manager, HTTP server, ... -->

* **Angular version:** 4.1.3
<!-- Check whether this is still an issue in the most recent Angular version -->

* **Browser:** [ Chrome ]
<!-- All browsers where this could be reproduced -->
 
* **Language:** [ TypeScript 2.3.2 | ES5 ]

* **Node (for AoT issues):** `node --version` = v6.9.2
Repository: neovim
Issue: glob fails to expand wildcard with wildignorecase and a parent directory without read permission
Labels: bug-vim,completion,filesystem


### Problem
With `wildignorecase` set (without `fileignorecase`) `glob` fails to expand `*` in a path when one of the parent directories does not have read access. Suppose I want to run `glob` on the expression `temp/test/*`, where `temp` does not have the read flag set, but `test` does.
This returns no results with `wildignorecase` set, but `temp/test/test.txt` does, provided the file exists.
Without `wildignorecase` all files in the directory are returned.

### Expected behaviour
The wildcard should expand, since `test` can be read.

### Steps to reproduce using `nvim -u NORC`
Make directories and some file `test.txt`, set permissions, then start neovim (or vim)
```
:echo glob("temp/test/*", 0, 1)
:set wildignorecase
:echo glob("temp/test/*", 0, 1)
:echo glob("temp/test/test.txt", 0, 1)
```
This will return,
```
['temp/test/test.txt']
[]
['temp/test/test.txt']
```

### Vim (version: ) behaves differently?

Vim 8.0 behaves the same way.
Repository: go
Issue: plugin: Add support for closing plugins
Labels: FeatureRequest,compiler/runtime

Adding support for closing plugins would give a simple way to do hot code reloading in long running applications like web servers.

This would add another method to `src/plugin/plugin.go` and a new file `src/plugin/dl_close.go` that would handle closing the dlhandle and destroying the go symbol map.
It would also add the handle as an un-exported unsafe pointer to the go plugin struct.

The main issue is how to signal that a plugin has been closed without breaking API compatibility. Currently the plugin has a channel called `loaded` which is closed when the plugin is loaded. The simplest solution is to add another channel which is closed when the plugin is closed, however this doesn't seem very 'neat' to me.
Repository: TypeScript
Issue: Quick Fix: Suggest correct capitalization when importing a file with incorrect capitalization 
Labels: Suggestion,Domain: Quick Fixes,Experience Enhancement

<!-- BUGS: Please use this template. -->
<!-- QUESTIONS: This is not a general support forum! Ask Qs at http://stackoverflow.com/questions/tagged/typescript -->
<!-- SUGGESTIONS: See https://github.com/Microsoft/TypeScript-wiki/blob/master/Writing-Good-Design-Proposals.md -->

**TypeScript Version:**  2.3

Mac does not enforce file name capitalization. I had an issue where tests was passing on my Mac and I was getting an error like this in Linux:

```
Cannot find module './isKind' from 'index.ts'
```

File was named `iskind` by mistake. 

It should be easy to detect errors like this by reading all files in target directory and look for similar file names.  This can go beyond capitalization and can suggest correct file names with edit distance. 

**Code**

```ts
import {foo} from './myModule'
```
Repository: rust
Issue: Tracking issue for `step_trait` stabilization
Labels: T-libs-api,B-unstable,C-tracking-issue,A-iterators,Libs-Tracked

Split off from https://github.com/rust-lang/rust/issues/27741 because the stabilization path for `step_by` has moved to being on iterators (https://github.com/rust-lang/rust/pull/41439), and thus not using the `Step` trait.

- [ ] Remove `step`, `steps_between`, and `is_negative` once Range::step_by is deleted
- [ ] Replace `replace_zero` and `replace_one` with something more useful (some options: https://github.com/rust-lang/rfcs/pull/1980#issuecomment-301348126)
- [ ] Change `steps_between_by_one` so that `Range<u128>` can be `TrustedLen` (rather than it only working well with types that fit in `usize`)
- [ ] Make a decision on how `steps_between` should work https://github.com/rust-lang/rust/issues/48117

(and probably more)
Repository: TypeScript
Issue: Determine when isDeclaration and isDeclarationName should check for special property assignments
Labels: Infrastructure

**TypeScript Version:**  nightly (2.4.0-dev.20170523)

Currently neither function handles special JS assignments such as `exports.x = ...`. We should review each case where we use these functions and see if special assignments need to be handled.
Repository: TypeScript
Issue: Type narrowing with foo.constructor
Labels: Suggestion,Awaiting More Feedback

**TypeScript Version:**  2.3.1

**Code**

```ts
class FooTask {
  foo: number;
}

class BarTask {
  bar: number;
}

type taskType = FooTask|BarTask;

function createEvent(task: taskType) {
  if (task instanceof FooTask) {
    task.foo; // Works.
  }

  switch (task.constructor) {
    case FooTask:
      task.foo; // Fails.
  }
}
```

It would be nice if the second worked like the first; narrowed the type of `task` appropriately.
Repository: opencv
Issue: OpenCVDetectCUDA.cmake doesn't detect properly CUDA ARCH types
Labels: bug,priority: low,category: build/install,category: gpu/cuda (contrib)

When compiling opencv it takes ages on core i7 8x thread and I think the reason lies in nonfunctional OpenCVDetectCUDA.cmake file, which instead of detect single architecture pulls in all available:
`-gencode arch=compute_20,code=sm_20 -gencode arch=compute_30,code=sm_30 -gencode arch=compute_35,code=sm_35 -gencode arch=compute_37,code=sm_37 -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52 -gencode arch=compute_60,code=sm_60 -gencode arch=compute_61,code=sm_61`


##### System information (version)
- OpenCV => 3.1
- Operating System / Platform => Gentoo AMD64, Nvidia GTX 960M
- Compiler => GNU GCC 7.1.0

- OpenCV => :grey_question: Is it error or am I missing some config parameters to be passed into CMAKE process externally?

In Gentoo system we go with ebuild system and portage for packages to manage. In ebuild file we support following CUDA related configuration for opencv:
```
 # ===================================================
        # CUDA build components: nvidia-cuda-toolkit takes care of GCC version
        # ===================================================
                -DWITH_CUDA=$(usex cuda)
                -DWITH_CUBLAS=$(usex cuda)
                -DWITH_CUFFT=$(usex cuda)
               	-DWITH_NVCUVID=OFF
#               -DWITH_NVCUVID=$(usex cuda)
                -DCUDA_NPP_LIBRARY_ROOT_DIR=$(usex cuda "${EPREFIX}/opt/cuda" "")

```
Coudl I extend it by passing additionally to CMAKE system following parameters (in my case):
CUDA_GENERATION = "Maxwell" 

I tried to pass additionally -DCUDA_GENERATION="Maxwell" to the Gentoo ebuild and viola it works, now I see when copilation runs only this snippet:
` -gencode arch=compute_50,code=sm_50 -gencode arch=compute_52,code=sm_52`
Repository: vscode
Issue: PreLaunchTask: support passing parameters from configuration to preLaunchTask
Labels: feature-request,debug,tasks

Currently when invoking preLaunchTask, the only possible is the task name. It would be great if properties in the associated configuration can be passed to preLaunchTask.

Scenario: 
  I am writing a pre-launch task to automate remote node.js debugging. The pre-launch task will launch the node.js process remotely and establish a SSH tunnel (port forwarding) back to local computer. And then debugger connects to that forwarded port to start debugging. 
  The node.js debugger port is specified in launch.json file, and there is no good way for the pre-launch task to get the debugger port. 

The problem can be solved if preLaunchTask can take parameters from the configuration. For example, tasks.json allow '$config.port' as args:

           {
                "command": "dotnet",
                "taskName": "prepareDebug",
                "suppressTaskName": true,
                "args": [ "/myhelper.dll", "debug", "start", "$config.port" ],
                "isBuildCommand": false,
                "showOutput": "always",
                "options": {
                    "cwd": "${workspaceRoot}"
                }
            }

@isidorn @weinand
Repository: TypeScript
Issue: Private Member Minification Design Proposal
Labels: Suggestion,Needs More Info

**Problem:** For front end data binding frameworks such as Angular, Knockout, React, etc, making the choice to use typescript results in larger minified output files.

**Proposal:** Add a tsconfig option "minifyPrivateMembers" (default false) 

**Details:** 

Since front end binding frameworks can have references to members in html, we cannot easily minify these members using existing tooling. For example, using google closure compiler would require using an externs file for all the public properties I want to keep. That would be awful to hand maintain. It'd be really nice if typescript could just minify anything marked private. Typescript wouldn't even have to minify anything else, uglify can do the rest.

**Edit:** removed incorrect example. 

Minification of private members in the greeter example is 18% better than minification in javascript only. I also expect many classes would have **many** more private members than public members, so savings could be much greater than 18%. Actually with many custom knockout bindingHandlers almost every single member can be made private!

```
this["greeting"]
var x = "gr" + "eeting";
var y = this[x];
```

If typescript notices that a class is using string access with variable strings to its own members it **could** choose to not minify private members for that class. Alternatively if this feature just breaks code like that then I think that's okay as long as it's documented. It will already break external use of private members, and that's why the option defaults to false.

Created from here:
https://github.com/Microsoft/TypeScript/issues/8#issuecomment-303423733
Repository: realworld
Issue: Validation Messages Spec
Labels: issue in core repo,v2

Looking at the API spec I noticed that the clients are expecting validation errors in the form of 
```json
{
  "errors":{
    "body": [
      "can't be empty"
    ]
  }
}
```
However, I didn't see any specs about the validation messages expected. I think this would be helpful knowing what types of validation errors we should be looking out for
Repository: opencv
Issue: OpenCL optimization for Snapdragon830 GPU on android
Labels: feature,category: core,category: ocl



##### System information (version)
- OpenCV => 3.2.0
- Operating System / Platform => android/arm64-v8a
- Compiler => ninja, cmake parameters:
cmake <opencv-dir> -GNinja -DANDROID_ABI:STRING="arm64-v8a" -DANDROID_NDK:PATH=<ndk-bundle-dir> -DWITH_OPENCL:BOOL=ON -DBUILD_SHARED_LIBS:BOOL=OFF -DCMAKE_TOOLCHAIN_FILE:FILEPATH=<opencv-dir>/platforms/android/android.toolchain.cmake -DOPENCV_EXTRA_MODULES_PATH:PATH=<opencv-contrib-dir>/modules

##### Detailed description
OpenCL optimization is not applied to Haar detector on our embedded Snapdragon 830 GPU (but only on Intel or AMD GPUs). We had to modify OpenCV code and rebuild in order to gain Haar detector offloading from CPU to GPU. We suggest a change and ask to examine our suggestion in the OpenCV developer perspective.

##### Steps to reproduce

    cascadedetect.cpp on line 610 checks the condition (*)
    if (ocl::Device::getDefault().isAMD() || ocl::Device::getDefault().isIntel())
and, if satisfied, sets localSize to (8,8). As a result, the function detectMultiScaleNoGrouping is computed on the GPU, because use_ocl is true.

We have changed the condition (*) to 
if ( ! ocl::Device::getDefault().isNVidia() )
and, as a result, openCL optimization has been applied to our device as well (GPU load was observed and cpu load went down, the results were identical). We did not gain speedup, runtimes were similar, but did gain reduction of CPU load.
Repository: pytorch
Issue: [Feature request] In-place 'max' method for Tensor
Labels: todo,feature,triaged

This functionality is useful for multiple cases, e.g. to efficiently implement optimizer's parameters update.
Repository: TypeScript
Issue: Typescript Watch - Cleaning Target Files on Source Deletion
Labels: Bug

Can we[ add a compiler option](https://stackoverflow.com/questions/44159501/typescript-watch-removing-deleted-target-js-files) to also glob-delete a target file when the source file is removed? We run into this constantly and have to gulp clean frequently - it makes the usage of `tsc -watch` pointless as we have to constantly purge the output directory.
Repository: pytorch
Issue: feature request: On-the-fly Operation Batching in Dynamic Computation Graphs
Labels: feature,triaged

[https://arxiv.org/abs/1705.07860](https://arxiv.org/abs/1705.07860)
I would LOVE to see this in PyTorch.
Repository: angular
Issue: Binding to the src of an iframe causes the iframe to flicker
Labels: type: bug/fix,freq1: low,area: security,hotlist: google,state: confirmed,core: change detection,P3

Binding to the `src` property of an iframe causes the iframe to reload every time change detection is run, even when the `src` value has not changed.

Reproduction: https://plnkr.co/edit/CgLHkprl4jYndqEiY7mX?p=preview
(enter `X1RVYt2QKQE` as an example videoId, then type into the unrelated input)

Happens with all Angular versions <= 4.1 (current version at time of this writing)

Note from @tbosch:

> So the problem is that `this.domSanitizer.bypassSecurityTrustResourceUrl` returns a new object every time it is invoked.
> If the result is cached, the flickering is gone, see https://plnkr.co/edit/W0gJKmRsGUpzb1QNZqf5?p=preview
> 
> Eventually, we could change our behavior in that `bypassSecurityTrustResourceUrl` would use an internal cache already.