WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Q
A

Bug report?
yes

Feature request?
no

BC Break report?
no

RFC?
no

Symfony version
3.2.6

According to the documentation the default value of the empty_data option to \Symfony\Component\Form\Extension\Core\Type\TextType is the empty string '':

empty_data¶

type: mixed

The default value is '' (the empty string).

But I found when using 3.2.6, that the default of empty_data is actually null.

I’m not sure if or where in the code this is actually defined, so I could not check against it.

Issue 2:
Q
A

Bug report?
yes

Feature request?
no

BC Break report?
no

RFC?
no

Symfony version
master (likely 3.x and 2.x as well)

Consider a basic data class:

class MyClass
{
private $value = '';

public function setValue(string $value)
{
$this->value = $value;
}

public function getValue(): string
{
return $this->value;
}
}

Map a basic form with the field optional:

$form = $this->createFormBuilder(new MyClass())
->add('value', TextareaType::class, [
'required' => false,
])
->add('create', SubmitType::class)
->getForm();
// etc.

Submit the form with the field empty and we get an InvalidArgumentException:

Expected argument of type "string", "NULL" given

in vendor/symfony/symfony/src/Symfony/Component/PropertyAccess/PropertyAccessor.php at line 275

As the value itself is empty, the Form sets its $modelData to NULL, while $normData and $viewData are correctly the empty string. PropertyPathMapper::mapFormsToData subsequently attempts to set the property to null, which would have been fine if not for the type hinting in the setter, causing the exception.

edit: if I remove the type hint from the setter I then get a Doctrine error as the field itself is mandatory yet NULL was inserted. I most definitely want users to be able to have the empty string in there, not null. So this is in the Form component, not the PropertyAccess end doing as it's told.
Issue 1:
Bug Report

Current Behavior

babel-core doesn't list which plugins/presets are duplicated:

Duplicate plugin/preset detected.
If you'd like to use two separate instances of a plugin,
they need separate names, e.g.

plugins: [
['some-plugin', {}],
['some-plugin', {}, 'some unique name'],
]

at assertNoDuplicates (node_modules/@babel/core/lib/config/config-descriptors.js:205:13)
at createDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:114:3)
at createPluginDescriptors (node_modules/@babel/core/lib/config/config-descriptors.js:105:10)
at alias (node_modules/@babel/core/lib/config/config-descriptors.js:63:49)
at cachedFunction (node_modules/@babel/core/lib/config/caching.js:33:19)
at plugins.plugins (node_modules/@babel/core/lib/config/config-descriptors.js:28:77)
at mergeChainOpts (node_modules/@babel/core/lib/config/config-chain.js:319:26)
at node_modules/@babel/core/lib/config/config-chain.js:283:7
at buildRootChain (node_modules/@babel/core/lib/config/config-chain.js:68:29)
at loadPrivatePartialConfig (node_modules/@babel/core/lib/config/partial.js:85:55)

Expected behavior/code

A list of duplicate plugins/presets so that you know which ones to remove or rename.

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

"babel": {
"plugins": [
"@babel/plugin-proposal-class-properties",
"@babel/plugin-syntax-dynamic-import",
"@babel/plugin-transform-runtime",
"babel-plugin-istanbul",
"babel-plugin-styled-components",
"syntax-export-extensions"
],
"presets": [
["@babel/preset-env", {
"debug": true
}],
["@babel/preset-react", { "debug": true }]
]
},

Environment

Babel version(s): 7.4.0

Node/npm version: Node 10/npm 6

OS: macOS 10.14.3

Issue 2:
Bug report

Input Code

The following will build without error in Babel:

const fn = () => {
if (x) return x
let x = true
}

fn() // ReferenceError: x is not defined

However, when ES6 transform is applied, the let declaration transpiles into a var, which is hoisted and run without error

var fn = function fn() {
if (x) return;
var x = true;
};

fn(); // OK

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

{
"presets": [
["babel-preset-env", {
"targets": {
"browsers": ["last 2 Chrome versions"],
"uglify": true
}
}]
]
}

Expected Behavior

I would expect Babel to warn me that my un-transpiled code would have caused an error, but the transpiled code prevents that error.

Current Behavior

I can introduce a bug in my code without realizing it, because the transpiled version fixes said bug.

Possible Solution

Context

