sharjeelyunus/github-issues-dataset huggingface dataset:
Repository: go
Issue: archive/zip: fails to encode filenames with utf-8 chars if 'Modified' is not set
Labels: NeedsInvestigation

<!--
Please answer these questions before submitting your issue. Thanks!
For questions please use one of our forums: https://github.com/golang/go/wiki/Questions
-->

### What version of Go are you using (`go version`)?

<pre>
➜ go version
go version go1.15.6 linux/amd64


</pre>

### Does this issue reproduce with the latest release?
that's almost latests



### 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/olli/.cache/go-build"
GOENV="/home/olli/.config/go/env"
GOEXE=""
GOFLAGS=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOINSECURE=""
GOMODCACHE="/home/olli/go/pkg/mod"
GONOPROXY="github.com/SharperShape"
GOOS="linux"
GOPATH="/home/olli/go"
GOPROXY="direct"
GOROOT="/usr/lib/golang"
GOSUMDB="off"
GOTMPDIR=""
GOTOOLDIR="/usr/lib/golang/pkg/tool/linux_amd64"
GCCGO="gccgo"
AR="ar"
CC="gcc"
CXX="g++"
CGO_ENABLED="1"
GOMOD="/home/olli/code/ziponator/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-build503259521=/tmp/go-build -gno-record-gcc-switches"


</pre></details>

### What did you do?


Creating a zipfile with nonASCII characters in zipped files fail to encode if Modified is not set. The behavior could be ok still but currently, it anyway checks that if utf-8 mode is needed which makes the programmer to think it should work without any tricks.

so: 
```
w := zip.NewWriter(os.Stdout)
f, err := w.Create("asdää123ääääääend")
… write to f …
```
…doesn't work, but:
```
w := zip.NewWriter(os.Stdout)
fh := zip.FileHeader{
	Name:   "asdää123ääääääend",
	Method: zip.Deflate,
	Modified: time.Now(),
}
f, err := w.CreateHeader(&fh)
``` 
works

Problem confirmed here: 
https://gophers.slack.com/archives/C029RQSEE/p1612881140479100?thread_ts=1612878897.474000&cid=C029RQSEE


### What did you expect to see?
asdää123ääääääend


### What did you see instead?
asd├д├д123├д├д├д├д├д├дend
Repository: pytorch
Issue: Support backward hooks in JIT 
Labels: oncall: jit,weeks

## 🚀 Feature
Supporting backward hooks (hooks that are called every time the gradients with respect to module inputs are computed) is a common feature requested from internal users. Eager has fixed their backward hook implementation so now it shouldn't be as difficult to match eager's behavior. 

Eager backwards hooks: https://pytorch.org/docs/master/generated/torch.nn.Module.html#torch.nn.Module.register_full_backward_hook

cc @gmagogsfm
Repository: PowerToys
Issue: [FancyZones] Option to restore all windows position when PowerToys quits
Labels: Idea-Enhancement,Product-FancyZones

A window snapped into a zone, then shutdown, saves in its zone.size and opens windowed (unsnapped). `Restore window size` breaks in next session.
Repository: create-react-app
Issue: Absorbing Scaffold and CRUD Bootstrapping Features
Labels: issue: proposal,needs triage

### Is your proposal related to a problem?

No, I created a project that writes basic CRUD components for new React projects and I want to see if there's any interest in moving these features into a module or directly into `create-react-app` 

Here is my project that I would be willing to bring into some kind of module accessible from `create-react-app`. Sorry if this seems like advertising, I think the README will help explain some of the features.

I made a project that allows a user to use one command to create components to manage CRUD resources. It creates presentation pages, forms, and logic for managing the user-defined models.
```
react-scaffold-generate generate Inventory \
    name:string \
    description:string:textarea \
    isSold:boolean \
    seller:string:email
```

Here's the project for more info:
https://github.com/DrewWeth/react-scaffold-generate

Here's a live demo of what the one-command adds to the standard `create-react-app`
http://rsg.drewweth.com/

### Describe the solution you'd like

Im frustrated when I have to bootstrap CRUD (create, read, update, delete) interfaces on a new app.

I would like to rewrite and export the functionality from my project into a module accessible via `create-react-app`

### Describe alternatives you've considered

I've looked for projects with similar features, but can't find one. This is based on Ruby on Rails's scaffolding project which I think is so powerful and isn't equally duplicated anywhere for React.

### Additional context

I'm just seeing if there is any interest or where I should more appropriately have this discussion.
Repository: react
Issue: Bug: Disabled button state update prevents `scrollIntoView`
Labels: Type: Bug,Component: DOM

