WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
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

canDeactivate guard is not called for child components when params change in parent route.

Given that I have a general layout for a page if I have a user param, When I change the user while maintaining the subroute for the UserForm, canDeactivate is not called.

{ path: ':id', component: UserLayout,
children: [
{ path: 'edit', component: UserForm, canDeactivate: [CanDeactivateUserForm] }
{ path: 'favorites', ... },
{ path: 'commments', ... }
]
}

If I put the canDeactivate on the :id path, the method is called, however the component I receive as the first parameter in the canDeactivate method is not the UserForm component, but the UserLayout.

Expected behavior

Expected behavior would be either to implement a canDeactivateChild similar to canActivateChild that is called on the subroutes if the parent route changes or have the children's canDeactivate calls trigger when a parent route changes.

Another alternative would be to make its usage similar to the way it worked before RC.5, where canDeactivate can be directly implemented on the UserForm class.

Minimal reproduction of the problem with instructions

Here is a minimal plunker demonstrating the issue. When you navigate to the a user, the EditInfo form is currently the only subroute of UserDetail (for brevety), but you could imagine other routes. The canDeactivate is attached to this route but when you click on another user, we want to still maintain the editing page, however, canDeactivate is not called.

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

So we can check with the user before navigating away from an unfinished form.

Please tell us about your environment:

MacOS 10.10/Linux Ubuntu, VSCode, npm, rails server

Angular version: 2.0.0

Browser: all

Language: all

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

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

There is already a canActivateChild guard. Having the symmetric guard is equally important. Not sure why this wasn't added at the same time. We have many scenarios where we need to protect child routes from navigating away if they have pending unsaved changes. That's currently only possible by putting a canDeactivate guard on each child route.

Angular version: Latest

Browser: all

Language: all
Issue 1:
xref comment in #19673, we don't have any ASV benchmarks in groupby.GroupByMethods to measure performance on datetimelike types (timestamp / timedelta)

Issue 2:
Hello,

Series doesn't have is a is_unique attribute

Index have a is_unique attribute but not (values of a) Series

>>> df.index.is_unique
True

>>> df['Column1'].is_unique
---------------------------------------------------------------------------
AttributeError Traceback (most recent call last)
<ipython-input-417-c450d4c4ceda> in <module>()
----> 1 df['Date'].is_unique

//anaconda/envs/py27/lib/python2.7/site-packages/pandas/core/generic.pyc in __getattr__(self, name)
2358 return self[name]
2359 raise AttributeError("'%s' object has no attribute '%s'" %
-> 2360 (type(self).__name__, name))
2361
2362 def __setattr__(self, name, value):

AttributeError: 'Series' object has no attribute 'is_unique'

I'm doing this

def is_unique(ser):
return len(np.unique(ser.values)) == len(ser.values)

but this kind of attribute could be useful when you want to set a column as index and ensure that there is no duplicate keys.

PS: I know there is

df.set_index('Column1', verify_integrity=True)
Issue 1:
Looking at the docs, many fields and structs are under-specified. At some point (soon) we need to do an audit/scrub of API per-field and per-struct comments (which generate docs).

What is this field?

Is this field required? (omitempty is sort of a bad way IMO)

What happens if this field is not specified?

What are valid values or bounds for this field?

What happens if you specify an out-of-bounds value?

Does this field have a literal default value (e.g. 42), a derived default value (e.g. same as another field), or no default value (the system will choose a value)?

Is this field updateable? What happens if you update it?

Issue 2:
10933 removes the description tag in types.go, the description of fields are merged with other comments as the new description. Some of these comments don't read as a sentence after the merge. Because our api-reference docs use these descriptions, we need to fix them before #10933.

10933 detects these structs don't have any description. We need to add description for them.

@andronat @nikhiljindal @bgrant0607
Issue 1:
We should add support to save files that require admin access. The way Sublime Text does it is when you hit save, there is a dialog prompt for your password.

Currently this is the error thrown:

Uncaught Error: EACCES, permission denied '/private/etc/apache2/extra/httpd-vhosts.conf' - fs.js

Issue 2:
I edit my /etc/hosts file a lot to work with Enterprise VMs. My typical workflow for that is to run subl /etc/hosts, edit the file, cmd-s, and then I get prompted for my password since it's trying to save and my user doesn't have permission to.