I actually removed the uglify option from my Babel configuration because I did not want to transpile everything into ES5 syntax. Suddenly, I was getting a ReferenceError in my code that previously worked fine.

Your Environment

software
version(s)

Babel
6.26.0

Babylon

node
8.11.1

npm
5.6.0

Operating System
High Sierra
Issue 1:
Component declaration should contain a whitelist of properties, e.g. it could require that you list the property name under propTypes even if it is assigned null (that could mean "any type", a broader version of React.PropTypes.node).

If a property that is not defined in propTypes is passed to a component declaration an error must be raised.

This would provide several benefits:

Would help to catch TYPOs

Would promote type declaration

Would prevent orphan properties

Catching Typos

Suppose a component that generates a different type of input depending on a type value. This component has a default type value "text".

var Input = React.createClass({
getDefaultProps: function () {
return {
type: 'text'
}
},
render: function () {
// Different logic defending on the type name.
// this.props.type === 'text'

return <div />;
}
});

If Input instance declaration is defined with a typo in the type property, it would not be an obvious error.

<Input tupe='password' />

Raising an error "Unknown property 'tupe'." would help to catch the error.

Promoting Type Declaration

If property names are required to be listed under propTypes, it requires little extra effort to define their types.

var Input = React.createClass({
propTypes: {
type: React.PropTypes.string,
// type: null
},
render: function () {
return <div />;
}
});

Furthermore, we are used to think about code-length in terms of the lines of code. The fact that type declaration at the moment adds extra lines might be discouraging some developers from doing it. This thought is only to boost the importance of the earlier argument.

Preventing Orphan Properties

This is especially relevant when using spread operator inheritance.

Suppose an instance of a simple (Input) component is declared using a spread operator.

<Input {...generalFormProps} name='foo' />

, where generalFormProps is an object containing many properties of which just some apply to Input component. In this scenario, each Input instance would have a copy of those property values (dead weight).

Issue 2:
It would be great if in debug mode react would warn you when you pass in a property on props which is not specified in the propTypes object for that component. i.e. a way to enforce that props should ONLY have the props specified in propTypes and no others.

This would prevent use of undocumented properties and also allow better code maintenance as unused props would be more easily removed.
Issue 1:
interface A {
foo: Function;
}

class B implements A {
constructor() {
this.foo = () => {};
}
}

Here TypeScript says that B incorrectly implements A and requires B to also have foo property with the same signature. So question is: why I need duplicate definition of properties when implement interface if I cannot override that definition anyway:

interface A {
foo: Function;
}

class B implements A {
foo: boolean;
constructor() {
this.foo = true;
}
}

Here B again incorrectly implements A. Only way to fix it is to add foo:Function to B which absolutely has no point since A already has that.

Issue 2:
http://typescript.codeplex.com/workitem/1125

Following should be allowed:

interface IFoo {
foo();
}

declare class Foo implements IFoo {}

If abstract classes are added in the future, they would inherit all interface methods as abstract (like in Java).
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Current Behavior

On mobile Chrome and Safari, tested iOS 11.2.5, when inputting text in an Input field featuring an InputAdornment, there is a strange behavior where extra space is added below text. See attached screen shot.

Your Environment

"material-ui": "^1.0.0-beta.31",
"material-ui-icons": "^1.0.0-beta.17",
"react": "^16.2.0",
"react-dom": "^16.2.0",
"react-scripts": "1.0.17"

Issue 2:
If you want to explain a Select field's MenuItems via a tooltip, the onChange will no longer work.

[ x] I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Select a new value, state is updated

Current Behavior

Crash. Event target is the tooltip, not the MenuItem, and thus there is no target value

Steps to Reproduce (for bugs)

<FormControl>
<InputLabel htmlFor='activity-level'>Activity Level</InputLabel>
<SelectField
input={<Input name="sort" id='activity-level' />}
onChange={this.handleFormChange('activityLevel')}
value={this.state.activityLevel}
>
<Tooltip id="tooltip-sedentary" title="Little or no exercise" placement="right">
<MenuItem value={'sedentary'} >Sedentary</MenuItem>
</Tooltip>
<Tooltip id="tooltip-light" title="1-3/week" placement="right">
<MenuItem value={'light'} >Light</MenuItem>
</Tooltip>
</SelectField>
</FormControl>

