WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Problem description

You call setState on a timeout in Popover.js however if the component is already unmounted react gives a warning

Steps to reproduce

Versions

Material-UI: 0.15.4

React: 15.3.1

Browser: Chrome

I've fixed this by setting a property on this in componentWillUnmount

might be a bit hacky see unMounted below

_createClass(Popover, [{
key: 'componentWillReceiveProps',
value: function componentWillReceiveProps(nextProps) {
var _this2 = this;

if (nextProps.open !== this.state.open) {
if (nextProps.open) {
this.anchorEl = nextProps.anchorEl || this.props.anchorEl;
this.setState({
open: true,
closing: false
});
} else {
if (nextProps.animated) {
this.setState({ closing: true });
this.timeout = setTimeout(function () {
if(!_this2.unMounted) {
_this2.setState({
open: false
});
}
}, 500);
} else {
this.setState({
open: false
});
}
}
}
}
}, {
key: 'componentDidUpdate',
value: function componentDidUpdate() {
this.setPlacement();
}
}, {
key: 'componentWillUnmount',
value: function componentWillUnmount() {
this.unMounted=true;
clearTimeout(this.timeout);
}
}

Issue 2:
Problem description

When props.animated is true, Popover calls setState from within a setTimeout.

// in componentWillReceiveProps
if (nextProps.animated) {
this.setState({ closing: true });
this.timeout = setTimeout(function () {
_this2.setState({
open: false
});
}, 500);
}

Because componentWillReceiveProps doesn't mean that props changed, Popover has the potential to call setState from within the setTimeout multiple times, when no props have changed. For me, this is consistently causing an error where setState is called on an unmounted component.

Steps to reproduce

Rapidly re-render Popover (animated=true) after having changed open to false.

Versions

Material-UI: 0.15.3

React: 15.3.0

Browser: Chrome Version 52.0.2743.116 (64-bit)
Issue 1:
Using the 'with-styled-components' example and upgrading styled-components to v2.1.0 results in the error: Unfortunately nesting is not supported by styled-jsx

Issue 2:
Is there currently a way to completely disable styled-jsx that's bundled with Next.js? If not, it would be great to have this option as currently it sometimes clashes with other CSS solutions by doing preprocessing of its own.

See #2304 and I've also been having issues with importing plain CSS through wrap-in-js.
Issue 1:
A Locator object apparently can be resolved to several elements, so can represent a list.

And there are some useful methods to use in this case (e.g. Locator.first() Locator.nth() etc).

Same time, If I need to iterate several locators, the only way I see (please correct me if I'm wrong) is to get the count first, and then take each new item by index from locator list manually:

let itemsCount = await this.pickLkistItem.count() // find the count
for (let index = 0; index < itemsCount; index++) {
let item = this.pickLkistItem.nth(index) //get the element by index within locator list
// . . . do what you need
}

And this looks really overwhelming.

If a locator can be a list, could we use the Iterable functions instead? E.g.:

for (const item of [this.pickLkistItem]) {
item // . . . do what you need
}

Or:

this.pickLkistItem.forEach(it => { arr.push(await it.textContent()) });
this.pickLkistItem.reduce((result, item) => { . . . }

I guess that the count of the locator items should be frozen at the point of the iterable function start, so if it increases, additional iterations are ignored. Otherwise, a 'missing element' error should be thrown if the count decreased

Or I'm missing something and this is already supported somehow?

Issue 2:
Hey Team,

I think the Locator feature is really great, but what I think it lacks is some kind of enumeration. There are evaluations and stuff like getting text from all elements, but that's only a limited use case. While it is possible for us to enumerate by ourselves, I think we could benefit much more from a built in enumerator instead of opting for a for loop. This would allow plugging into more useful features of supported languages for working with collections much easier.

It would then be possible to enumerate in:

Node.js

.NET

Python

and probably Java
Issue 1:
I found that the example code for the histogram2d has an issue when adapted. The code below works for a symmetric amount of bins. But if one changes the number of bins (e.g. removing a bin on line 655 xedges = [0, 1, 1.5, 3]) in only one dimensions, the example raises an exception:

TypeError: Axes don't match array shape

My understanding of this error: This is due to the fact that im.set_data(xcenters, ycenters, H) on line 696 is erroneous. The set_data functions behaves counter-intuitive and sets data in screen coordinates and not in plot coordinates, see theses lines in matplotlib. The fix for this is to invert the xedges, yedges order in the set_data call. With that adjustment the code works fine for an asymmetric number of bins. Although, I don't understand why the data is displayed correctly in the symmetric bin number case.

I am happy to fix this (by inverting the order), but am unsure about how to move on. Is it OK to just go along, fix it, and create a pull request? Can anyone guide me along?

numpy/numpy/lib/twodim_base.py

Lines 689 to 702
in
4092a9e

NonUniformImage displays exact bin edges with interpolation:

>>> ax = fig.add_subplot(133)

>>> ax.set_title('NonUniformImage: interpolated')

>>> im = mpl.image.NonUniformImage(ax, interpolation='bilinear')

>>> xcenters = xedges[:-1] + 0.5 * (xedges[1:] - xedges[:-1])

>>> ycenters = yedges[:-1] + 0.5 * (yedges[1:] - yedges[:-1])

>>> im.set_data(xcenters, ycenters, H)

>>> ax.images.append(im)

>>> ax.set_xlim(xedges[0], xedges[-1])

>>> ax.set_ylim(yedges[0], yedges[-1])

>>> ax.set_aspect('equal')

>>> plt.show()

Issue 2:
Hi all,

np.histogram2d online documentation gives an non-functioning example.

Documentation page:

http://docs.scipy.org/doc/numpy/reference/generated/numpy.histogram2d.html

Non-functioning example:

pcolormesh can display exact bin edges:
>>> ax = fig.add_subplot(132)
>>> ax.set_title('pcolormesh: exact bin edges')
>>> X, Y = np.meshgrid(xedges, yedges)
>>> ax.pcolormesh(X, Y, H)
>>> ax.set_aspect('equal')

Problem with example:

numpy.histogram2d returns an array H shaped (nx, ny).

numpy.meshgrid returns X, Y arrays shaped (ny, nx). [When called with the default Cartesian indexing]

Therefore, X,Y are incompatible with H for pcolormesh, which gives an error.

Proposed updated example (transpose H):

pcolormesh can display exact bin edges:
>>> ax = fig.add_subplot(132)
>>> ax.set_title('pcolormesh: exact bin edges')
>>> X, Y = np.meshgrid(xedges, yedges)
>>> ax.pcolormesh(X, Y, H.T)
>>> ax.set_aspect('equal')
Issue 1:
I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[x] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Let say we have this code:

@Component({
selector:'my-app',
template:`
<h2>Chess</h2>
<router-outlet [attr.name]="'a'"></router-outlet>
<router-outlet [attr.name]="'b'"></router-outlet>
<router-outlet *ngFor="let name of ['c', 'd']" [attr.name]="name"></router-outlet>
`
})
class Chess {}

It doesn't work and it is right. Attribute in router-outlet directive is like a 'const' modifier in typescript. You can set it only manually in a template.

But what if I develop application and set routes and outlets dynamically. How expensive it will be to allow router-outlet directive to be dynamic?

Issue 2:
I'm submitting a ... (check one with "x")

[ ] bug report => search github for a similar issue or PR before submitting
[X] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

<router-outlet name="outlet1"></router-outlet>
<router-outlet name="outlet2"></router-outlet>
<router-outlet name="outlet3"></router-outlet>

Expected behavior

<div *ngFor="let outlet of outletList">
<router-outlet [name]="outlet.name"></router-outlet>
</div>

where outletList = [list1, list2, list3];

where list1.name = 'outlet1';

list2.name = 'outlet2';

list3.name = 'outlet3';

Minimal reproduction of the problem with instructions

N/A

What is the motivation / use case for changing the behavior?

I am requesting a feature change of router-outlet's name type from @Attribute to @input property, so developers can bind a name dynamically to a router-outlet.

Currently, developers need to hard code a string for router-outlet's name attribute in the html template. If a developer needs to create multiple router outlets, he/she would need to create multiple router outlets and manually add the unique name to each router-outlet.

This would enable developers to develop cleaner code when they use multiple router-outlets.

Please tell us about your environment:

Angular version: 2.0.X

Angular 2.0.0

Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]

Chrome

Language: [all | TypeScript X.X | ES6/7 | ES5]

Typescript

Node (for AoT issues): node --version =

node 6.4.0
Issue 1:
I tried using the latest xxxx/xxxx.d.ts file in this repo and had problems.

I tried using the latest stable version of tsc. https://www.npmjs.com/package/typescript

I have a question that is inappropriate for StackOverflow. (Please ask any appropriate questions there).

I want to talk about xxxx/xxxx.d.ts.

The authors of that type definition are cc/ @....

The type definitions are causing TS2300/Duplicate identifier errors due to collision with ES6. Exact output is:

514 bold(): string;
~~~~

node_modules/typescript/lib/lib.es6.d.ts(514,5): error TS2300: Duplicate identifier 'bold'.

109 bold: string;
~~~~

typings/globals/colors/index.d.ts(109,5): error TS2300: Duplicate identifier 'bold'.

It appears that the tscparams file for this is preventing the error from appearing in the unit tests. According to the package's documentation, using the 'colors/safe' module would not override the string classes native methods and would do away with this error. But, as the definitions do not have this sub module, Typescript does not allow the import of 'colors/safe'.

Issue 2:
Hi,

Getting the below exception with npm package @types/request-promise-native version 1.0.12, issue is not reproducible for previous versions. Could anyone look into this asap.

node_modules/@types/request-promise-native/index.d.ts(20,49): error TS2694: Namespace 'request' has no exported member 'Response'.

node_modules/@types/request-promise-native/index.d.ts(24,33): error TS2694: Namespace 'request' has no exported member 'Response'.

Got the below code that is causing the error:

DefinitelyTyped/types/request-promise-native/index.d.ts

Line 20
in
a436740

transform?(body: any, response: request.Response, resolveWithFullResponse?: boolean): any;

Thanks.
Issue 1:
Environment

Windows build number: [run "ver" at a command prompt]
PowerToys version:
PowerToy module for which you are reporting the bug (if applicable):

Steps to reproduce

Go to Keyboard Manager then click remap a key.

Choose any key on left dropdown and try to select any of the two keys that look like underscore on right key dropdown

It gets mapped to hyphen in any case and not to underscore.

Expected behavior

Choose any key and map it to the underscore key.

Actual behavior

Screenshots

Issue 2:
Automatically switch display scaling when switching between desktop and tablet modes.

i.e. - desktop mode @ 150% scaling & tablet mode @ 200% scaling. Allow user to choose each custom scaling amount per their preference.
Issue 1:
In this demo http://getbootstrap.com/css/#forms-controls-static when changing the focus or value of the password field - chrome browser freezes for a few seconds and uses a lot of CPU.

Not sure if this is a problem of chrome itself or anything related to bootstrap JS / CSS

Chrome version 28.0.1500.95 m running on Windows 7 64 bit

Issue 2:
Chrome for Mac. Enter some text in the "Password" input box (see pictured).

Then delete the text, one character at a time. By the time you try to remove the last character, the tab freezes for a few seconds.
Issue 1:
Hi, developers,

When I used the StratifiedShuffleSplit or train_test_split with stratify option, I input the continuous variable. I thought the function will split the dataset into several subsets according to the continuous variable, and ensure the distribution of these subsets were the same.

However, I got the error 'The least populated class in y has only 1 member, which is too few'. According to this error, I guess the stratifed split in scikit-learn can only be used for classification problems.

So, with scikit-learn, how can I split the dataset into several subsets with the same distribution for a regression problem?

Have a good holiday.

Best wishses

Zaixu

Issue 2:
It is important to stratify the samples according to y for cross-validation in regression models; otherwise, you might possibly get totally different ranges of y in training and validation sets. However, current StratifiedKFold doesn't allow float:

$ x=sklearn.cross_validation.StratifiedKFold(np.random.random(9), 2)
/anaconda/envs/py3/lib/python3.4/site-packages/sklearn/cross_validation.py:417: Warning: The least populated class in y has only 1 members, which is too few. The minimum number of labels for any class cannot be less than n_folds=2.
% (min_labels, self.n_folds)), Warning)

$ list(x)
[(array([], dtype=int64), array([0, 1, 2, 3, 4, 5, 6, 7, 8])),
(array([0, 1, 2, 3, 4, 5, 6, 7, 8]), array([], dtype=int64))]

In case I may miss something, is there any reason why StratifiedKFold does not work properly for float?
Issue 1:
This behavior may be misleading since I would consider that 2.0e-12 means the 0 is significant, which isn't the case with the second command below.

julia> sprint(Base.Grisu._show, 2.45e-12, Base.Grisu.PRECISION, 2, true)
"2.4e-12"

julia> sprint(Base.Grisu._show, 2.45e-12, Base.Grisu.PRECISION, 1, true)
"2.0e-12"

On the other hand, @printf (which uses a different definition for the precision) returns:

julia> @printf("%.0e", 2.45e-12)
2e-12

I guess an argument in favor of Grisu's behavior is that one gets a standard representation where 2.0 is necessarily a float, i.e. it cannot be mistakenly parsed back as an integer before the parser finds out there's an exponent part. But float("2e-12") works, so that's apparently not a problem.

Issue 2:
The following code which doesn't seem ambiguous to me gives an ambiguity warning:

type A{T}; end
type B{T}; end

f{T}(::T, ::A{T}) = 1
f{T}(::B{T}, ::T) = 2
Issue 1:
Packages that use setup_requires=["numpy"] in their setup.py appear to fail to build on Windows+Py3.8.

Reproducing code example:

https://github.com/anntzer/setup_requires-numpy is a minimal repro with just the following setup.py:

from setuptools import setup

setup(
name="testpkg",
setup_requires=["numpy"],
)

and is "built" (python setup.py build) on Azure on {linux,mac,windows}+{py3.7,py3.8}.

The resulting build is at https://dev.azure.com/anntzer/setup_requires-numpy/_build/results?buildId=158

As one can see, all builds succeed except windows+Py3.8, which fails with

Traceback (most recent call last):
File "setup.py", line 3, in <module>
setup(
File "C:\hostedtoolcache\windows\Python\3.8.0\x64\lib\site-packages\setuptools\__init__.py", line 144, in setup
_install_setup_requires(attrs)
File "C:\hostedtoolcache\windows\Python\3.8.0\x64\lib\site-packages\setuptools\__init__.py", line 139, in _install_setup_requires
dist.fetch_build_eggs(dist.setup_requires)
…distutils.errors.DistutilsError: Setup script exited with error: SandboxViolation: mkd…sers\\VSSADM~1\\AppData\\Local\\Temp\\easy_install-0gx4h9jy\\numpy-1.17.3\\build', 511) {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.

Error message:

see above

Numpy/Python version information:

numpy 1.17.3, Python 3.8

Issue 2:
I didn't see this error reported, apologies if it is a duplicate -- my current numpy is 1.6.2.

$ sudo easy_install --upgrade numpy
Searching for numpy
Reading http://pypi.python.org/simple/numpy/
Reading http://numpy.scipy.org
Reading http://sourceforge.net/project/showfiles.php?group_id=1369&package_id=175103
Reading http://www.numpy.org
Reading http://sourceforge.net/projects/numpy/files/NumPy/
Reading http://numeric.scipy.org
Best match: numpy 1.7.0
Downloading http://pypi.python.org/packages/source/n/numpy/numpy-1.7.0.zip#md5=ca27913c59393940e880fab420f985b4
Processing numpy-1.7.0.zip
Running numpy-1.7.0/setup.py -q bdist_egg --dist-dir /tmp/easy_install-vw2DNu/numpy-1.7.0/egg-dist-tmp-gJGWkL
Running from numpy source directory.
error: SandboxViolation: open('/dev/null', 'w') {}

The package setup script has attempted to modify files on your system
that are not within the EasyInstall build area, and has been aborted.

This package cannot be safely installed by EasyInstall, and may not
support alternate installation locations even if you run its setup
script by hand. Please inform the package's author and the EasyInstall
maintainers to find out if a fix or workaround is available.
Issue 1:
want to perform some operations when input parameters are being changed. Lets say I have a DatePicker component that has a type input variable, and I want to perform some actions with another date variable when type is being changed. How to do that?

export class DatePicker {

@Input()
date: Date;

@Output()
dateChange = new EventEmitter();

@Input()
set type(type: string) {
if (type === "today") {
this.date = new Date();
this.dateChange(this.date); // because of this change change detector will throw error
}
}

}

p.s. I asked this question on SO a week ago, and didn't get answer

Its a common case task - to perform operations when input values are being changed - any kind of operations, no matter if you change other variables - change detector or something else should not complain. Also, since I opened this issue I want to mention that current component's lifecycle in angular seems doubtful:

Inputs are coming before view and content init, and even ngOnInit, and if you are using setters on inputs to perform something that is depend of view components you can't do it on component initialization, but can do on next time inputs are changed. This creates a lot of monkey patches in the code, like this:

export class DatePicker implements AfterViewInit {

isViewInited = false;

@Input()
set data(data: string) {
if (this.isViewInited)
this.doSomethingViewRelated(data);
}

ngAfterViewInit() {
this.isViewInited = true;
this.doSomethingViewRelated(this.data);
}
}

Issue 2:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

Use loadChildren loaded module will repeat new dependencies module.

Expected behavior

Not repeat new, use the singleton module.

Minimal reproduction of the problem with instructions

Define a child module, set more than one route, like this:

import { ModuleWithProviders } from '@angular/core';
import { Routes, RouterModule } from '@angular/router';

import {
Page1Component,
Page2Component
} from './pages';

const appRoutes: Routes = [
{ path: '', component: Page1Component },
{ path: 'page2', component: Page2Component },
];

export const routing: ModuleWithProviders = RouterModule.forChild(appRoutes);

In the parent routing config, dynamic load the child module, like this:

import { SubModule } from 'modules/demo1';
const appRoutes: Routes = [{
path: '', component: LayoutComponent,
children: [
{ path: 'demo1', loadChildren: () => AppModule },
{ path: '**', component: NotFoundComponent }
]
}];
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes, { useHash: true });

When visit /demo1 and /demo1/page1, the sub module's dependency module will also init.

What is the motivation / use case for changing the behavior?

When route change in dynamic loaded module.

Please tell us about your environment:

It is not important.

Angular version:

2.4.1
Issue 1:
We should simplify and stabilize the go/loader package's API. Before that happens, there are a number of features to add and bugs to fix:

Features:

support ... patterns just like "go build" and "go list" do. (Ideally the logic would be shared. Russ suggested fork/execing "go list", but I don't like this approach: it uses the actual file system instead of the abstraction defined by build.Context.)

Allow packages specified on the command line to use cgo. Currently only imported packages are subject to cgo preprocessing.

Support pkg-config.

API simplifications:

The public fields of loader.Program are sometimes annoying to use. Study existing clients and come up with something more convenient.

Update the go/types tutorial at https://github.com/golang/example/tree/master/gotypes.

Once this is done, we should use go/loader in tools such as golint, govet and stringer.

cc: @griesemer

Issue 2:
Do you think short is necessary here for 3 times string copy?,

Maybe we could just file = file[i+1:] ?

I issue this because it is in the l.mu.Lock():)

https://github.com/golang/go/blob/master/src/log/log.go#L121
if l.flag&(Lshortfile|Llongfile) != 0 {
if l.flag&Lshortfile != 0 {
short := file
for i := len(file) - 1; i > 0; i-- {
if file[i] == '/' {
short = file[i+1:]
break
}
}
file = short
}
Issue 1:
Description of the problem

I'm using makeTextSprite from stemkoski examples. I found this problem in 102 as shown in the following fiddles.

Fiddle showing problem with 102

Fiddle with 101, no problem

This form is for three.js bug reports and feature requests only.

This is NOT a help site. Do not ask help questions here.

If you need help, please use the forum or stackoverflow.

Describe the bug or feature request in detail.

Always include a code snippet, screenshots, and any relevant models or textures to help us understand your issue.

Please also include a live example if possible. You can start from these templates:

jsfiddle (latest release branch)

jsfiddle (dev branch)

codepen (latest release branch)

codepen (dev branch)

Three.js version

Dev

r102

...

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:
Description of the problem

Sprites are flipped. This happened after somewhere between 101 (which works) and 102. In the sandbox below you can exchange the three version, going back to the last major has them positioned correctly.

https://codesandbox.io/s/1z92z6xwz4

Three.js version

r102

Browser

Chrome

OS

macOS