WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
TypeScript Version:

1.8.2

Background:

I have been working on trying to get https://github.com/eslint/typescript-eslint-parser, a TypeScript parser plugin for ESLint, off the ground, and the job this weekend has been to begin adding JSX support.

ESLint uses espree and so the aim of the project is to convert the output of the tsc to an AST which espree expects. We already have a solid suite of JSX tests to develop against (taken from the espree project itself), but I have come up against a tsc error in one of them so far.

My issue is that it seems currently the tsc does not accept this "embedded-tags" JSX syntax:

Code

<LeftRight left=<a /> right=<b>monkeys /> gorillas</b> />;

Expected behavior:

Please note the AST produced by espree (see in particular the tokens array): http://astexplorer.net/#/9WAjizSvbC

Actual behavior:

...compared to the one produced by the tsc (note the issues found in parseDiagnostics):

http://astexplorer.net/#/YehKzLJYMW

Issue 2:
Since it's very unlikely that the extension methods will ever be implemented in a call-site-rewrite manner, please consider adding infix operators to enable writing in functional style similarly to what can be done in Haskell:

Monoids

function '+'<a>(left: a[], right: a[]) : a[] {
return left.concat(right);
}

[1, 2, 3] '+' [4, 5]; // [1, 2, 3, 4, 5]

Monads

function '>>='<a, b>(promise: Promise<a>, bind: (value: a) => Promise<b>) : Promise<b> {
return promise.then(bind);
}
$.get('/get') '>>=' x => $.post('/save', x + 1)

Functors

function '.'<a, b, c>(inner: (value: a) => b, outer: (value: b) => c) : (value: a) => c {
return function(value: a) : c {
return outer(inner(value))
}
}

function f(x: X) : Y { }
function g(y: Y) : Z { }
(f '.' g)(x); // z
Issue 1:
Environment

Windows build number: Microsoft Windows [Version 10.0.18362.267]
Windows Terminal version (if applicable): 0.3.2142.0
WSL 1 with Ubuntu 18.04

Steps to reproduce

Open terminal with WSL Ubuntu

Display something on stdout (e.g. echo Hello world!)

Run clear -x or Ctrl+L

Expected behavior

Move promt to top of the screen and put what is currently dispalyed on the screen in the scrollback. This is how the old console functioned.

Actual behavior

Moves promt to top of the screen, and clears what is currently displayed on the screen without putting it in the scrollback

Issue 2:
Environment

Windows build number: 10.0.18362.0
Windows Terminal version (if applicable): 0.5.2681.0

Steps to reproduce

I imagine this is similar to #633, except it seems like my arrows are rendering too far to the left (and/or too small), rather than having a gap. See:

I'm using a Menlo for Powerline patched font - with a powershell prompt generated by this. For comparison, here's the same prompt in vscode's integrated terminal:

With visible colors:

Expected behavior

Arrows in the powerline font rendered in full size, aligned with the center of the line.

Actual behavior

Powerline arrows are rendered at an incorrect size/location - the branch name text is also similarly reduced, it seems.
Issue 1:
Introduction

Currently, type literals are capable of representing any instantiated (non-generic) type except those that are recursive. This is because, as an anonymous type, they do not have a name with which to create this type.

This proposal covers recursive type literals. These type literals add the additional ability of the literal referring to itself. This has one main advantage: emitting .d.ts files for expressions typed by class expressions now have a "flattened" representations. As class expressions could easily have recursive components, we'd like to be able to emit a corresponding type representation into the .d.ts file without contaminating the namespace with additional fresh type names.

Design

var x : <Node> { next: Node; value: number; };

The above acts similarly to this example:

interface Node { next: Node; value: number; };
var x : Node;

with one critical exception: in the first example the 'Node' name is not visible outside of the type literal.

Typechecking

Typechecking of recursive type literals works just as recursive interfaces, with the exception (as mentioned above) that the name given to the recursive type literal is not visible in the lexical scope outside of the type literal. Otherwise, these expand and are compared for equality structurally just as interfaces.

Differences with other designs

This design differs from similar designs, named the 'self' type design where there is a specific keywords that the type can refer to its self. This proposal is strictly more expressive, albeit at the cost of some additional syntax. For example, embedded recursive types are possible:

var x: <Node> { up: <Parent>{ up: Parent; node: Node}; next: Node; value: number};

Issue 2:
Using the allowJs compiler option, if buffer or send are dependencies, Duplicate identifier errors are reported:

node_modules/buffer/index.js(94,5): error TS2300: Duplicate identifier 'length'.
node_modules/buffer/index.js(95,5): error TS2300: Duplicate identifier 'parent'.
node_modules/buffer/index.js(229,20): error TS2300: Duplicate identifier 'length'.
node_modules/buffer/index.js(230,20): error TS2300: Duplicate identifier 'parent'.
node_modules/send/index.js(203,22): error TS2300: Duplicate identifier 'root'.
node_modules/send/index.js(212,22): error TS2300: Duplicate identifier 'root'.

It seems similar to #6645, but here in addition to this member assignment, prototypes are in play.
Issue 1:
Challenge Local Scope and Functions has an issue.

User Agent is: Mozilla/5.0 (Windows NT 6.1; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.87 Safari/537.36.

Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function myFunction() {
'use strict';
var myVar = "";

console.log(myVar);
}
myFunction();

// run and check the console
// myVar is not defined outside of myFunction
console.log(myVar);

// now remove the console log line to pass the test

Issue 2:
Challenge Local Scope and Functions has an issue.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.111 Safari/537.36.

Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function myFunction() {
'use strict';

var myVar = "test";
console.log(myVar);
}
myFunction();

// run and check the console
// myVar is not defined outside of myFunction
console.log(myVar);

// now remove the console log line to pass the test

href="http://content.screencast.com/users/Pisstt/folders/Default/media/d1d59d3a-6ca0-493b-9910-3c421028f88b/2016-01-17_1925.png">
Issue 1:
Challenge Smallest Common Multiple has an issue.

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.108 Safari/537.36.

Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

//noprotect
function smallestCommons(arr) {
for (var j=Math.max(...arr)+1;;){
for (var i=2; i<=Math.max(...arr);){
if (j%i!==0) {j++; i=2; }
else {i++;}
}
console.log(j);
return j;
}
}

Without //noprotect, the loop breaks early. I think this challenge should have a longer timeout, or at least a smaller test value than 13.

Issue 2:
Challenge Smallest Common Multiple has an issue.

User Agent is: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.109 Safari/537.36.

I keep receiving this error: "SyntaxError: Illegal break statement." That doesn't make any sense, because my code isn't using a break statement anywhere, even in my for loop. The code works and passes all test cases when I log the output in the console. Am I missing something?

My code:

/* This was a tough one for me.
Let's use the Euclidean Algorithm to first get the GCD and
then use that to calculate the LCM
This below function for obtaining the gcd was posted on StackOverflow by "alex" at
https://stackoverflow.com/questions/17445231/js-how-to-find-the-greatest-common-divisor/.
*/
function gcd(a, b) {
if (!b) {
return a;
}
return gcd(b, a % b);
}

function smallestCommons(arr) {
var newArr = []; /*Will hold the range of numbers from arr[0] to arr[1].*/

arr.sort(function(val1, val2) { /*Order the array from least to greatest.*/
return val1 - val2;
});

for (var i = arr[0]; i <= arr[1]; i++) { /*Create the full range of values under consideration.*/
newArr.push(i);
}

/*Formula to use is LCM(a,b) = a * b / GCD(a, b).
Reduce array by recursively applying the formula to
the first two values until there is only one value left.*/
return newArr.reduce(function(a, b) {
return (a * b) / (gcd(a, b));
});
}

smallestCommons([1, 5]);
Issue 1:
Playwright version

1.13.0

Operating system

MacOS, Linux

What browsers are you seeing the problem on?

Chromium

Other information

No response

What happened? / Describe the bug

When executing "sanitizeForFilePath", the return value may be the same.

This has caused the screenshot to be overwritten.

I want adjustment the regular expression condition or make it a unique value so that it will not be overwritten.

playwright/src/test/workerRunner.ts

Lines 566 to 568
in
b1dc84c

function sanitizeForFilePath(s: string) {

return s.replace(/[^\w\d]+/g, '-');

}

Code snippet to reproduce your bug

// failtest.spec.ts
import { test, expect } from '@playwright/test';

test('基本的なテスト', async ({ page }) => {
await page.goto('https://playwright.dev/');
const name = await page.innerText('.navbar__title');
expect(name).toBe('Playwright!');
});

test('実験的なテスト', async ({ page }) => {
await page.goto('https://playwright.dev/');
const name = await page.innerText('.navbar__title');
expect(name).toBe('Playwright!!');
});

// playwright.config.ts
import { PlaywrightTestConfig } from '@playwright/test';
const config: PlaywrightTestConfig = {
use: {
screenshot: 'only-on-failure',
},
};
export default config;

Relevant log output

No response

Issue 2:
Feature request

Hi,

Currently Playwright-test's generated test output directory name is including the test's title, but it can only includes alphanumeric values, all non-ASCII character will be replaced with a hyphen -.

My tests title is in Japanese so it would be nice if it can include non-ASCII character in the output folder.
Issue 1:
I am using v0.1.2-3757-g063ac5b on ArchLinux and ~/.julia is empty. I get the following error when updating :

julia> Pkg.update()

INFO: Initializing package repository /home/stef/.julia.

INFO: Cloning METADATA from git://github.com/JuliaLang/METADATA.jl

ERROR: gitenv not defined

in cmd at git.jl:17

in run at git.jl:18

in set_remote_url at git.jl:83

in anonymous at no file:45

in cd at file.jl:25

in cd at pkg/dir.jl:30

in init at pkg/dir.jl:42

in cd at pkg/dir.jl:27

in update at pkg.jl:173

Issue 2:
Working with @edmondztt, I was try to get IJulia running on his Windows 8 laptop, and we immediately ran into a problem with the latest 64-bit Julia binary: running Pkg.update() gives

ERROR: could not start process `rm -rf 'C:\Users\Edmond\AppData\Roaming\Julia\packages'`: no such file or directory (ENOENT)

in init at pkg/dir.jl:49.

It looks like Julia is trying to run rm, which doesn't exist on Windows. Am I missing something? cc: @vtjnash, @StefanKarpinski, @staticfloat
Issue 1:
Description of the problem

Hello ! This is my first post on this Github, and first, I realy want to congratulate mrdoob and all of contributors for this awesome project.

This isnt an real issue, because i found a way to do what i wanted.

So the problem is that TextureLoader and more precisely ImageLoader doesnt allow to add custom headers to get an image from an url. I needed to add headers because in my application, i get all textures from an api that authenticate users on each request with a JWT Token.

To succeed I decided to change TextureLoader and ImageLoader load function this way :

/**
* @author mrdoob / http://mrdoob.com/
*/

function ImageLoader( manager ) {

this.manager = ( manager !== undefined ) ? manager : DefaultLoadingManager;

}

Object.assign( ImageLoader.prototype, {

load: function ( url, onLoad, onProgress, onError, customHeaders ) {
console.log(url, 'TEST LOAD');

if ( url === undefined ) url = '';

if ( this.path !== undefined ) url = this.path + url;

var scope = this;

var cached = Cache.get( url );

if ( cached !== undefined ) {

scope.manager.itemStart( url );

setTimeout( function () {

if ( onLoad ) onLoad( cached );

scope.manager.itemEnd( url );

}, 0 );

return cached;

}

var image = document.createElementNS( 'http://www.w3.org/1999/xhtml', 'img' );

image.addEventListener( 'load', function () {

Cache.add( url, this );

if ( onLoad ) onLoad( this );

scope.manager.itemEnd( url );

}, false );

// image.addEventListener( 'progress', function ( event ) {

//	if ( onProgress ) onProgress( event );

// }, false );

image.addEventListener( 'error', function ( event ) {

if ( onError ) onError( event );

scope.manager.itemEnd( url );
scope.manager.itemError( url );

}, false );

if ( url.substr( 0, 5 ) !== 'data:' ) {

if ( this.crossOrigin !== undefined ) image.crossOrigin = this.crossOrigin;

}

scope.manager.itemStart( url );
console.log(customHeaders);
const options = {
headers: customHeaders
};

fetch(url, options)
.then(res => res.blob())
.then(blob => {
image.src = URL.createObjectURL(blob);
});

// image.src = url;

return image;

},

setCrossOrigin: function ( value ) {

this.crossOrigin = value;
return this;

},

setPath: function ( value ) {

this.path = value;
return this;

}

} );

Three.js version

Dev

r110

[x ] old version

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

macOS

Linux

Android

iOS

Hardware Requirements (graphics card, VR Device, ...)

Issue 2:
Hi, this is my first post so first I want to thank mrdoob and all the contributors for this fantastic library.

Description of the problem

I need to send specific headers with my TextureLoader request (XMLHttpRequest.setRequestHeader()) but I do not see any way to do that (I'm currently using r80).

Three.js version

r80

...

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

Linux

Android

IOS

Hardware Requirements (graphics card, VR Device, ...)
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Please visit https://codesandbox.io/s/325y47xk36 for a code sample. It's a basic implementation of a menu using https://react.semantic-ui.com.

It creates a meta viewport as can be seen in the source code the rendered page: <meta name="viewport" content="width=device-width,initial-scale=1">

The above fix was released in semantic-ui-react v 0.76.0.

Current Behavior

<meta name="viewport" content="width=device-width,initial-scale=1"> is not present.

Steps to Reproduce (for bugs)

Clone example with-semantic-ui

Upgrade "semantic-ui-react": "^0.76.0" in package.json

npm install

npm run dev

Context

meta viewport being added by semantic-react-ui gives the responsive character to a lot of elements. Without this, any semantic app using semantic-ui-react and next.js, we are missing responsiveness.

Your Environment

Tech
Version

node
8.9.0

OS
Mac

browser
Chrome-latest

etc

Npm packages:

+-- next@4.1.4
+-- react@16.1.1
+-- react-dom@16.1.1
`-- semantic-ui-react@0.76.0```

Issue 2:
I have just heard about next.js so I wanted to give it a try, however as I ran npm run dev I get Internal Server Error on localhost:3000 and in console GET http://localhost:3000/ 500 (Internal Server Error)

Same results using zeit/nextgram

I have checked Next.js Issues and while my issue seems like a duplicate, there was no solution.

Followed everything as in Readme, used Powershell, Git bash, results are always the same.

Error text

{ Error: Cannot find module D:\path\.next\dist\pages\_error at _callee$ (D\path\node_modules\next\dist\server\resolve.j s:220:19) at tryCatch (D:\path\node_modules\regenerator-runtime\runtim e.js:65:40) at Generator.invoke [as _invoke] (D:\path\node_modules\regen erator-runtime\runtime.js:303:22) at Generator.prototype.(anonymous function) [as next] (D:\DEV\ up\node_modules\regenerator-runtime\runtime.js:117:21) at step (D:\path\node_modules\babel-runtime\helpers\asyncToG enerator.js:17:30) at D:\\path\node_modules\babel-runtime\helpers\asyncToGenerat or.js:28:13 code: 'ENOENT' }

Tech
Version

next
3.2.1

node
7.5.0

npm
4.1.2

OS
Windows 10
Issue 1:
TypeScript Version:

1.8.10

Code

new RegExp(/a/, "g");

Expected behavior:

That code should be accepted by typescript

Actual behavior:

Argument of type 'RegExp' is not assignable to parameter of type 'string'.

Issue 2:
TypeScript Version:

1.9.0-dev.20160522-1.0

Code

Here's what I want to do:

import {isEmail} from 'marker.validators'

Expected behavior:

For it to just work

Actual behavior:

Submodules don't work that way

So currently I do this:

import {validators} from 'marker';

validators.isEmail('foo@bar.com');
// I want the `isEmail` symbol, without having to `const isEmail = validators.isEmail`

marker.d.ts

declare var marker: marker.marker;

declare module marker {
export interface marker {
validators: IValidators;
}

export interface IValidators {
isEmail(input: string): boolean;
}
}

export = marker;

index.ts

import * as vs from './validators'

export const validators = vs;

validators.ts

export function isEmail(input: string): boolean { return true }

How am I meant to do this, e.g.: namespaces?

BTW: Asked on StackOverlfow also
Issue 1:
Do you want to request a feature or report a bug?

I believe there is a bug in React 16.4 regarding the getDerivedStateFromProps.

What is the current behavior?

Trying to set the state based on the props kind of overrides the state forever, which makes it impossible to edit it later on.

If the current behavior is a bug, please provide the steps to reproduce and if possible a minimal demo of the problem. Your bug will get fixed much faster if we can run your code and it doesn't have dependencies other than React. Paste the link to your JSFiddle (https://jsfiddle.net/Luktwrdm/) or CodeSandbox (https://codesandbox.io/s/new) example below:

Example is as follows: http://jsbin.com/yawasoz/1/edit?html,js,output

Add some item, click on it, try to edit it.

What is the expected behavior?

To work like this (React 16.3): http://jsbin.com/luzimujiwi/1/edit?html,js,output

Which versions of React, and which browser / OS are affected by this issue? Did this work in previous versions of React?

I think this happens only in React 16.4, 16.3 seems to work fine (same code, different React version): http://jsbin.com/luzimujiwi/1/edit?html,js,output

Issue 2:
According to semver, only non-breaking changes are supposed to go into minor and patch version releases. With the release of 16.4, you have made breaking changes to getDerivedStateFromProps. Our entire codebase, running perfectly on 16.3.2 is a dumpster fire as soon as we raise that dependency to 16.4.

The only thing in your CHANGELOG about this breaking change is:

Properly call getDerivedStateFromProps() regardless of the reason for re-rendering. (@acdlite in #12600 and #12802)

Please revert this change and save it for 17.0.0, or provide proper documentation to what this change actually entails so that its use can be adjusted by those who have already implemented getDerivedStateFromProps.
Issue 1:
Code Sample, a copy-pastable example if possible

from pandas.compat import StringIO
import pandas as pd

t1 = """float
1
"""
t2 = """float
NaN
"""

for t in t1, t2:
df = pd.read_csv(StringIO(t), dtype={'float': 'str'})
print(type(df['float'][0]))

Problem description

Even when explicitly specifying dtype above, read_csv still converts values in the float column to a float when the string is "NaN". This behavior appears to be limited to "NaN" as it doesn't happen for regular numbers. Still, I unexpectedly ran across a "NaN" string in my application so it's blocking me.

Issue 2:
From #10647 (comment)

In context of discussion on the default parsing of 'NA' in a csv file as NaN, I don't think we can change the default of parsing NA, but we may consider parsing of "NA" as a string instead of NaN:

Another change that we would maybe be more likely to consider, is the parsing of quoted values of NA (so only changing "NA" not be converted automatically, but leaving NA and alike converted to NaN as it is now).

Personally, I would even this consider as a bug that it treats "NA" and NA the same, as I would expect that quoted values should be left untouched. But I don't know how long this behaviour has been this way.

Although I am not sure how invasive such a change would be, and difficult to assess, so maybe this is not worth risking many breakages?
Issue 1:
I'm trying to setup something like this with Symfony 2.6.1:

$builder
->add('field', 'choice', [
'choices' => array_combine(range(0.1, 1.0, 0.1), range(0.1, 1.0, 0.1))
]);

and this is the mapping for Doctrine:

field:
type: decimal
precision: 2
scale: 1
options:
default: 1.0

The field never shows the value 1.0 as selected when it is (works fine for 0.1 => 0.9). I have tried converting all float values to string using number_format but doesn't work either.

I have also tried using http://symfony.com/doc/current/reference/forms/types/choice.html#choice-list, but taking the example on that page I get this:

<select>
<option value="0">Full</option>
<option value="1">Half</option>
</select>

as you can see, there's no float values here (shouldn't it be 1 => Full, 0.5 => Half?) Is this a bug with ChoiceList or the example is incorrect?

Thanks in advanced for any insight.

Issue 2:
Description

The idea of this feature lies on the following OWASP recommendation:

Define an appropriate request size limit and reject requests exceeding the limit with HTTP response status 413 Request Entity Too Large

After discussion with @dunglas about implementing this feature in the api-platform project, the subject of implementing it directly in Symfony has been brought.

In my opinion, this feature makes sense in, but is not limited to, a Rest API context, so it'd make sense to implement it in the Symfony HttpKernel component. However, one could argue that this is a security related feature that should live in the Security component.

The implementation would rely on a kernel.request event listener configured with a request content max size (defaulting to ini_get('post_max_size')). Comparison would then be performed against the Content-Length request header. Here's a gist showing how it could look like.

The fact is that it must be implemented smartly in order not to conflict with the existing handling of request size exceeding in the Symfony Form component.

This feature could be disabled by default, for example.

It could be enablable on a global scope, on a route scope, on a pattern scope, ... The choices are quite wide.

Unlike how it's made in the Symfony Form component, I believe it makes sense to perform this check no matter which HTTP method is used.

Finally, unless duplicating this logic in the component which would welcome this feature, we should think about how to extract it in a common package (maybe a new php-directive package which would perform ini_get calls and value normalizations).

Thank you for your time and sharing thoughts about this,

Regards.

Example

Enabling globaly

framework:
prevent_content_length_exceeding: true
max_content_length: 10M

Enabling on a route

routes:
index:
path: /
prevent_content_length_exceeding: true
max_content_length: 10M