WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
It seems that one of the likeable features of TypeScript, compared to Babel lets say, is that it emits readable code.

Consider the following code:

X.ts:

namespace a.b.x {
class X {

}
}

Y.ts:

namespace a.b.y {
class y {

}
}

This emits:

var a;
(function (a) {
var b;
(function (b) {
var x;
(function (x) {
var X = (function () {
function X() {
}
return X;
})();
})(x = b.x || (b.x = {}));
})(b = a.b || (a.b = {}));
})(a || (a = {}));

var a;
(function (a) {
var b;
(function (b) {
var y;
(function (y_1) {
var y = (function () {
function y() {
}
return y;
})();
})(y = b.y || (b.y = {}));
})(b = a.b || (a.b = {}));
})(a || (a = {}));

There's a lot of code redundancy, which can really clutter the emitted output for projects that rely heavily on namespaces.

Wouldn't it be nice if we could just do something like this:

namespace a.b {
export namespace x {
/// include X.ts
}
export namespace y {
/// include Y.ts
}
}

The include statement simply places the included file into the script during pre-compilation.

My guess is that this is already partly implemented with /// reference, only that ///reference doesn't seem to work unless it's either the first line, or one succeeding another /// reference.

Issue 2:
We have a typescript application and a use a file per class. There are lots of benefits to this the major one being source control conflict reduction.

We compile our app using the --out compiler flag but I think there is room for some serious optimization of the compilers output for modules.

Currently if you have two classes defined in separate files the compile generates the following JavaScript.

var Example;
(function (Example) {
(function (Nested) {
(function (Issue) {
var bar = (function () {
function bar() {
}
return bar;
})();
Issue.bar = bar;
})(Nested.Issue || (Nested.Issue = {}));
var Issue = Nested.Issue;
})(Example.Nested || (Example.Nested = {}));
var Nested = Example.Nested;
})(Example || (Example = {}));

var Example;
(function (Example) {
(function (Nested) {
(function (Issue) {
var foo = (function () {
function foo() {
}
return foo;
})();
Issue.foo = foo;
})(Nested.Issue || (Nested.Issue = {}));
var Issue = Nested.Issue;
})(Example.Nested || (Example.Nested = {}));
var Nested = Example.Nested;
})(Example || (Example = {}));

I suggest a compiler flag that composes all classes/ functions etc under a single module declaration? So the output code would be like the example below. This would dramatically reduce the size of the JavaScript the compiler outputs. I estimate that our app which currently compiles to around 15,000 lines of probably be only be 2000 lines if this were available.

var Example;
(function (Example) {
(function (Nested) {
(function (Issue) {
var bar = (function () {
function bar() {
}
return bar;
})();
Issue.bar = bar;
var foo = (function () {
function foo() {
}
return foo;
})();
Issue.foo = foo;
})(Nested.Issue || (Nested.Issue = {}));
var Issue = Nested.Issue;
})(Example.Nested || (Example.Nested = {}));
var Nested = Example.Nested;
})(Example || (Example = {}));
Issue 1:
This gist records my input file & output files when using common and system module option.

In Line 31 of output-common.js, it compiles 'for (let b of a())' to