handleFormChange(key) {
return (event) => {
debugger
let newState = {};
newState[key] = event.target.value;
this.setState(newState);
}
}

Your Environment

Tech
Version

Material-UI
1.0.0-beta.26

React
16.1.0
Issue 1:
When you have Input with type number and label, there is problem with browers that don't limit input of a string, and if you type in string label will stay over the text.

In Chrome u can only type letter "e" but in Mozzila u can whatever u want.

Current Behavior

Steps to Reproduce (for bugs)

Here you go https://codesandbox.io/s/olnmovn8xq

Environment

Tech
Version

Material-UI
1.0.0-beta.20

React
16.0.0

browser
Chrome 61.0.3163.91

Issue 2:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The label stays floated, if the user enters non numeric values to a TextField with type="number"

Current Behavior

The label stays not floated.

With only numeric values the label stays floated

Also there are some wierd characters if the TextField is empty:

Steps to Reproduce (for bugs)

create a TextField component and use it with type="number"

Context

Your Environment

Tech
Version

Material-UI
v1.0.0-beta.8

React
15.6.1

browser
Firefox 54.0
Issue 1:
ISSUE TYPE

Feature Idea

COMPONENT NAME

shell module

ANSIBLE VERSION

2.3

SUMMARY

From @lordbaco on 2015-05-22T09:32:33Z

Countless of times, I need to create two blocks of command or shell actions.

One to check the status of the system (and register it to an ansible variable) and

One to execute the command if really needed.

My idea is to add a check= option to both command and shell core modules

so you can combine both actions in one. This will make playbook/task shorter.

In bash, I like to do things like

test -f /etc/libvirt/qemu/autostart/test.xml || virsh autostart test

rsync --dry-run -av a/ b/ && rsync -av a/ b/

patch --dry-run -p1 -R < test.patch && patch -p1 -R < test.patch

grep -q 'test3' /root/file || perl -p -i -e 's/test2/test3/g' /root/file

grep -q 'test4' /root/file || perl -p -i -e '$_ = undef if(/test4/)' /root/file

To come back to Ansible this will translate to

command: rsync -av a/ b/ check="rsync --dry-run -av a/ b/"

when: check.rc == 0

command: virsh autostart test check="test -f /etc/libvirt/qemu/autostart/test.xml"

when: check.rc == 0

shell: patch -p1 -R < test.patch check="patch --dry-run -p1 -R < test.patch"

when: check.rc == 0

shell: perl -p -i -e 's/test2/test3/g' /root/file check="grep -q 'test3' /root/file"

when: check.rc != 0

shell: perl -p -i -e '$_ = undef if(/test4/)' /root/file check="grep -q 'test4' /root/file"

when: check.rc != 0

...

In certain cases, you need to do execute the command when the check= based

on more complex condition(s) so the idea is to use it in conjuction with

"when:" and evaluate check.rc, check.stdout, check.stderr to anything you want

-name: check if ssh host keys need to be regenerated

shell: rm -f /etc/ssh/ssh_host_* verify="cat /etc/ssh/ssh_host_rsa_key.pub"

when: check.stdout.find('root@template-') != -1

notify:

reconfigure ssh

tags: ssh

Copied from original issue: ansible/ansible-modules-core#1396

Issue 2:
ISSUE TYPE

Feature Idea

COMPONENT NAME

core

ANSIBLE VERSION

2.2

CONFIGURATION

OS / ENVIRONMENT

SUMMARY

Currently modules that do not support check mode (e.g. the command module) report that the "remote module does not support check mode", however if they use creates= or removes= Ansible could perform a check-mode, or at least evaluate whether it would not run.

STEPS TO REPRODUCE

EXPECTED RESULTS

ACTUAL RESULTS
Issue 1:
The following code snippets behave differently, is this working as intended?

Input Code

Unexpected behaviour:

var obj = { 2: 3, 4: 5 };
var {[2] : first, ...remaining} = obj
console.log('first', first)
console.log('remaining', remaining) //remaining contains first

This behaves as expected:

var obj = { 2: 3, 4: 5 };
var {"2" : first, ...remaining} = obj
console.log('first', first)
console.log('remaining', remaining)

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

{
"presets": [
[
"env",
{
"targets": {
"node": "current"
}
}
],
"stage-3"
]
}

Expected Behavior

I expect both code snippets to behave identically

My Environment

software
version(s)

