sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: opencv
Issue: Can't read File using cv::FileStorage from files with very long path and filenames
Labels: priority: low,category: core

##### System information (version)


- OpenCV => 4.1
- Operating System / Platform => Windows 10
- Compiler => msvc2015 64 bit

##### Detailed description

I am not able to read a file using cv::FileStorage from a file that has a long path, while reading the file with QFile works fine.



##### Steps to reproduce


    ```.cpp
    QString path = "//server\\abcd\\efghi\\123456\\loooooooooooooooong\\lllllllllllllllllllllllllll\\aaaaaaaaaaaaaaa\\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\cccccccc\\ddddd\\eeeeeeeeeeeeeeee\\fffffffffffffff\\file___________________________________________________________________1.yml";
    
    cv::FileStorage fSettings(path, cv::FileStorage::READ);
    if (!fSettings.isOpened())
    {
        fSettings.release();
        //fail
    }
    else {
        //success
    }
    ```


##### Workaround

Read file contents using QFile and pass it to FileStorage

```.cpp
QString path = "//server\\abcd\\efghi\\123456\\loooooooooooooooong\\lllllllllllllllllllllllllll\\aaaaaaaaaaaaaaa\\bbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb\\cccccccc\\ddddd\\eeeeeeeeeeeeeeee\\fffffffffffffff\\file___________________________________________________________________1.yml";

     
            
    QFile f(path);
    bool valid = false;

    std::string contents = "";
    if(!f.open(QFile::ReadOnly))
    {
       //fail
    }
    else
    {
       //success
       
       contents = f.readAll().toStdString();
    }

    

    cv::FileStorage fSettings(contents, cv::FileStorage::READ|cv::FileStorage::MEMORY);
    if (!fSettings.isOpened())
    {
        fSettings.release();
        //fail
    }
    else {
        //success
    }
```
Repository: opencv
Issue: G-API incomplete documentation
Labels: category: documentation,category: g-api / gapi

##### System information (version)
- OpenCV => 4.x
- Operating System / Platform => N.C.
- Compiler => N.C.

##### Detailed description

The documentation for the G-API is incomplete. There is also no example on how to switch between G-API backends (Fluid, GPU, ...)
https://docs.opencv.org/4.0.0/d4/ddd/gapi_impl.html 
https://docs.opencv.org/master/d4/ddd/gapi_impl.html

More documentation or hints on how to help documenting this part is very welcome.
Documentation can contain next milestones for G-API and the most important/priority parts that need contributions from the community.
Repository: kubernetes
Issue: The vulnerability(CVE-2019-11244) is not completely eliminated
Labels: kind/bug,area/security,sig/api-machinery,lifecycle/frozen