for (var _iterator = a()[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)

But in Line 37 of output-system.js, it compiles to

for (_iterator; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true)

without initialize of _iterator, lead to a Cannot read property 'next' of undefined() error.

My Babel compiler version is 5.6.14

Thank you for your work.

Issue 2:
Not sure if this is your bug. When calling babel for following example (loop.js) I got an unusable output.

for (let i = 0; i < 10; i++) {
console.log(i);
}

Using babel 5.6.14 (Windows) with modules system

babel loop.js --modules system

Output: Variable i is never initialized, console.log is never called

System.register([], function (_export) {
"use strict";

var i;
return {
setters: [],
execute: function () {
for (i; i < 10; i++) {
console.log(i);
}
}
};
});
Issue 1:
Summary of the new feature/enhancement

I was wondering if the "single-key/multi-use" functionality of dual-key-remap might be something that would complement the Keyboard Manager.

The canonical usage example is to allow the Capslock key to be re-mapped to Escape when pressed, but Ctrl when held in combination with other keys (e.g. Capslock + s equals Save). With this type of mapping, the Capslock still functions as Escape if it is pressed/released as the last key in a combination. For example, assuming Ctrl is still also bound to Ctrl, the combination Ctrl + Shift + Capslock will open the Windows Task Manager.

I've been using it extensively for a couple of months and it has functioned flawlessly for me, without any gotchas.

I suspect it's not "mission-critical", but I've found it to be surprisingly helpful, with a lot of potential uses.

Issue 2:
Summary of the new feature/enhancement

I would like it to support mapping holding a key to a function, e.g. holding CapsLock key for a given period to switch input language
Issue 1:
🐛 Bug

Hi, during training, I noticed that when specifiying weights for CrossEntropyLoss, using the 'mean' reduction produces a different loss output, compared to using the 'none' reduction and computing the mean manually.

To Reproduce

Steps to reproduce the behavior:

import torch
import torch.nn as nn

logits = torch.randn((16, 5))
targets = torch.empty(16, dtype=torch.long).random_(5)

weights = [1, 2, 3, 4, 5]
cross_ent_mean = nn.CrossEntropyLoss(weight=torch.FloatTensor(weights), reduction='mean')
loss_a = cross_ent_mean(logits, targets)
print(loss_a)

cross_ent = nn.CrossEntropyLoss(weight=torch.FloatTensor(weights), reduction='none')
loss_b = cross_ent(logits, targets).mean()
print(loss_b)

assert torch.equal(loss_a, loss_b)

Expected behavior

The loss computed by the two methods should be equal torch.equal(loss_a, loss_b) = True

Environment

Please copy and paste the output from our

environment collection script

(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

PyTorch Version (e.g., 1.0): 1.6.0.dev20200505+cu101

OS (e.g., Linux): Windows 10

How you installed PyTorch (conda, pip, source): pip

Build command you used (if compiling from source):

Python version: 3.7.6

CUDA/cuDNN version: CUDA 10.1 (irrelevant)

GPU models and configuration: GTX970M (irrelevant)

Any other relevant information:

Additional context

It seems to be the problem with the weights as I tried out to assign the same weight to all the classes, however, theorectically, the weighted loss should be computed before applying the mean() operation.

cc @ezyang @gchanan @zou3519 @jlin27 @albanD @mruberry

Issue 2:
In #25169, we added GloballyUniqueId to encapsulate ids. We use something similar in DistAutogradContainer as well. We should consolidate these two and use a single GloballyUniqueId across the codebase.

cc @pietern @mrshenli @pritamdamania87 @zhaojuanmao @satgera
Issue 1:
I can't seem to get any numpad shortcuts .. tried '1' and it really just fires on the '1' key.

Would expect something like 'numpad0' to 'numpad9'.

Guess it's a missing feature so far?

Issue 2:
We have zoom hotkeys set up using accelerators for +, -, and 0. These work as expected, but not when someone presses NumPadPlus, NumPadMinus, or NumPad0. Seems that all number pad keys should map to the same accelerators.
Issue 1:
Bootstrap carousel is not working in IE( any version ). I have included bootstrap.js, bootstrap-transition.js and bootstrap-carousel.js. Any help in this regard would be appreciated. Thanks in advance.

Cheers!

Issue 2:
I am getting an error in IE. The transition.js file is included in my bootstrap.min.js file and the carousel element as the 'slide' class. The page error come back as "e.support.transition.end is null or not an object. You can see here: http://www.wedlakebell.com/
Issue 1:
On linux/amd64 with 0b9866f. I saw this only once during a test like the following:

#!/usr/bin/env bash

# go test -c

set -xe
while true; do
GOMAXPROCS=$[ 1 + $[ RANDOM % 128 ]] ./net.test -test.v=true -test.short=false -test.run=TestVariousDeadlines || exit 255
done

Issue 2:
A send on an unbuffered channel to a blocked receiver writes directly to the receiver's stack. This violates the assumption made by the garbage collector that all writes to a stack happen while the receiver is executing and go through write barriers. This causes missed writes and incorrect collection of data.
Issue 1:
Symfony version(s) affected: 3.4.13

Description

Binding controller service argument used to work in Symfony 3.4.12, but not in 3.4.13 anymore.

How to reproduce

service.yml :

services:
_defaults:
autowire: true
autoconfigure: true
public: true
bind:
$em: '@doctrine.orm.my_entity_manager'

My\FrontofficeBundle\Controller\:
resource: '../../Controller'
tags: ['controller.service_arguments']

The controller action is defined as :

public function indexAction(Request $request, EntityManagerInterface $em)
{
...

I have several entity managers defined in config.yml, and my_entity_manager is not the default one.

In Symfony 3.4.13, the controller action gets the default entity manager. I would expect it to be passed my_entity_manager, like in Symfony 3.4.12.

Possible Solution

A solution is to inject the entity manager via a controller constructor :

public function __construct(EntityManagerInterface $em)
{
$this->em = $em;
}

Then we get the correct entity manager.

But is this behaviour expected ? And is it expected that the behaviour changed between minor Symfony versions ?

Issue 2:
Symfony version(s) affected: 4.1.2

How to reproduce

Bind a value to a controller will cause the following error:

In ResolveBindingsPass.php line 48:

Unused binding "$advertiserFetcher" in service
"App\Controller\Admin\CampaignAdminController".

services.yml:

App\Controller\Admin\CampaignAdminController:
bind:
$advertiserFetcher: '@app.advertiser_fetcher'

CampaignAdminController:

/**
* @Route("/", name="campaign_admin_index")
* @param AdvertiserFetcherInterface $advertiserFetcher
* @return Response
*/
public function indexAction(AdvertiserFetcherInterface $advertiserFetcher)
{
$advertisers = $advertiserFetcher->fetchAdvertisers();
...
}

Possible Solution

Make bugfix 28041 available on symfony 4.1.2 too.
Issue 1:
While the general direction are users moving from NodeJS into Deno, for me, I enjoy Deno modules while working on a bigger NodeJS/TS project that consumes npm packages.

I would like to import my Deno modules back into NodeJS while retaining type declaration. Steps that I have to do now are:

Copy a.. *.ts files to a temp dir.

Remove all .ts from imports .

Recursively resolve all externally loaded modules.

There's also deno bundle, which is useful, but it does not generate type declaration file. It would be nice if there's deno bundle --declaration, similar to tsc --declaration.

What does the community think?

Issue 2:
Instead of an array like so:

[
{
"runtime": "Deno/1.28.3 x86_64-apple-darwin",
"cpu": "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz",
"origin": "file:///Users/serhiy.barhamon/tmp/deno/test_ffi/tests/bench.js",
"group": null,
"name": "Deno.UnsafePointerView#getUint32",
"baseline": false,
"result": {
"ok": {
"n": 49,
"min": 1251.9348,
"max": 1441.2696,
"avg": 1308.7523755102038,
"p75": 1324.1055,
"p99": 1441.2696,
"p995": 1441.2696,
"p999": 1441.2696
}
}
},
{
"runtime": "Deno/1.28.3 x86_64-apple-darwin",
"cpu": "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz",
// ...
}
]

It would probably be better to not duplicate the runtime and cpu for each object and instead do something like:

{
"version": 1, // https://github.com/denoland/deno/issues/17774
"runtime": "Deno/1.28.3 x86_64-apple-darwin",
"cpu": "Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz",
"benches": [
{
"origin": "file:///Users/serhiy.barhamon/tmp/deno/test_ffi/tests/bench.js",
"name": "Deno.UnsafePointerView#getUint32",
"baseline": false,
"result": {
"n": 49,
"min": 1251.9348,
"max": 1441.2696,
"avg": 1308.7523755102038,
"p75": 1324.1055,
"p99": 1441.2696,
"p995": 1441.2696,
"p999": 1441.2696
}
},
{
// ..
}
]
}

We should think of some other improvements as well, like no "ok" sub object in "result" and not serializing the group name when it's "null" or perhaps grouping together benches with the same group?

Related #17774
Issue 1:
numpy.ma.load() fails on files generated bu numpy.ma.dump() in python3. See the following code:

from __future__ import print_function
import sys
import numpy as np

print("Python version:", sys.version)
print("Numpy version:", np.version.full_version)

mma = np.ma.ones((4,4))
mma.dump("mma.dat")

mmb = np.ma.load("mma.dat")

And now let's run it:

laptop:~/py/Varie/testNPdump$ python testMAdump.py
Python version: 2.7.12 (default, Nov 20 2017, 18:23:56)
[GCC 5.4.0 20160609]
Numpy version: 1.13.3

Now with python3:

lfini@lfini-laptop:~/py/Varie/testNPdump$ python3 testMAdump.py
Python version: 3.5.2 (default, Nov 23 2017, 16:37:01)
[GCC 5.4.0 20160609]
Numpy version: 1.13.3
Traceback (most recent call last):
File "testMAdump.py", line 11, in <module>
mmb = np.ma.load("mma.dat")
File "/usr/local/lib/python3.5/dist-packages/numpy/ma/core.py", line 7868, in load
return pickle.load(F)
File "/usr/lib/python3.5/codecs.py", line 321, in decode
(result, consumed) = self._buffer_decode(data, self.errors, final)
UnicodeDecodeError: 'utf-8' codec can't decode byte 0x80 in position 0: invalid start byte

Issue 2:
When using numpy.ma.dump to save a masked array in Python 3:

np.ma.dump(a, pathtofile)

I got the following error:

/home/btan1/.virtualenvs/python3.3/lib/python3.3/site-packages/numpy/ma/core.py in dump(a, F)
7141 if not hasattr(F, 'readline'):
7142 F = open(F, 'w')
-> 7143 return pickle.dump(a, F)
7144
7145 def dumps(a):

TypeError: must be str, not bytes

This is with NumPy 1.9.1 and Python 3.3.2.

From what I found out, it is because in Python 3 pickle files has to be opened in binary mode, i.e. L7142 should be F = open(F, 'wb'). Indeed, if I were to change it to:

with open(pathtofile, 'wb') as f:
pickle.dump(a, f)

the error goes away.
Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

7.1.8

Operating System:

macOS Mojave

Expected Behavior

A framerate of 20-30 fps when streaming navigator.mediaDevices.getUserMedia with chromeMediaSource = desktop

Actual Behavior

We see a maximum of 5/6 fps instead of the 20-30 fps that we see when streaming from Chrome via https://www.webrtc-experiment.com/Pluginfree-Screen-Sharing/#4676396026610028

To Reproduce

We use RTCPeerConnection and navigator.mediaDevices.getUserMedia to stream the desktop. If we open chrome://webrtc-internals from within Electron, we see a framesEncoded/s of 5/6 fps.

We tried to use this, but it did not improve:

app.commandLine.appendSwitch('webrtc-max-cpu-consumption-percentage=100')

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for a feature request that matches the one I want to file, without success.

Electron Version

15.0.0

What operating system are you using?

Ubuntu

Operating System Version

Ubuntu 20.04

What arch are you using?

x64

Last Known Working Electron version

13

Expected Behavior

No ERROR

Actual Behavior

When running the electron-react app I get this error message.

If I downgrade Electron from version 15 to version 13 the error disappears.

The problem starts to appear from version 14

Testcase Gist URL

No response

Additional Information

97258:1026/120955.772050:ERROR:sandbox_linux.cc(374)] InitializeSandbox() called with multiple threads in process gpu-process.
Issue 1:
My package.json file:

{
"scripts": {
"forever": "forever start server.js",
"db": "mongod --dbpath ./data",
"nodemon": "nodemon server.js",
"debug": "concurrently \"npm run db\" \"npm run nodemon\" \"parse-dashboard --config parse-dashboard-config.json --allowInsecureHTTP\"",
"start": "concurrently \"npm run db\" \"npm run forever\" \"parse-dashboard --config parse-dashboard-config.json\"",
"test": "echo \"Error: no test specified\" && exit 1"
},

Is it possible to use vscode to debug for "npm run debug" ? Thanks.

Issue 2:
Hi all,

Looks like current trend to run NodeJs app via npm start or npm dev.

By default, launch.json does not allow us to do this. It`s very unusable. My suggection - to add this feature, that allow easily cconfigure how to run app and not just by parameter "node" and entry point to the site.

Thanks.
Issue 1:
Choose one: is this a bug report or feature request?

Input Code

let code = `class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {

return <div>
<div id="："></div>
</div>;
}
}`

Babel/Babylon Configuration (.babelrc, package.json, cli command)

babel.transform(code, {
compact: false,
comments: true,
plugins: ["syntax-jsx", "syntax-object-rest-spread", function (babel) {
return {
visitor: {
JSXOpeningElement: function ({node}) {
// do something...
}
}
}]
}

Expected Behavior

I want to preserve double byte chars, like this

class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {

return <div>
<div id="："></div>
</div>;
}
}

Current Behavior

but babel translates my double byte chars, "：" ===> "\uFF1A"

class Demo extends React.Component {
constructor(props) {
super(props);
this.state = {};
}
render() {

return <div>
<div id="\uFF1A"></div>
</div>;
}
}

Possible Solution

Context

Your Environment

software
version(s)

Babel
6.26.0

Babylon

node
v7.7.4

npm
4.1.2

Operating System
mac os

Issue 2:
After #4478 PR I discovered that Cyrillic text inside a jsx tag transpiled to \uXXXX-style escape sequences. This leads to issues in debug and growing output bundle size. But if I have JSXExpression with StringLiteral all works as expected and text stay unescaped.

Input Code

<div>
<Foo>Привет</Foo>
<Foo>{"Привет"}</Foo>
</div>

Babel Configuration (.babelrc, package.json, cli command)

{
"presets": [
"react",
["es2015", { "loose": true, "modules": "commonjs", "spec": true }],
"es2016",
"es2017"
]
}

Expected Behavior

React.createElement(
"div",
null,
React.createElement(
Foo,
null,
"Привет"
),
React.createElement(
Foo,
null,
"Привет"
)
);

Current Behavior

React.createElement(
"div",
null,
React.createElement(
Foo,
null,
"\u041F\u0440\u0438\u0432\u0435\u0442"
),
React.createElement(
Foo,
null,
"Привет"
)
);

Possible Solution

Add option to disable generating ASCII-safe code or fix escaping behavior.

Your Environment

software
version

Babel
6.17.0

node
6.9.1

npm
3.10.8

Operating System
OS X 10.12.1
Issue 1:
Problem description

In landscape mode, the datepicker doesn't seem to be centered vertically on the screen so the bottom is cut off on smaller resolutions. You can also observe this by looking at the material-ui demos in iphone5 landscape mode (see screenshot). By playing around in responsive mode, it appears there is some enforced minimum margin from top to account for a navbar (even if there's not one present). Is an always visible nav bar part of the material design spec?

I looked through open and closed issues and didn't find this. I also tried switching between margin-top and padding-top on the main content div with no difference. Maybe there's a css trick I am not aware of?

Link to minimal working code that reproduces the issue

<DatePicker fullWidth
floatingLabelText="Some label"
mode="landscape" />

Versions

Material-UI: 0.17.1

React: 15.4.2

Browser: Chrome 56.0.2924.87 with devtools and device toolbar open.

Issue 2:
The bottom of both controls gets cut off by the navigation bar. Repros on the examples on material-ui.com
Issue 1:
VSCode Version: 1.1.1

OS Version: Windows 10 x64

Steps to Reproduce:

When i write this kind of code, part of it is highlighted as green

Example if i write var testing = test ? console.log('true') : console.log('false') it highlights text after :

So i think it happens when i use "var" and ":" in same line! and green color ends at "="

Issue 2:
VSCode Version: 1.2.0 - insider

OS Version: Elementary OS

Steps to Reproduce:

In elementary os, I am able to use ctrl+c/ctrl+v within terminal, This functionality is missing in integrated terminal.

So please add direct paste and copy functionality in integrated terminal. It's a cool feature.
Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

7.1.3

Operating System:

Windows 10

Last Known Working Electron version:

Unkown

Expected Behavior

To prevent the creation of the new window without crashing and unresponsive.

Actual Behavior

The subprocess gets unresponsive and crashes.

To Reproduce

https://gist.github.com/4d36be07d7b1cfc6244477cb989b86d3

Screenshots

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

I have enabled nativeWindowOpen and nodeIntegrationInSubFrames for main window, and I have a preload script which required a remote from electron. Which this configuration I open a child window and then I close it. The main window render process hangs for ever so I have to restart whole app. Here is and example app https://github.com/zarubond/electron-quick-start/tree/child_hang

Electron Version:

6.0.7, 7.0.0-beta3

Operating System:

Windows, Linux, MacOS

Last Known Working Electron version:

5.0.10

Expected Behavior

Closing child window should not hang main window for ever

Actual Behavior

Main window hangs after closing child window.

To Reproduce

Open child window and then close it

Screenshots

Additional Information
Issue 1:
denoland extension is installed in the VSCode IDE, but it still doesn't works.

Issue 2:
I switched from one of the now-deprecated extensions, which was working, and this one isn't working properly. In fact, it seems to have all the same errors that you get with plain TypeScript and no Deno extension:

On the references to Deno it says Cannot find name 'Deno'..

The extension is definitely active (I can see Deno 1.0.5 in the corner) and I've restarted my editor, upgraded to the latest deno runtime, etc.

Edit: In case it matters, I'm on macOS
Issue 1:
I am now experimenting with the ES6 import syntax (at least I think it's ES6) and I noticed that the following is formatted, in my opinion, wrongly:

import {
Controller as UploadController,
State as UploadState
} from './controllers/upload';

should be:

import {
Controller as UploadController,
State as UploadState
} from './controllers/upload';

Issue 2:
export{x,y as yy,z}from "foo"

Should be fixed to

export { x, y as yy, z } from "foo"

Similarly,

import{x,y as yy,z}from "foo"

Should be fixed to

import { x, y as yy, z } from "foo"