In Atom, it opens the file just fine, but when I try saving the dev tools pane pops up and I see this in the javascript console:

Uncaught Error: You don’t have permission to save the file “hosts” in the folder “etc”.

It would be cool if we had support for nicely handling cases where you try saving files that require privilege escalation to write.
Issue 1:
In some hosting environments/configurations, the network traffic between node and master may traverse the public Internet. As a result, we'd like to secure the communication between the node components (e.g. kubelet and proxy) and master. To avoid the complexity of securing the kubelet API, we'd like to secure the node -> master communication, but not the reverse. This simplification has a downside; it means all communication between kubelet and master would have to be initiated by the kubelet. For example, we'd have to change health checks to be initiated by the kubelet, which in turn raises a question of how to do flow control (master apply backpressure when it becomes overloaded).

Issue 2:
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.):NO

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.): is:issue is:open zsh completion

Is this a BUG REPORT or FEATURE REQUEST? (choose one):

Kubernetes version (use kubectl version):

% kubectl version
Client Version: version.Info{Major:"1", Minor:"3", GitVersion:"v1.3.7+a2cba278", GitCommit:"a2cba278cba1f6881bb0a7704d9cac6fca6ed435", GitTreeState:"not a git tree", BuildDate:"2016-09-23T02:19:56Z", GoVersion:"go1.7.1", Compiler:"gc", Platform:"darwin/amd64"}

Environment:

Cloud provider or hardware configuration: MacBook Pro

OS (e.g. from /etc/os-release): macOS

Kernel (e.g. uname -a): Sierra

Install tools: homebrew

Others:

What happened:

If you source the kubectl complete for zsh like so:

$ source <(kubectl completion zsh)

This breaks zsh vi history search.

What you expected to happen:

ZSH vi history to work as normal

How to reproduce it (as minimally and precisely as possible):

In .zshrc, enable the vi-mode plugin from oh-my-zsh

This should allow to hit the ESC-/ to perform a history search.

Without source the kubectl completion, the command works normally.

After sourcing the kubectl completion, zsh prompts:

zsh: do you wish to see all 16016 possibilities (16144 lines)?

Select 'n' for NO and drops back to the prompt.

Anything else do we need to know:

It seems like kubectl completion is conflicting with vi-mode plugin potentially overwriting the previous configuration.

If I source vi-mode after kubectl, everything works as expected.
Issue 1:

Issue 2:
Hi!

Is there any reason why running plugins inside atom-shell won't work, on principle?

I know it will never be a primary goal of atom-shell, but I'm trying to run a silverlight application (sigh) inside atom-shell.

I had to enable plugins on WebPreferences, and I'm still running into some issues, but I wanted to know if there was an architectural reason, because of how things are structured, that just made it impossible to run plugins successfully over atom-shell.

I'm well aware of the end of support (in the very near future) for plugins on chromium, but even so, we are already running using CEF. It requires us to build different shells for OSX and Win, which I hope atom-shell might free us by letting us write all the OS dependent stuff on JS instead of objC/WPF (and provide us a way to start migrating code incrementally away from SL).

Thanks for any input!
Issue 1:
Could anyone help me with the following please?

I'm unable to light custom geometries, even just a single triangle.

I made the following "as-simple-as-possible" demo: http://gnitsuk.leadhoster.com/ThreeTest/Test.html

The scene shows a cube and a triangle. Notice that only the cube is responding to the PointLIght, the triangle is dark. It makes no difference if I change the winding of the traingle in the call triangleGeometry.faces.push.

If you left click on the page the pointlight is alternately removed and added to the scene. The source code is viewable from the browser.

Can anyone see what I've done wrongly that prevents the triangle from responding to the lighting?

Thanks,

Mitch.

Issue 2:
When trying to add object loaded with ObjectLoader that has a BufferGeometry and materials I'm getting an error (r65):