**What happened**:
The PR(https://github.com/kubernetes/kubernetes/pull/77874) seems have fixed  [CVE-2019-11244](https://nvd.nist.gov/vuln/detail/CVE-2019-11244). 

But I doubt the correction didn't fix completely. 

According to the description of [CVE-2019-11244](https://nvd.nist.gov/vuln/detail/CVE-2019-11244):
> In Kubernetes v1.8.x-v1.14.x, schema info is cached by kubectl in the location specified by --cache-dir (defaulting to $HOME/.kube/http-cache), written with world-writeable permissions (rw-rw-rw-). If --cache-dir is specified and pointed at a different location accessible to other users/groups, the written files may be modified by other users/groups and disrupt the kubectl invocation.

The cache file created by kubectl should not be modified by other users/groups, or, to be more accurate, the file can only be modified by the user who runs the process.

But after the correction, the user in the same group still can write the cache file.
In the correction we have made the two changes:
* The path permission changed from `0755` to `0750`.  (I think it's ok. Allow user in the same group enter the path but can not modify the path, neither create nor delete a file in this path.  Refuse all other users.)
* The cache file permission changed from `0755` to `0660`. (This still allows the user in the same group modify the cache file.)

So, I think the file permission should be `0640`. The user in the same group can only read the file.

**What you expected to happen**:
The cache file can only be modified by the user who runs the process, and the users in the same group can only have read permission.

**How to reproduce it (as minimally and precisely as possible)**:
1. Create a path by root and set permission with `0755`:
 `# mkdir -m 0750 myPath0750`

2. Create a file in it by root and set permission with `0660`:
`# touch myPath0750/myFile0660`
`# chmod 0660 myPath0750/myFile0660`

3. Create a new user in root group:
`# useradd -G root -d /home/horen -m horen`
`# passwd horen`

4. Switch to new users and try to modify the file `myPath0750/myFile0660`.
You will see the new user can modify the file.

**Anything else we need to know?**:
I don't know if there a scenario for users in the same group to modify the cache file. Please let me know if there is.

**Environment**:
- Kubernetes version (use `kubectl version`): N/A
- Cloud provider or hardware configuration: N/A
- OS (e.g: `cat /etc/os-release`): CentOS 7.0
- Kernel (e.g. `uname -a`):
- Install tools:
- Network plugin and version (if this is a network-related bug):
- Others:
Repository: opencv
Issue: Crop and resize to work with blobFromImages
Labels: feature,category: dnn

<!--
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).

Please:

* Read the documentation to test with the latest developer build.
* Check if other person has already created the same issue to avoid duplicates. You can comment on it if there already is an issue.
* Try to be as detailed as possible in your report.
* Report only one problem per created issue.


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 => 4.1
- Operating System / Platform => Windows 10
- Compiler => none, using python

##### Detailed description

<!-- your description -->
I wanted to use Faster RCNN (which has the crop and resize layer in it) to do infrenece on multi image. I used tensorflow frozen graph and text graph definition to initialize the network. But upon executing net.forward(), an error was rasied saying some part of crop and resize hasnt been implemented.
`The function/feature is not implemented) in function 'cv::dnn::CropAndResizeLayerImpl::getMemoryShapes'`

Is it going to be implemented anytime soon? is it on the roadmap?

##### 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
-->

This is the general structure of the code used

```py
net = cv2.dnn.readNetFromTensorflow(#...) 
#read any 2 images
image = # ...
image2 = #... 
blob = cv2.dnn.blobFromImages([image1,image2],# ...)
net.setInput(blob)
output = net.forward()
```
Repository: angular
Issue: Ability to manually trigger all resolvers on route change
Labels: feature,freq1: low,area: router,feature: under consideration,cross-cutting: signals

I have seen quite a few tickets related to this on github, and quite a few posts on this topic involving various workarounds elsewhere on the internet, e.g. on Stack Overflow, but there still doesn't seem to be a proper, simple solution for this included within the framework.

This is my use case:

1. I have 2 routes with components - A & B - which share a common parent root (C).
2. I have a resolver configured on C. A & B both share the data from this resolver
3. In component A, I am performing a server update of the shared data, before navigating to route B.
4. When performing this navigation, I want to force the resolver on C to fire again, so that B can see the latest version of the data that has just been modified by A.

Just to be clear:
1. I do ***not*** want the resolver on C to fire _every time_ I navigate between child routes of C, and I definitely don't want all my other resolvers firing every time I navigate between child routes. So `onSameUrlNavigation` is too course a solution for this use case.
2. I want to be able to force all the resolvers to fire _programatically_, _at the point of navigation_, _in specific situations as required_ -  i.e. when I have just performed a server update and the route state has not yet been refreshed.

So I am looking for a parameter, or configuration option, that can be passed to `Router.navigate()` or `navigateByUrl()` that will force all the resolvers (and probably the guards) in the target route (hierarchy) to be re-executed.

E.g. something like the `reload: true` option provided in the AngularJS UI router, see here: https://ui-router.github.io/ng1/docs/latest/interfaces/transition.transitionoptions.html#reload - although I believe that also causes all the components to be destroyed and re-created, which is _probably_ not necessary in this case.
Repository: go
Issue: cmd/go: go.mod formatting drops unattached comments within blocks
Labels: help wanted,NeedsInvestigation,modules

### What version of Go are you using (`go version`)?

<pre>
$ go version
go version go1.13beta1 linux/amd64
</pre>

### Does this issue reproduce with the latest release?

Yes, happens with 1.12.6 too.  Not tried with tip.

### What operating system and processor architecture are you using (`go env`)?

<details><summary><code>go env</code> Output</summary><br><pre>
$ go env
GO111MODULE=""
GOARCH="amd64"
GOBIN=""
GOCACHE="/home/mohit/.cache/go-build"
GOENV="/home/mohit/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GONOPROXY=""
GONOSUMDB=""
GOOS="linux"
GOPATH="/home/mohit/go"
GOPRIVATE=""
GOPROXY="https://proxy.golang.org,direct"
GOROOT="/usr/local/go-1.13beta1"
GOSUMDB="sum.golang.org"
GOTMPDIR=""
GOTOOLDIR="/usr/local/go-1.13beta1/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/tmp/exp/go.mod"
CGO_CFLAGS="-g -O2"
CGO_CPPFLAGS=""
CGO_CXXFLAGS="-g -O2"
CGO_FFLAGS="-g -O2"
CGO_LDFLAGS="-g -O2"
PKG_CONFIG="pkg-config"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0 -fdebug-prefix-map=/tmp/go-build485779267=/tmp/go-build -gno-record-gcc-switches"
</pre></details>

### What did you do?

Executed `go mod edit -fmt` on the following.  (The following is a minimal reproducible example of the actual go.mod file.)

```
module exp

go 1.13

require (
	foo v0.0.0-00010101000000-000000000000
	// bar v0.0.0-00010101000000-000000000000
)
```

### What did you expect to see?

Perhaps no change.

### What did you see instead?

The commented disappeared after formatting.

```
module exp

go 1.13

require foo v0.0.0-00010101000000-000000000000
```
Repository: pytorch
Issue: Tensor from mmaped storage loads the entire file into memory
Labels: module: memory usage,triaged

## 🐛 Bug

Tensor from mmaped storage loads the entire file into memory for operations that don't require it.

## To Reproduce

```python
import os, torch
f = 'bigbinaryblobwithevensize'
s = torch.ByteStorage.from_file(f, True, os.path.getsize(f))
t = torch.ByteTensor.new(s)
# so far so good
t = t.view(-1,2) # loads entire file into memory for no reason
t.is_pinned() # loads entire file into memory for even less reason
```

## Expected behavior

Only the necessary parts of mmapped files should not load into memory.

## Environment

 - PyTorch Version (e.g., 1.0):
    - starting with july 21st nightly: 1.2.0.dev20190721-py3.7_cuda10.0.130_cudnn7.5.1_0
    - still working as expected with 1.2.0.dev20190720-py3.7_cuda10.0.130_cudnn7.5.1_0
 - OS (e.g., Linux): Linux
 - How you installed PyTorch (`conda`, `pip`, source): conda install pytorch-nightly
 - Python version: Python 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0] :: Anaconda, Inc. on linux
 - CUDA/cuDNN version: 430.34 (10.1) 
 - GPU models and configuration: 1050Ti
Repository: godot
Issue: Documentation is unclear on how to move a RigidBody2D in Kinematic mode
Labels: enhancement,documentation,topic:physics

**Godot version**: 3.1
**Issue description:**
It is unclear how a RigidBody2D in Kinematic mode should or can be moved.

This is the related documentation in [RigidBody2D#Mode](https://docs.godotengine.org/en/3.1/classes/class_rigidbody2d.html#enum-rigidbody2d-mode):
> MODE_KINEMATIC = 3 — Kinematic mode. The body behaves like a KinematicBody2D, and must be moved by code.

There has to be some specification as to how moving by code in kinematic mode should be.

Many users understandably assume that the `move_*` methods would be available, but naturally they aren't defined in a rigid body class.

The docs also state the following:
> "Note: You should not change a RigidBody2D’s **position** ... every frame or even very often. If you need to directly affect the body’s state, use _integrate_forces, which allows you to directly access the physics state.". 

This might discourage users to change the **position** on every frame in kinematic mode (which I guess is ok to do).

I think this would clear a lot of confusion since some googling reveals many posts asking about this.
Repository: TypeScript
Issue: moveToNewFile: move variable under cursor
Labels: Suggestion,Awaiting More Feedback,Domain: Refactorings

## Search Terms

Move to New File 
Refactor Refactoring

## Suggestion

Allow selecting variable name, not only function/class name, in moveToNewFile refactoring.

## Use Cases

moveToNewFile is useful for refactoring React component.
React component can be written in both function statements and arrow functions (function assigned to variable).
But current moveToNewFile implementation requires whole lines of a variable statement to be selected, while function and class can be moved by launching Quick Fix at their name.

## Examples

```ts
function Component(props: Props) {
  ...
}
```

Currently, when placing cursor at anywhere in function or class name, i.e. `Component` in above, VSCode shows "Move to New File" menu. But if it is variable, the menu does not show up.

```ts
// Cannot refactor until selecting all lines of below statement.
// I want to refactor this by moving cursor to anywhere in "Component"
const Component: React.FC<Props> = (props: Props) => {
  ...
}
```
## Checklist

My suggestion meets these guidelines:

* [x] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [x] This wouldn't change the runtime behavior of existing JavaScript code
* [x] This could be implemented without emitting different JS based on the types of the expressions
* [x] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [x] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).

## Implementation

https://github.com/microsoft/TypeScript/compare/master...ypresto:move-var-func-to-new-file?expand=1
Repository: TypeScript
Issue: Auto fix compilerOptions Lib
Labels: Suggestion,Experience Enhancement

##  Search Terms
compilerOptions Lib, autofix Lib, auto Lib generation, Auto compilerOptions

## Suggestion

Suggest adding the appropriate library to compilerOptions.lib if you are using a feature that requires it.

## Use Cases

* Help the developer code by preventing them from having to look up which compilerOptions.lib setting they need to use a particual feature of the standard library. As it is difficult to remember which version of ES introduced which additions.
* In the future this could be used to auto generate the compilerOptions.Lib the developer needs by the JS features they are using. Which would remove some configuration. 🎉 

## Examples

```js
Object.entities(object).map(([key, value]) => {
  ...
});
```

📎💬 “Looks like your using Object.entities, would you like to add 'es2017.object' to your compilerOptions.lib?”

____________________________________________________________________

```js
if (array.includes(testValue)) {
  ...
}
```

📎💬 “Looks like your using Array.include, would you like to add 'es2016.array.include' to your compilerOptions.lib?”

## Checklist

My suggestion meets these guidelines:

* [X] This wouldn't be a breaking change in existing TypeScript/JavaScript code
* [X] This wouldn't change the runtime behavior of existing JavaScript code
* [X] This could be implemented without emitting different JS based on the types of the expressions
* [X] This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, etc.)
* [X] This feature would agree with the rest of [TypeScript's Design Goals](https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals).
Repository: TypeScript
Issue: Change property modifier in mapped type based on condition
Labels: Suggestion,Awaiting More Feedback,Domain: Mapped Types

As I know there is no way to change property modifier of mapped types based on conditional types. Here is my use case:

```typescript
export class MakeItRequired<T extends ModelValue<any>> {
    target: "MakeItRequired" = "MakeItRequired"
    constructor(public option: T) {    
    }
}

export type ModelValue<T> = 
    T extends StringConstructor ? string : 
    T extends NumberConstructor ? number : 
    T extends BooleanConstructor ? boolean :
    unknown

export type ModelFromSchema<T> = {
    [P in keyof T]?: 
        T[P] extends MakeItRequired<infer U> ? ModelValue<U> :
        ModelValue<T[P]>
}

export const schema = {
    id: new MakeItRequired(Number),
    firstName: String,
    lastName: String
}

export const type: ModelFromSchema<typeof schema> = {}
```

My goal is to have `id` non optional, while having others optional. 
Additional screenshoot from vscode:

<img width="695" alt="Screenshot 2019-07-25 22 59 49" src="https://user-images.githubusercontent.com/1753397/61904745-1f4de380-af30-11e9-9259-01db8e79b9a0.png">

Can we have this feature?
Repository: rust
Issue: rustdoc source code page should provide more things
Labels: T-rustdoc,C-enhancement

For examples:

 * [ ] Interactions with types (adding a popup when we hover one to give information like the doc page and provide a link to its definition)
    * [ ] Interactions with all items (adding a popup when we hover one to give information like the doc page  and provide a link to its definition)
 * [ ] Collapsing blocks
 * [ ] ...
Repository: go
Issue: context: doc of WithValue should mention context is not data store
Labels: Documentation,NeedsFix

Hello everybody, 

https://github.com/golang/go/blob/919594830f17f25c9e971934d825615463ad8a10/src/context/context.go#L520-L525

Implementation of `valueCtx.Value` in context package is recursive function. That means its performance decreases at least linearly with the number of values stored in the context. Moreover, it is easily subject to stack overflow if user stores way too many values.

Documentation does not give any advice on how `context.WithValue` should be used, especially w.r.t. performance. IMHO, it would be better to update the doc in order to:

1. Discourage the user from using the `context.Context` as data store;
2. Suggest the user to just store things like map or struct, which let the user decide how to store data without impacting `valueCtx.Value` performance.

CC @mvdan
Repository: rust
Issue: slice methods could be added to the array docs
Labels: T-rustdoc,C-enhancement

(I'm surprised I couldn't find an issue for this!)

The documentation page for the [primitive array type](https://doc.rust-lang.org/std/primitive.array.html) ideally should include the methods defined on slices. (see e.g. [this report of confusion](https://users.rust-lang.org/t/array-lengths-cant-depend-on-generic-parameters-with-const-generics-bug-or-expected-behavior/30579/36) on the forum)

This could be tricky; it looks like this capability is basically hardcoded into the compiler, so `rustdoc` would need to special-case it.  (it can't rely on `Deref` like it can for `Vec`)

---

As an aside, the page contains some misleading language:

> Arrays coerce to slices (`[T]`), so a slice method may be called on an array.

This suggests that coercions enable method access, but there's plenty of coercions in Rust that do not, including other `Unsize` coercions like `&T -> &dyn Trait`.
Repository: kubernetes
Issue: Decoding should not clear apiVersion/kind
Labels: sig/api-machinery,kind/feature,help wanted,lifecycle/frozen,triage/accepted

**What would you like to be added**:
When using a typed client, decoding to a versioned struct (not an internal API type), the apiVersion/kind information returned from the server should not be dropped.

**Why is this needed**:
The `GroupVersionKind()` method included in the ObjectKind interface is largely useless when dealing with arbitrary runtime.Object instances, since typed instances drop this information here:

https://github.com/kubernetes/kubernetes/blob/69a34f6a6f67de47cb9b72b6ac98e089d301beb3/staging/src/k8s.io/apimachinery/pkg/runtime/helper.go#L245-L259

This is the decoder used when a client requests a decoder that does not do conversion:

https://github.com/kubernetes/kubernetes/blob/69a34f6a6f67de47cb9b72b6ac98e089d301beb3/staging/src/k8s.io/apimachinery/pkg/runtime/serializer/codec_factory.go#L175-L179

I could see clearing group/version/kind information when converting to an internal version, but I don't see the benefit of stripping it on decode if we're only dealing with a versioned struct.

/sig api-machinery
/cc @smarterclayton 

Note that https://github.com/kubernetes/kubernetes/issues/3030 still needs to be resolved before apiVersion/kind could be depended on for individual objects for all API responses, but this would at least solve the issue with an update of an object clearing the apiVersion/kind in an update response (xref https://github.com/kubernetes-sigs/controller-runtime/issues/526)