I have a `button` that triggers `scrollIntoView` for a node when clicked. It also updates some state which subsequently disables that button in certain cases. If the button becomes disabled, the `scrollIntoView` execution aborts.

This seems to only happen in Chrome/Brave.

React version: 17.0.1

## Steps To Reproduce

See steps to reproduce in sandbox.

https://codesandbox.io/s/goofy-curie-yts68?file=/src/App.js

## The current behavior

Described above.

## The expected behavior

The state update should not prevent `scrollIntoView`.
Repository: excalidraw
Issue: Some grouped objects has no anchor for arrows
Labels: enhancement,discussion

Hello,

I draw a computer with the line tool. My drawing is composed with lines and polygons. Then, I group all the lines and polygons to have an unic object.

But then, my unic object has no anchor for an arrow.

The only way I found to have an anchor, is to use a square or a circle in my drawing. Then the grouped object has an anchor zone around the included square or circle.

It's not clean
Repository: TypeScript
Issue: Incorrect excess property error when assigning to intersected array
Labels: Bug

# Bug Report

### 🕗 Version & Regression Information

Tested in 3.3.3 and 4.2.0-beta and Nightly
- This is the behavior in every version I tried, and I reviewed the FAQ for entries about type inference

### ⏯ Playground Link

[Playground link with relevant code](https://www.typescriptlang.org/play?ts=4.2.0-dev.20210207#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgYQAsEAbAEymCQDEk4BvAKDhbgAoBKALjgCUIArqgDaAXQDcjAL6NGyVBhx5+QvE1ZwwmGIR4BnGFGQBzSRuzFylJAH4eKkaLgAfApYpVakmYxgBPMGVBVAB1BB0AFXCSPABePmC8ADIGOBho4Ds4AyMkUzgLUg9be0SwyIyxOClJRmwIJAM4AFtMZAA1BGAAd1LVcsIomBi4ePVWLR0eACJpgBpmVkKrKh5hRY0Wcc3Nyd04WYWdnfTh4BmAUWawf3mNzZkNUQWaxiA)

### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
export interface ChildrenFn {
    (): Route[];
}

interface Route {
    path: string;
    children?: Route[] | ChildrenFn;
}

type RouteWithTitle = Route & { title?: string; children?: RouteWithTitle[] };

const mainView: RouteWithTitle = {
    path: "",
    children: [
        {
            path: "",
            title: "Empty",
        }
    ],
};
```

### 🙁 Actual behavior

Compile error highlighting `title: "Empty"`:

```
Type '{ path: string; children: { path: string; title: string; }[]; }' is not assignable to type 'RouteWithTitle'.
  Type '{ path: string; children: { path: string; title: string; }[]; }' is not assignable to type 'Route'.
    Types of property 'children' are incompatible.
      Type '{ path: string; title: string; }[]' is not assignable to type 'ChildrenFn | Route[] | undefined'.
        Type '{ path: string; title: string; }[]' is not assignable to type 'Route[]'.
          Type '{ path: string; title: string; }' is not assignable to type 'Route'.
            Object literal may only specify known properties, and 'title' does not exist in type 'Route'.(2322)
```

### 🙂 Expected behavior

The type of the object inside `children` should be `RouteWithTitle` and no error should occur.

Extracting the child to a `const` "fixes" the error even though no more type info is given to the compiler:

```ts
const c = {
            path: "",
            title: "Empty",
        };

const mainView: RouteWithTitle = {
    path: "",
    children: [
       c
    ],
};
```

[Playground link with the code that works](https://www.typescriptlang.org/play?ts=4.2.0-dev.20210207#code/KYDwDg9gTgLgBASwHY2FAZgQwMbDgYQAsEAbAEymCQDEk4BvAKDhbgAoBKALjgCUIArqgDaAXQDcjAL6NGyVBhx5+QvE1ZwwmGIR4BnGFGQBzSRuzFylJAH4eKkaLgAfApYpVakmYxgBPMGVBVAB1BB0AFXCSPABePmC8ADIGOBho4Ds4AyMkUzgLUg9be0SwyIyxOClJRmwIJAMCuHj1Vi0dHgAiLoAaZlZ0mBjugFEAWzB-PulJesb4ccxkADUEYAB3UtVywijhuIYBlg7dOB7+83drHmFjjQL70X6axiA)
Repository: transformers
Issue: PruneTrain: Fast Neural Network Training by Dynamic Sparse Model Reconfiguration
Labels: New model,Feature request

# 🚀 Feature request

PruneTrain. {...} By using a structured-pruning approach and additional reconfiguration techniques we introduce, the pruned model can still be efficiently processed on a GPU accelerator. Overall, **PruneTrain achieves a reduction of 39% in the end-to-end training time of ResNet50 for ImageNet by reducing computation cost by 40% in FLOPs, memory accesses by 37% for memory bandwidth bound layers, and the inter-accelerator communication by 55%.**

## Motivation

I'm pre-training some midsize language models from scratch. If you tell me that I can pretrain a network with 1% drop in performance while cutting down the energy demand of the training by up to 40% and speeding inference time at the same time, I will buy it.

## Your contribution

https://arxiv.org/abs/1901.09290. I can not understand why the authors did not open source the code, since it could reduce the global warming, speedup experimentation and reduce energy consumption.
Repository: flutter
Issue: Make device-id a multi-option to allow multiple IDs to be specified in the same command
Labels: tool,P3,team-tool,triaged-tool

Allow users to run `flutter -d 1234 -d 5678` for commands that support multiple devices (only `flutter run`?)

`flutter -d all` is less useful to target all connected devices, or all running emulators, etc. in the world of desktop/web support. #9585
Repository: TypeScript
Issue: Type infer issue in interfaces with internal properties
Labels: Rescheduled

# Bug Report

### 🕗 Version & Regression Information
4.1.3 & 4.2.0-dev the same

### ⏯ Playground Link
https://www.typescriptlang.org/play?ts=4.2.0-beta#code/JYOwLgpgTgZghgYwgAgEJwM4oN4ChkHKgbAAmEAXMnobcgG5UgCuAtgEbQDc+hAvrgG5QkWIhQANZBAAekEKQxpMOXgWJlK1NXUbIAjDoG04TNpyg9aMgPxmO3QbmHho8JMgCa0uRAVL0LG1aDXIqGjoCPQAmIx1TZBYHSx0ATztE80chETdxZAAtH3lFZSCI9RASMODIhioAZjjaAC8MpIseIQQAeyqwBmj7C2QAXmRongAbCAH6fSp9AB9J52AYZAAKemix0fHogEoGfTGJrmkpoPmz-R5cXv6GOCnmLSklrzOKoirNcJ0tD08yMABp4osAAyCe6PDA9GYAOimPQA5tsXm9DjwgA


### 💻 Code

<!-- Please post the relevant code sample here as well-->
```ts
interface Base {
    inside: {
        v: number;
    }
}

interface X extends Base {
    inside: {
        v: 1
    }
    a: number;
    x?: number;
}

interface Y extends Base {
    inside: {
        v: 2
    }
    a: number;
    y?: number;
}

interface Z extends Base {
    inside: {
        v: 3
    }
    z?: number;
}

const v2: number = 2;
let v1: 1|2;

if (v2 === 2) v1 = 2; else v1 = 1;

const value: X | Y = {
    inside: {
        v: v1
    },
    a: 10
};

console.log(value);
```

### 🙁 Actual behavior

Type '{ inside: { v: 1 | 2; }; a: number; }' is not assignable to type 'X | Y'.
  Type '{ inside: { v: 1 | 2; }; a: number; }' is not assignable to type 'Y'.
    Types of property 'inside' are incompatible.
      Type '{ v: 1 | 2; }' is not assignable to type '{ v: 2; }'.(2322)


### 🙂 Expected behavior

No error ^^
Repository: pytorch
Issue: Allow Custom Classes to register a handler for .to operations 
Labels: oncall: jit,feature,module: custom-operators,weeks

## 🚀 Feature
<!-- A clear and concise description of the feature proposal -->

We would want to be able to register a handler for `.to` like we do for `.def_pickle` using torchbind to allow us to define custom behavior to move a custom class from one device to another or to error out if such a move is impossible. Ideally this `.to` function would be called either by the user directly on an instance of the class or recursively when the user calls `.to` on the module owning the instance, similar to how it works for tensors owned by modules today. 

## Motivation

<!-- Please outline the motivation for the proposal. Is your feature request related to a problem? e.g., I'm always frustrated when [...]. If this is related to another GitHub issue, please link here too -->

In TRTorch we store a custom class managing a TensorRT engine as an attribute of a ScriptModule. However TRT engines once initialized are device specific so we would like to open up the possibility for users to move these engines between devices using a standard PyTorch convention.   

## Pitch

<!-- A clear and concise description of what you want to happen. -->

Ideally we would like to see something like this possible 

```py
import torch
import trtorch

# Create model on device 0
model = MyModel()
ts_model = torch.jit.script(model).to("cuda:0")
trt_model = trtorch.compile(ts_model, {...}) # or trt_model = torch._C._jit_to_backend("tensorrt", ts_model, ...)

# Move module (internal tensors and attributes that have a .to registration) to device 1 
trt_model.to("cuda:1")
```

## Alternatives

<!-- A clear and concise description of any alternative solutions or features you've considered, if any. -->

We could write an independent `.to` method that works when invoked on an instance but in the case that that instance is owned by a module I am not sure what the process is for users to dig out a reference to the attribute to call the method on. 

There might be a better way to store the custom class so that this wouldn't effect all attributes as well. I am not too familiar with the common use cases for attributes. 

## Additional context

<!-- Add any other context or screenshots about the feature request here. -->

This is our current custom class: https://github.com/NVIDIA/TRTorch/blob/master/core/runtime/TRTEngine.cpp

and how we register it as an attribute in the module: https://github.com/NVIDIA/TRTorch/blob/6442fce997e1506d859fab789527fe1e282f683f/core/compiler.cpp#L57

Some additional context can be found here as well for a tangentially related feature in TRTorch: https://github.com/NVIDIA/TRTorch/discussions/311


It was pointed out in the PyTorch slack that this is where the `.to` call on the module is resolved, presumably this would need to be modified to call `.to` on attributes of script modules as well 
https://github.com/pytorch/pytorch/blob/master/torch/csrc/jit/api/module.cpp#L78-L102

cc @gmagogsfm
Repository: flutter
Issue: Inkwell tap behaviour makes it too easy to onTapCancel.
Labels: c: new feature,framework,f: gestures,c: proposal,P3,team-framework,triaged-framework

## Use case

I've a Flutter application with a button that uses an Inkwell.  

The button is rather large.  

When I press on the button the ink well splash goes off.  

If I then drag my finger from its initial down position too much to the left or right before lifting up my finger (while still within the bounds of the button) the onTapCancel goes off instead of an expected onTap.

While I can understand the use case of an onTapCancel going off in the case where my finger has left the button bounds, I think it's reasonable for a user to expect the button to trigger its on press behaviour while their finger is still on the button when they lift it.

Additionally, it would be nice to have the option of removing onTapCancels altogether so that even if the user lifts their finger when outside the button bounds the onTap could go off.  My reasoning for this is we've already signalled to the user that the button is going to go off (due to the splash).  There's no equivalent signal to indicate the tap was cancelled (like maybe a red splash could do) so its not unreasonable for the user to expect the button will fire regardless - but perhaps there could be a radius out from the button bounds within which taps are not cancelled but outside that radius they are cancelled.

We've found on some devices on which a button affordance is of sufficient size for the user to hit, it's still very easy for the user to accidentally onTapCancel when they intended to onTap.

## Proposal
Add configuration to Inkwell to control the behaviour of onTap/onTapCancel including:
1. Allow any tap ups within the bounds of the button (and also within an optional radius) to trigger an onTap instead of onTapCancel.
2. Allow the user to move their finger within the button without triggering any additional events.
3. _optional_ Emit some sort of animation indicating when a tap on an Inkwell has been cancelled.
Repository: react
Issue: Scheduling profiler feedback
Labels: Type: Feature Request,Component: Developer Tools

Some of this might not be possible or might be prohibitively difficult, but this was some user feedback/requests for the scheduling profiler:
* Show lane labels instead of bitmap index
* On hover for a batch of render work highlight update events that were related to that render batch
* Show when tasks are scheduled (in the scheduler, any JavaScript, not just React
* Find-in-page that shows number of results like Chrome and updates as you zoom and scroll
* Show lane(s) state update get associated with in chart tooltip
* Highlight batched updates on hover (hovering one item would update others)
Repository: TypeScript
Issue: typeAcquisition without import explicitly
Labels: Needs Investigation

<!-- ⚠️⚠️ Do Not Delete This! feature_request_template ⚠️⚠️ -->
<!-- Please read our Rules of Conduct: https://opensource.microsoft.com/codeofconduct/ -->
<!-- Please search existing issues to avoid creating duplicates. -->

<!-- Describe the feature you'd like. -->
VSCode has a feature in `jsconfig.json` called `"typeAcquisition"`, but when I try to add some NPM package name into `"typeAcquisition.include"`, there is no code IntelliSense, even those NPM packages has its types(d.ts).

I've tried several ways: 
1. import those library into one of JS file in workspace, and it works; (But this is also working without `"typeAcquisition"`);
2. try some other NPM package with its @types/xxx package installed, and it also works;

So I wonder if `"typeAcquisition"` can work with packages with types(d.ts), and without import those packages explicitly?
Repository: rust
Issue: Tracking Issue for Vec::split_at_spare_mut
Labels: T-libs-api,C-tracking-issue

Feature gate: `#![feature(vec_split_at_spare)]`

This is a tracking issue for `Vec::split_at_spare_mut`, which is used as the basis for a few methods internally to give a slice pointing to the initialized portion of the `Vec` and a slice of `MaybeUninit` pointing to the uninitialized portion.

### Public API

```rust
impl<T, A: Allocator> Vec<T, A> {
    pub fn split_at_spare_mut(&mut self) -> (&mut [T], &mut [MaybeUninit<T>]) {}
}
```

### Steps / History

- [x] Implementation: #81687
- [ ] Final commenting period (FCP)
- [ ] Stabilization PR

### Unresolved Questions

- [ ] Should we consider changing the name? `split_at_spare_mut` doesn't seem like an intuitive name
- [ ] Should we deprecate `Vec::spare_capacity_mut`? Any usecase of `Vec::spare_capacity_mut` can be replaced with `Vec::split_at_spare_mut` (but not vise-versa): 
**edit**: `spare_capacity_mut` has been stabilised now in https://github.com/rust-lang/rust/pull/93016 so deprecating it is probably not an option
Repository: pytorch
Issue: Implementation of Normalized Euclidean Distance (NED) in pytorch
Labels: module: nn,triaged,function request,module: distance functions

## 🚀 Feature
Implement an official version of normalized Euclidean distance. Reference of definition:
- https://stats.stackexchange.com/questions/136232/definition-of-normalized-euclidean-distance/498753?noredirect=1#comment937825_498753


## Motivation

A pytorch approved and numerically stable implementation of normalized euclidean distance

## Pitch

Current implementation:

```
def ned_torch(x1, x2, dim=1, eps=1e-8):
    """
    Normalized eucledian distance in pytorch.

    https://discuss.pytorch.org/t/how-does-one-compute-the-normalized-euclidean-distance-similarity-in-a-numerically-stable-way-in-a-vectorized-way-in-pytorch/110829
    https://stats.stackexchange.com/questions/136232/definition-of-normalized-euclidean-distance/498753?noredirect=1#comment937825_498753

    :param x1:
    :param x2:
    :param dim:
    :param eps:
    :return:
    """
    if x1.size(1) == 1:
        ned_2 = 0.5 * ((x1 - x2)**2 / (x1**2 + x2**2 + eps))
    else:
        # num_dims = len(x1.size())
        # dim = torch.tensor(range(1, num_dims))
        ned_2 = 0.5 * ((x1 - x2).var(dim=dim) / (x1.var(dim=dim) + x2.var(dim=dim) + eps))
    return ned_2 ** 0.5
```

test:

```
def test_ned():
    import torch.nn as nn

    # dim = 1  # apply cosine accross the second dimension/feature dimension

    k = 4  # number of examples
    d = 8  # dimension of feature space
    for d in range(1, d):
        x1 = torch.randn(k, d)
        x2 = x1 * 3
        print(f'x1 = {x1.size()}')
        ned_tensor = ned_torch(x1, x2)
        print(ned_tensor)
        print(ned_tensor.size())
```

## Alternatives

No alternative, NED is not in pytorch

## Additional context

Related:
- https://discuss.pytorch.org/t/how-does-one-compute-the-normalized-euclidean-distance-similarity-in-a-numerically-stable-way-in-a-vectorized-way-in-pytorch/110829


cc @albanD @mruberry @jbschlosser
Repository: flutter
Issue: Opt a subtree out of hitTestSelf culling
Labels: c: new feature,framework,f: gestures,P3,team-framework,triaged-framework

We often get questions about why hit testing "doesn't work" around transforms. The short answer is that ancestors don't ask their children to hit test if their own hitTestSelf fails (no point asking your children if they were hit if the hit wasn't inside your bounds).

@csells suggested that it would be nice if a subtree could opt-in to not doing that culling. Obviously that would in general be expensive but it would be less expensive than doing a full tree walk (unless someone opted out the entire tree, obviously). I think we would still avoid doing this ever in the Flutter framework since it's better to adjust the widget hierarchy to not have ancestors of the transformed widget be smaller than that widget, but it might be useful in especially elaborate scenes where that is impractical.

One way to do that would be to have HitTestResult have a flag that says whether to apply the hitTestSelf check. Having to check that flag every step of the walk would itself be not cheap, but the cost (which affects every app) might still be worth it?

Another option might be to have a way for a widget to hook into the hit testing of a far ancestor (e.g. via an inherited widget). That would be better in that it would allow the whole thing to be done as a package. Maintaining paint order correctness would be distinctly non-trivial though (maybe even intractable).

Any other ideas?

cc @goderbauer