babel-core
6.24.1

babel-plugin-transform-object-rest-spread
6.22.0

node
7.9.0

npm
n/a

yarn
0.23.4

Operating System
macOS Sierra 10.12.4 (16E195)

Issue 2:
Issue originally made by @vtambourine

Bug information

Babel version: 6.6.5

Node version: 5.7.0

npm version: 3.6.0

Options

{
"presets": [
"es2015",
"stage-1",
"react"
],
"plugins": [
"syntax-object-rest-spread"
]
}

Input code

const state = { foo: 'bar' };
const id = 3;

const newState = {
[id]: 'three',
...state
}

const {
[id]: omit,
...nextState
} = newState;

Description

Consider following example:

const state = { foo: 'bar' };
const id = 3;

const newState = {
[id]: 'three', // A
...state
}

const {
[id]: omit, // B
...nextState
} = newState;

While using object rest spread syntax to immutably remove a property from object (it is useful in Redux reducers), I cannot use same variable as I used to set this property.

Here, I expect nextState to be { foo: 'bar' }, but I get it { '3': 'three', foo: 'bar' }.

However, if I manually convert to string property, I will have expected results.

const {
[id.toString()]: omit,
...nextState
} = newState;

Now nextState is { '3': 'three', foo: 'bar' }.

Here is an example: http://www.es6fiddle.net/im23ggzk/
Issue 1:
For text drawing on canvas, a fairly simple construction can be used:

void drawName(Canvas context, String name, double x, double y)
{
TextSpan span = new TextSpan(
style: new TextStyle(color: Colors.blue[800], fontSize: 24.0,
fontFamily: 'Roboto'), text: name);
TextPainter tp = new TextPainter(
text: span, textAlign: TextAlign.left, textDirection: TextDirection.ltr);
tp.layout();
tp.paint(context, new Offset(x, y));
}

Is it possible to draw text at an angle, for example 45 degrees, or 90 degrees (vertically from the bottom up)?

Issue 2:
There is some properties in Html ,like below:

/* Keyword values */

writing-mode: horizontal-tb;

writing-mode: vertical-rl;

writing-mode: vertical-lr;

/* Global values */

writing-mode: inherit;

writing-mode: initial;

writing-mode: unset;

Does Flutter support i?
Issue 1:
Is there any way that i write some text in some files and dont save those files and close the editor when i open the editor again it should auto open those files like notepad++ does.

Issue 2:
A very handy feature in Notepad++: one can just open a new editing tab, or multiple ones, cut and paste stuff, or scribble a few notes.

Upon closing the application or shutting down the computer, instead of the usual "Do you want to save/not save/cancel" (as vsCode does), all those unsaved and unnamed files are simply saved to a temp location by the app, and restored in the same state upon next start.

Rgds
Issue 1:
React version: 16

Steps To Reproduce

Open the codepen demo.

Focus the outside div by clicking the black area

Focus inner yellow div by either pressing arrow keys or clicking or tab

The current behavior

When using arrow keys to change focus, render is called once only.

When using click or tab to change focus, render is called twice.

The expected behavior

render should be called the same times under 2 scenarios.

Issue 2:
React version: 0.0.0-experimental-4c8c98ab9 with concurrent mode.

Steps To Reproduce

In the provided code sandbox, click on a Todo component

Tab back and forth between the two

At inconsistent times, there will be a frame where the focus hasn't left, but the outline isn't rendered. The outline is only drawn when focus is in. Because there is a brief frame without the border, the todo visibly flickers.

Link to code example:

https://codesandbox.io/s/samc-focus-demo-9jyso?file=/package.json:201-229

Video; https://drive.google.com/file/d/18PW8M_VvE3Nau7NkdQq4X8En_Vcen_xQ/view?usp=sharing

Focus shifts multiple times at the beginning, without a flicker.

Around the 6 seconds mark, there is a flicker.

Photo of the frame;

The current behavior

At times there is an 'impossible' frame, where the focus has been set to false, despite the focus just having shifted from one element to another within the same div.

The expected behavior

I'm not sure if this pattern is something that is concurrent mode incompatible or something...

But regardless, I'd expect the behaviour to be consistent - eg for focus and blur events to be combined into a single frame.

This codepen shows the expected outcome with vanila JS https://codepen.io/samcooke98/pen/OJMaXvx

Related?