TypeError: material is undefined
if ( material.transparent ) {
three.js (line 23305)

I'm using the ObjectExporter to save a file with BufferGeometry and materials.

Object file:

https://drive.google.com/file/d/0B12AhxvnYHrAUlpBSFhyUUNTLUE/edit?usp=sharing

JSON model:

https://drive.google.com/file/d/0B12AhxvnYHrAU0ZxT0M0NzYtd28/edit?usp=sharing

Original collada model:

https://github.com/KhronosGroup/glTF/blob/master/model/duck/duck.dae

Exporter:

var loader = new THREE.JSONLoader();
loader.load('model/model.js', function(geometry, materials) {
var bufferGeometry = THREE.BufferGeometryUtils.fromGeometry(geometry);
var mesh = new THREE.Mesh(bufferGeometry, new THREE.MeshFaceMaterial(materials));
var exporter = new THREE.ObjectExporter();
var output = JSON.stringify( exporter.parse(mesh), null, '\t' );
output = output.replace( /[\n\t]+([\d\.e\-\[\]]+)/g, '$1' );
var blob = new Blob( [ output ], { type: 'text/plain' } );
//window.navigator.msSaveBlob(blob, 'model.js');

var a = document.querySelector("#a");
a.href = window.URL.createObjectURL(blob);
a.download = "model.js";
});

Trying to load the obkect:

var loader = new THREE.ObjectLoader();
loader.load('model.js', function(object) {
scene.add(object);
});

By the way, using a with a download attribute might be nicer than opening a new browser window in the editor.

https://github.com/mrdoob/three.js/blob/master/editor/js/Menubar.File.js#L168

Thanks
Issue 1:
checkout with-amp expanse, install deps with yarn, yarn run build produces an error:

> Failed to build on /var/folders/96/_4p69_wn5jj32w5tl1prsd640000gn/T/1c702ef9-d328-4aad-a4be-713d02183e83 { Error: ./pages/_document.js?entry Module not found: Error: Can't resolve 'react-dom/lib/ReactInjection' in '/Users/philipheinser/Downloads/next.js-master/examples/with-amp/pages' resolve 'react-dom/lib/ReactInjection' in '/Users/philipheinser/Downloads/next.js-master/examples/with-amp/pages' Parsed request is a module using description file: /Users/philipheinser/Downloads/next.js-master/examples/with-amp/package.json (relative path: ./pages) Field 'browser' doesn't contain a valid alias configuration aliased with mapping 'react-dom': '/Users/philipheinser/Downloads/next.js-master/examples/with-amp/node_modules/react-dom/dist/react-dom.min.js' to '/Users/philipheinser/Downloads/next.js-master/examples/with-amp/node_modules/react-dom/dist/react-dom.min.js/lib/ReactInjection'

Issue 2:
The prototype I built following the tutorial on learnnextjs.com needs a lot of optimization on its final build. When run past Google PageSpeed Insights, it gets scored down on the following parameters:

Enable compression

Reduce server response time

According to Google, the following scripts are uncompressed:

/_next/7edb944ce4757e3fa4d6f778f42d60f1/app.js

/_next/97e680aa-2946-4f9e-ad5b-8f938979a15c/page/_error

/_next/97e680aa-2946-4f9e-ad5b-8f938979a15c/page/(index)

/(index)

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

Expected Behavior

All bundled files served to the client should be minified and compressed.

Current Behavior

Bundled files being served to the client are not being minified or compressed.
Issue 1:
Description of the problem

BLEND mode when loading a gltf is broken in three.js if a material has both texture + emission texture. Interestingly, a broken material will also break all other transparent materials (e.g. adding a 3rd object with a broken material will break totally separate materials on objects 1 + 2).

A workaround, for whatever reason, is to use KHR_Texture_Transform - if TexTransform is present on a material, it will not break but instead display texture + emission texture correctly.

Live reproduction:

https://glitch.com/edit/#!/spice-water-dormouse

Three.js version

r114

Note that this breaks in all of the following:

Visual Studio Code glTF extension, only in three.js mode, Cesium and Babylon work fine

model-viewer (e.g. your https://model-viewer-tester.glitch.me/)

https://gltf-viewer.donmccurdy.com/

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

macOS

Linux

Android

iOS

Issue 2:
Box3's expandByObject fails for buffer geometry whose itemSize !== 3.

If you call expandByObject(obj) where obj has a child with (for example) a TextGeometry, this line will attempt to read past the end of an array, then call applyMatrix4 so that v1 is {x:NaN, y:NaN, z:NaN}:

https://github.com/mrdoob/three.js/blob/master/src/math/Box3.js#L255

This means that the box's min and max both become NaN, NaN, NaN.

One (obviously not optimized) solution is to replace that line with:

if (attribute.itemSize === 2) {
var v2 = new Vector2();
v2.fromBufferAttribute(attribute, i);
v1.x = v2.x;
v1.y = v2.y;
v1.z = 0;
} else {
v1.fromBufferAttribute(attribute, i);
}
v1.applyMatrix4(node.matrixWorld);

Of course, this would fail if attribute.itemSize === 4. (I'm not sure ever happens in practice.) You can fix that by checking if itemSize ===3 before reading from it with a Vector3.

This is not a problem with setFromBufferAttribute because that does not rely on Math.min or Math.max, which favor NaN over any numbers. (Instead it uses < and > which favor numbers over NaN.)

Three.js version

Dev

r93

...

Browser

All of them

Chrome

Firefox

Internet Explorer

OS

All of them

Windows

macOS

Linux

Android

iOS

Hardware Requirements (graphics card, VR Device, ...)
Issue 1:
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

I have an angular app where am using a webcomponent based on custom elements V0 specification.

<custom-page>
<p>This is child element inside my custom page</p>
<step>
<custom-input-element></custom-input-element>
</step>
<step></step>
</custom-page>

Unable to get access to child elements of custom element "custom-page" in attachedCallBack (lifecylce callback of webcomponents custom element) in the webcomponent.

Expected behavior

Angular needs to provide a way for the webcomponent to access its child elements.

Minimal reproduction of the problem with instructions

https://plnkr.co/edit/SGndyIXp8alqaSP4Av5F?p=preview

Please look into the console message after - "Accessing child Nodes".

On the first preview, it might look like the node references are resolved, please stop and re-run the plunker preview to reproduce the issue

Angular version: 2.0.X

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

[x] bug report
[ ] feature request
[ ] support request

Current behavior

I'm trying to integrate ChartIQ library which has HTML Custom Elements to my angular 2 application.

Some of these elements have logic in createdCallback, but when it is firing innerHTML of Custom element is empty.

Expected behavior

If I use Custom Elements without Angular, createdCallback is firing when the full element (with all childrens added into it) inserted into DOM.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/OW500u9fr27aVteo3zJh

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

For now Angular 2 breaks some part of expected behavior of Custom Elements. It needs to be fixed to allow using Custom Elements in Angular apps.

Please tell us about your environment:

Windows 8, WebStorm, npm

Angular version:

2.2.1

Browser:

Chrome 55

Language:

all

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

6.7.0
Issue 1:
I found an odd discrepancy when creating a custom dtype in numpy. The code below:

import numpy as np
print "VERSION", np.__version__

def f(data, size):
return np.frombuffer(data, np.dtype([('d', 'i', size)]))

d1 = np.arange(1)
d2 = np.arange(2)

a1 = f(d1, 1)
a2 = f(d2, 2)
b1 = f(d1, [1])
b2 = f(d2, [2])

print "a1['d'].shape: ", a1['d'].shape, " b1['d'].shape: ", b1['d'].shape
print "a2['d'].shape: ", a2['d'].shape, " b2['d'].shape: ", b2['d'].shape

produces this:

VERSION 1.12.1
a1['d'].shape: (1L,) b1['d'].shape: (1L, 1L)
a2['d'].shape: (1L, 2L) b2['d'].shape: (1L, 2L)

where a1['d'].shape is the odd one out. This inconsistency is annoying... but at least it seems like always defining the size with a list produces consistent behavior.

I did a quick search and I didn't see a duplicate, but I might have missed it.

Issue 2:
So for context this question comes from this post on stackoverflow: https://stackoverflow.com/questions/50047174/array-comparison-not-matching-elementwise-comparison-in-numpy#50047327

I have a numpy array arr. It's a numpy.ndarray, size is (5553110,), dtype=float32.

When I do:

(arr > np.pi )[3154950]
False
(arr[3154950] > np.pi )
True

Why is the first comparison getting it wrong? And how can I fix it?

The values:

arr[3154950]= 3.1415927
np.pi= 3.141592653589793

Is the problem with precision?

Would someone be able to explain the difference in the way numpy approaches the problem? It looks like using np.float64 explicitly fixes the problem, but I'm curious to know if numpy does a different casting in the two indexing methods.
Issue 1:
This may be trivial problem, but there seems to be inconsistency between variance and covariance

import numpy as np

x = [1,2,3,4,5,6,7]

np.var(x)

produces 4.0, but then

np.cov(x,x)

produces

array([[4.66666667, 4.66666667],

[4.66666667, 4.66666667]])

Of course, mathematically var(x) = cov(x,x). The difference here is clearly because in np.var the sum seems to be divided by n while in np.cov the sum seems to be divided by n - 1. For a naive user without paying attention to the detail, this inconsistency may cause some problem.

Issue 2:
cov() uses a bias of 1 by default.

var() uses a bias of 0 by default.

Such that

import numpy as np

x = np.random.rand(100)

if np.isclose(np.cov([x,x])[0,0], np.var(x)):
print("Consistent by default.")

if np.isclose(np.cov([x,x],ddof=0)[0,0], np.var(x,ddof=0))
print("Consistent.")

will only print the second line.
Issue 1:
Challenge Name

https://www.freecodecamp.com/challenges/show-the-local-weather

Issue Description

For the weather challenge it is recommend to use the open weather api but when using the service on google Chrome the content will not be served on codepen.io due to new security changes in Chrome. So I suggest that we look for alternatives.

Browser Information

Browser Name, Version:

Google Chrome	55.0.2883.95 (Official Build) (64-bit)

Issue 2:
Show the Local Weather

https://www.freecodecamp.com/challenges/show-the-local-weather

Weather App Location issue

I am currently using Google chrome and I have been trying to figure out why my location could not be found when I copied the exact code from FCC and placed it in Codepen.io. After a week of fighting I asked for help and I learn that I had to use https:// so I can find my location. The second issue is that when I tried to pass this location to the Weather API it would not work, so I asked the community again and I learn that the FCC given locator will not work when we pass the location to the weather API. Could you please add a side note to the other codes as a heads up so that they don't end up beating their computer with a baseball bat?

Browser Information

Browser Name, Version: Google Chrome Version 51.0.2704.84 m

Operating System: Windows 10

Mobile, Desktop, or Tablet: Desktop

Your Code

// If relevant, paste all of your challenge code in here

Screenshot
Issue 1:
Minimal example:

trait Foo {
type T;
}

#[derive(Copy)]
struct PairFoo<F: Foo>(pub F::T, pub F::T);

fn main() {}

rustc -Z unstable-options --pretty=expanded yields:

#![feature(no_std)]
#![no_std]
#[prelude_import]
use std::prelude::v1::*;
#[macro_use]
extern crate "std" as std;
trait Foo {
type
T;
}

struct PairFoo<F: Foo>(pub F::T, pub F::T);
#[automatically_derived]
impl <F: ::std::marker::Copy + Foo> ::std::marker::Copy for PairFoo<F> { }

fn main() { }

This is wrong, because the bound shouldn't be F: Copy but <F as Foo>::T: Copy instead.

Issue 2:
In the following snippet, PairFoo<F>'s members are all Copy (resp. Clone) whenever F::T is Copy (resp. Clone). In spite of this, neither does #[derive(Copy)] #[derive(Clone)] work, nor can I provide my own Copy impl.

use std::marker::Copy;
use std::clone::Clone;

#[derive(Copy)]
#[derive(Clone)]
struct Pair<T>(pub T, pub T);

trait Foo { type T; }

// #[derive(Copy)]
// #[derive(Clone)]
struct PairFoo<F: Foo>(pub F::T, pub F::T);

// this one doesn't work
impl<F, T> Copy for PairFoo<F>
where F: Foo<T = T>,
T: Copy
{
}

// this one does work
impl<F, T> Clone for PairFoo<F>
where F: Foo<T = T>,
T: Clone
{
fn clone(&self) -> PairFoo<F>
{
PairFoo(self.0.clone(), self.1.clone())
}
}

rustc's output:

<anon>:12:1: 16:2 error: the trait `Copy` may not be implemented for this type; field `<unnamed_field>` does not implement `Copy` [E0204]
<anon>:12 impl<F, T> Copy for PairFoo<F>
<anon>:13 where F: Foo<T = T>,
<anon>:14 T: Copy
<anon>:15 {
<anon>:16 }
error: aborting due to previous error
playpen: application terminated with error code 101