#19385
Issue 1:
Replicating example

In [1]: df = pd.DataFrame([[1,2],[3,4]],columns=pd.CategoricalIndex(list('AB')))

In [2]: df.describe()
AttributeError: 'DataFrame' object has no attribute 'value_counts'

The behaviour in this notebook seems like a bug to me. This is pandas 0.17.0.

In it, g and gcat are the results of two df.groupby(['medium', 'artist']).count().unstack() operations. The only difference is that one of those operations is on df where one of the columns that the groupby operates over has been converted to Categorical.

g and gcat behave very differently. I've tried to pin this down to the exact operation in the split-apply-combine that causes the problem without much luck.

Slicing a column out of g returns a Series as expected, while slicing a column out of gcat returns a DataFrame (see cells 4 and 5).

g.describe() works as expected, but gcat.describe() raises the exception

AttributeError: 'DataFrame' object has no attribute 'value_counts'

and g['painting'] + g['sculpture'] works as expected but g['painting'] + g['sculpture'] raises

Exception: Data must be 1-dimensional

Issue 2:
Hard to reprod.

Select from a duplicate indexed axis in a frame with ix where part of the

selection set is missing

In [22]: df = DataFrame(np.random.randn(5,5),columns=['A.1','B.1','B.2','B.3','A.2'],index=date_range('20130101',periods=5))

In [23]: df2 = df.rename(columns=lambda x: x.split('.')[0])

In [24]: df2
Out[24]:
A B B B A
2013-01-01 -1.029245 -0.782139 0.584956 1.097301 -0.150675
2013-01-02 -0.723246 -0.356150 -0.441952 0.027012 -1.851583
2013-01-03 -1.001412 0.129464 0.093433 0.952615 -1.338390
2013-01-04 0.165987 0.227918 0.557940 -0.102501 -1.194053
2013-01-05 0.249493 -1.102096 -0.977755 -0.529540 0.783277

[5 rows x 5 columns]

In [25]: df2.ix[:,['A','B','C']]

AssertionError: Number of manager items must equal union of block items
# manager items: 6, # tot_items: 14
Issue 1:
The HeroDetailComponent (code not shown) presents facts about a particular hero, the hero that the user selects from the list presented by the the HeroListComponent. The HeroDetailComponent is a child of the the HeroListComponent.

Search for the two 'the the' in the text.

Issue 2:
After upgrading to 2.2.0 ( and router 3.2.0) I am getting a runtime error on navigation with queryParams.

EXCEPTION: Cannot read property 'appendChild' of null

The weird thing is that the error does not occur while in development mode, nor does the AoT compiler throw any error.

Angular: 2.2.0

Angular router: 3.2.0

Example:

router.navigate( [ 'home'], { queryParams: { test: 'test' }})

Anyone got this error as well?

Angular 2.1.2 works fine with precisely the same code.

// Update

So I tried only to update Angular to 2.2.0 and keep Angular-Router on 3.1.2, and the issue remains.
Issue 1:
Original ticket http://projects.scipy.org/numpy/ticket/1208 on 2009-08-26 by @stefanv, assigned to unknown.

Considering

x = np.array([np.array(3+1j), np.array(4+1j)], dtype=object)

both

In [4]: x.real
Out[4]: array([(3+1j), (4+1j)], dtype=object)

and

In [6]: np.real(x)
Out[6]: array([(3+1j), (4+1j)], dtype=object)

does nothing, so that you have to do

In [8]: [np.real(e) for e in x]
Out[8]: [array(3.0), array(4.0)]

or [e.real for e in x].

We should check for the real method of e.

Issue 2:
Original ticket http://projects.scipy.org/numpy/ticket/1142 on 2009-06-19 by @inducer, assigned to unknown.

numpy could really do a better job here by propagating the .real to the elements of the object array:

Python 2.5.4 (r254:67916, Feb 18 2009, 03:00:47)
[GCC 4.3.3] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import numpy as n
>>> n.__version__
'1.3.0'
>>> a = n.array(5+7j)
>>> b = n.array([a], dtype=object)
>>> b.real
array([(5+7j)], dtype=object)
>>> n.real(b)
array([(5+7j)], dtype=object)

Summary by @seberg:

Object arrays could call .real on all objects, but that would not return a view as typically promised by arr.real. It seems that moving forward here may require a new function that returns a copy?