WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I have noticed that a bound CssClass value is not updated after router navigation. The old value is not replaced by the new value during data binding. Instead it leaves the existing one behind and adds the new one next to it when it's rebound.

I am updating the class via a function which works ok on click, but for some reason the class is not replaced when navigating using the new router.

Element:

<a (click)="selectComponent('grid')" [class]="getActiveClass('grid')" class="list-group-item">Link</a>

//Class is updated correctly when initiated via click, but not via router navigation.

You can see the behavior here: http://www.syntaxsuccess.com/angular-2-samples

Repro steps:

Successful:

Click the left nav and see the active link update correctly (bootstrap blue active clas).

Failure:

Select any of the left nav links other than the first element

Click the 'About' link in the top navigation

Click the 'Demo' link in the top navigation

Observe that there are two highlighted links in the left nav.

After debugging it I noticed that the correct functions fire, but the class property is not overwritten by the binding.

Source code can be found here: https://github.com/thelgevold/angular-2-samples

Issue 2:
Smallish reproduction case:

@Component(selector: 'example')
@View(
directives: const [NgFor, CSSClass],
template: '''
<button (click)="increment()">Increment</button>
<div *ng-for="var item of items" [class]="item">
<div [class]="item">
{{item}}
</div>
</div>
''')
class ExampleComponent {
var next = 0;
var items = ['0'];
void increment() {
items = ['${++next}'];
}
}

What happens in this example is that if you click the "Increment" button 10 times, the resulting DOM is:

<div *ng-for="var item of items" [class]="item" class="ng-binding 0 1 2 3 4 5 6 7 8 9 10">
<div [class]="item" class="ng-binding 0 1 2 3 4 5 6 7 8 9 10">
10
</div>
</div>

Instead, I'd expect each div's class to contain only 10, instead of all the numbers up to 10.
Issue 1:
There doesn't appear to be a way to configure deno fmt, and its --help output mentions nothing about config files (apart from tsconfig.json).

I ran deno fmt . from a directory with a .prettierrc.json file containing:

{
"tabWidth": 4,
"useTabs": true,
"semi": true,
"singleQuote": false,
"trailingComma": "es5",
"bracketSpacing": false,
"arrowParens": "avoid"
}

Which deno completely ignored.

Issue 2:
It would be great to have a way to set prettier options when using deno fmt. Up until a recent release (I'm guessing 0.18, but didn't notice till 0.19) I was able to run deno fmt files -- --prettier-option-1 true, though this was still a less than ideal process. My prefered method would be to have a prettier config file and for deno to either pick it up automatically or allow a flag to pass in a path to said file.
Issue 1:
Currently we have "GCEPersistentDisk", and this name is exposed via the API. I am working on adding support for AWS EBS, which is very similar to GCEPersistentDisk.

Should I add another type AWSPersistentDisk, or should we try to make GCEPersistentDisk work for any PD/EBS/Cinder style cloud-block device? (And presumably rename GCEPersistentDisk to CloudPersistentDisk or something similar)

On EC2, EBS volumes are bound to a specific AZ, so I think we'll likely have a "cloud location" specifier even if we have AWSPersistentDisk (cloudLocation: us-west-2b). I'm thinking if we're going to do that, we might as well have "cloudLocation: aws/us-west-2b", in which case there seems less reason to have the different types.

My personal preference would be to have one PersistentDisk type for all the clouds, to avoid code duplication; it also feels like a simpler API to consume.

Issue 2:
Bug Report

Kubernetes version (use kubectl version): v1.4.6, v1.5.0-beta.2

Environment:

Cloud provider or hardware configuration: OpenStack

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

What happened: When kubernetes relocates a pod that has a persistent volume from cinder, the pod will never start because the volume cannot be attached as it is already attached to another node.

What you expected to happen: Kubernetes should detach the volume from old node and attach it to new node and then start the pod.

How to reproduce it: Have 2 nodes in the same AZ. Create a pod with a cinder volume. Shut down the node where the pod is running. Pod relocates to another node but fails to start as volume never detaches from the original node.

Anything else do we need to know: Pod relocation can happen for failed nodes or if a pod is deleted on a perfectly functional node. Thus, detach should occur if required, no matter what state the original node is in. Attach is handled in: pkg/cloudprovider/providers/openstack/openstack_volumes.go. Volume detach is never attempted if disk is attached to a different compute, leading to an infinite failure loop (even if failed node recovers):

if len(disk.Attachments) > 0 && disk.Attachments[0]["server_id"] != nil {
if instanceID == disk.Attachments[0]["server_id"] {
glog.V(4).Infof("Disk: %q is already attached to compute: %q", diskName, instanceID)
return disk.ID, nil
} else {
errMsg := fmt.Sprintf("Disk %q is attached to a different compute: %q, should be detached before proceeding", diskName, disk.Attachments[0]["server_id"])
glog.Errorf(errMsg)
return "", errors.New(errMsg)
}
}
Issue 1:
Stolen from Python but with some differences:

function jabberwock()
"""
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.
"""
end

julia> print(jabberwock())
'Twas brillig, and the slithy toves
Did gyre and gimble in the wabe;
All mimsy were the borogoves,
And the mome raths outgrabe.

The point of the """ construct is to make it easy to embed snippets of text or code in a readable, nice way inside of Julia code. To that end, it is similar to here documents as well as Python's multiline strings, which use the same delimiters. However, a couple of semantics make these easier to use:

If the initial """ is on a line followed only by whitespace, that whitespace (including newline) will be stripped.

Lines following the opening """ token must begin with the same indentation sequence (identical whitespace characters).

The common indentation will be stripped from each follow-up line.

After these transformations are applied, all normal string interpretation is performed. Moreover, you can prefix """ with an identifier as you can with " strings to invoke macro-based custom-string forms. Thus, a Q""" multiline string has no interpolation performed and a r""" is a multiline regex literal (should maybe automatically switch on some flags).

Issue 2:
Precompile files are currently stored only based on the UUID of the package.

So if you change your project it is likely that you will have to recompile everything. And then again when you swap back etc.

This will be very annoying for people trying to use multiple packages and people will likely just use one mega project like before.

#26165 also removed any possibility for users to change the precompile path so there is no way to workaround this right now.

We should be smarter how we save precompile file to reduce the amount of recompilation needed. A very simple system is to just use one precompile directory for each project but that might be a bit wasteful since it is theoretically possible to share compilation files between projects.
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate. There is a related issue #2769, but it's slightly different and what was described there seems to be working now.

Expected Behavior

When I provide an absolute distDir, it works.

Current Behavior

Because path.join(dir, config.distDir) is used everywhere, the path doesn't make sense and mkdirp fails (I guess other parts of Next.js would fail too if not for mkdirp failing first).

Steps to Reproduce (for bugs)

Create a custom server with the following configuration:

const app = next({
dev,
dir: __dirname,
conf: {
distDir: path.resolve('.foobar'),
},
});

Launch this server.

Context

I'm creating a tool that uses Next.js internally. As such, I'd like to keep stuff like pages/ inside my package while putting the dist dir inside the project.

Issue #2769 describes a situation where paths like '../.foobar' not working, but it doesn't seem to be the case now. That's why I can use the workaround of path.relative(dir, path.resolve('.foobar')). But if path.resolve(dir, config.distDir) was used instead of path.join(dir, config.distDir), other people could avoid this pitfall in the future.

Your Environment

Tech
Version

next
6.0.2

node
8.9.3

OS
Win 10

Issue 2:
I'm just going to leave this here, because it's a lot to type out, and it's quite possible it's user error. But seems like something is not working correctly with the imperative routing api / prefetch / client-side rendering:

https://stackoverflow.com/questions/47701791/strange-imperative-onscroll-routing-behavior-in-next-js-only-rendering-on-serve

thanks for taking a look :)

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

Bug Report

Ansible Version:

ansible 1.7 (devel 189824d) last updated 2014/07/30 17:24:01 (GMT +200)

Environment:

Ubuntu 12.04 LTS

Summary:

The Mount Module is not idempotent if you are using an Bindmount with state=mounted.

It mounts it on every run

Steps To Reproduce:

- name: BIND MOUNT | /usr/local/jdk1.7 -> /usr/lib/jvm/java-7-oracle
mount:
name=/usr/local/jdk1.7
src='/usr/lib/jvm/java-7-oracle'
fstype=none
opts=bind
state=mounted

(No, i wont use Symlinks for this)

Expected Results:

Correct checking of the Mount Status and just execute it once if neccessary

Actual Results:

3x Run, 3x "Changed" ->

$ mount

/usr/lib/jvm/java-7-oracle on /usr/local/jdk1.7 type none (rw,bind)

/usr/lib/jvm/java-7-oracle on /usr/local/jdk1.7 type none (rw,bind)

/usr/lib/jvm/java-7-oracle on /usr/local/jdk1.7 type none (rw,bind)

Issue 2:
Issue Type:

Bug Report

Ansible Version:

ansible 1.5.4

Environment:

Ansible is running from OS/X Mavericks 10.9.2

I am managing an Ubuntu 12.04 instance

Summary:

When using the mount module and specifying an option of "bind", the filesystem is mounted over and over. This has been tracked down to what appears to be Python's os.path.ismount(path) returning false for any mounts with the bind option applied.

Steps To Reproduce:

Create a mount using the mount module with the following options:

fstype: none

opts: rw,bind

state: mounted

Expected Results:

I expect to see the mount point show up in /etc/fstab, the mount point to show when the command "mount" is ran in the terminal, and for the Ansible task to not show as "changed" for each run when no change has occurred.

Actual Results:

The mount point shows up properly in /etc/fstab, but the mount point is mounted each time the Ansible task is ran, causing it to be mounted over and over on the system as well as for the Ansible task to show the status of "changed".
Issue 1:
When passing whiten=True to PCA(), component-wise variances are not 'unit' as is claimed.

Unless I'm missing something, this is a regression presumably caused by #9105 (which appeared in v0.19)?

Example:

from sklearn.datasets import make_classification
from sklearn.decomposition import PCA

X, _ = make_classification(n_samples=1000, n_features=4, n_informative=3, n_redundant=0,
n_repeated=0, n_classes=2, random_state=10, shift=10., scale=10.)
print(1 - PCA(whiten=True).fit_transform(X).var(axis=0))

Under v0.18.2, this outputs

[ -4.44089210e-16 0.00000000e+00 1.11022302e-16 6.66133815e-16]

Under v0.19.0, this outputs

[ 0.001 0.001 0.001 0.001]

Issue 2:
The documentation for sklearn.decomposition.PCA says that

"Implements the probabilistic PCA model from: M. Tipping and C. Bishop, Probabilistic Principal Component Analysis, Journal of the Royal Statistical Society, Series B, 61, Part 3, pp. 611-622 via the score and score_samples methods."

It is unclear what the intention is for the other methods, but to match the MLE for PCA some changes need to be made:

explained_variance_ = (S ** 2) / (n_samples - 1)

on Line 423 needs to be

explained_variance_ = (S ** 2) / n_samples

Since the former is using the unbiased estimate of covariance and the latter is used in Tipping and Bishop eq (11).

Also, the projection of PPCA in Sec 3.3 of Tipping and Bishop is different than the conventional projection used in the implementation here. That needs to be clarified in the documentation. Maybe a separate class needs to be made (PPCA) that more cleanly implements Tipping and Bishop.
Issue 1:
I was taking a look at the default app. There's a menu item that causes the app to enter fullscreen, but once in fullscreen the menu item doesn't change from "Enter Fullscreen" to "Exit Fullscreen". This means that once you enter fullscreen though the menu, you cannot exit it.

It seems to me that there should be some way of dynamically changing a menu item's label inside of its own callback. I couldn't find a way to do this without removing the entire menu, creating a new one, then adding it back, but that felt rather heavy handed. Another way to do this would be by removing the single menu item and adding a different one in its place (essentially swapping it out), but there doesn't seem to be any more functionality allowing this than there is for merely changing a label. (A request for the addition of Menu.remove() can be found here.)

I would be willing to contribute to this if given some pointers. It should be noted that I haven't worked with CoffeeScript except in passing, but I can most likely figure it out.

Issue 2:
Maybe I missunderstood something but trying to overwrite some delegates in a newly created Menu will not call my custom function:

menu.delegate.menuWillShow = function () {

console.log('MY MENU DELEGATE');

}

menu.delegate.menuWillShow(); // doesn't call my function??

Note that the Menu is created using remote call within a BrowserWindow.
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Display all meta tags in <Head> by using next/head

Current Behavior

I need to provide 6 meta tags with the same property fb:pages and only the last one is displayed in the source code. I guess this is to avoid duplicated meta tags with the same property or name.

Steps to Reproduce (for bugs)

Provide multiple meta tags with the same property or name in <Head>

Check the source code

Your Environment

Tech
Version

next
4.2.0

node
8.9.4

OS
MacOS Sierra 10.12.6

Issue 2:
Feature request

I want a more intuitive Link API which respects expectations we have around native a tags.

Is your feature request related to a problem? Please describe.

The current link API looks like the following:

<Link href="/about">
<a>here</a>
</Link>

This is problematic for a few reasons:

It breaks intuition around a11y. When I see an a tag without an href, alarm bells go off, because that is a UX anti-pattern. In fact, this API makes it impossible to appease the anchor-is-valid eslint-plugin-jsx-a11y rule (see https://github.com/evcohen/eslint-plugin-jsx-a11y/issues/402).

It requires a call to cloneElement which should be avoided as its behavior is confusing. (How would I know my a tag will be given an href? Nothing about this API suggests that.)

Describe the solution you'd like

I would like a solution which doesn't require you to type an a tag without an href and also doesn't require you to duplicate the href information.

Describe alternatives you've considered

There are a few good alternatives:

Default to a tag if no children are given:

<Link href="/about" />

This is the approach react-router uses and it works quite well.

Use a render prop:

<Link href="/about">
{href => <a href={href}>here</a>}
</Link>

This method appeases the anchor-is-valid rule and doesn't require the user to duplicate href information since the build href is passed down to the component they are rendering.

Component injection:

<Link href="/about" component={a} />

A combination of 1 and 2 would be powerful enough to cover all reasonable use cases.

Additional context

6431f5f
Issue 1:
Electron version: 1.4.0

Operating system: macOS 10.12.4

Expected behavior

When uploading Chess in the Applications folder through <input type="file" />, event.target.files[0].type should be application/zip, which is the case when uploaded in Chrome.

Actual behavior

event.target.files[0].type is an empty string.

How to reproduce

Run the following the code in some page loaded by Electron and Chrome, different logs are displayed in dev tools.

var input = document.createElement('input')
input.type = 'file'
input.addEventListener('change', e => console.log(e.target.files[0]))
document.body.appendChild(input)

Electron:

Chrome:

We can see that the name, size and type properties have different values.

Issue 2:
Electron version: 1.6.2

Operating system: macOS 10.12.3

Actual behavior

I faced with strange behaviour of <input type='file' /> in Electron.

You can select special Macs' folders - app folders (for example /Applications/Calculator.app).

In Finder it looks like file, but it's directory!

Expected behavior

There are two possible ways.

Chromeway (and Safari). In real Chrome you can select Calculator.app from <input type='file' />. But Chrome transparently created Calculator.app.zip and attached this archive to input.

Firefox way. In Firefox you can not select any folders from <input type='file' />

How to reproduce

I have created simple fiddle for that https://jsfiddle.net/s7c7k33b/ for testing in different browsers and Electron
Issue 1:
Would love to have a better web development experience with Deno out of the box.

First, the server should restart whenever I make changes.

Second, the website should reload whenever I make changes.

For the server, I'd like to propose a deno watch subcommand or deno run --watch flag that automatically restarts the server in a controlled way, e.g.

deno watch *.ts --run main.ts --allow-net
# or
deno run --watch *.ts --allow-net main.ts

If we also had a Deno.watch API for watching directories or files, we could then implement a simple client refresh via server-sent events (example) or web sockets.

EDIT: It would be nice if the watch subcommand/flag would be able to notify the running code that it will/should be restarted - maybe something via signals (e.g. SIGUSR1), command line flags, some API, or a similar mechanism - so that the server could notify the client that it will be restarted and that the client needs to be reloaded.

Issue 2:
There are several use cases where the ability to watch a file(s) for changes is an important API. For example, invalidating cache headers for serving static file based content, or processing logs or files, etc.

Many OSes provide a mechanism for this without having to "poll" the stats for the file. Node.js offers fs.watch().

Instead of an event listener though, it feels some sort of async generator would be more idiomatic to the rest of Deno.
Issue 1:
Describe the workflow you want to enable

Measuring calibration error in deep learning is a big issue now-a-days. However, we do not find any suitable package available to measure the calibration error. I would like to add a function that can measure calibration error with adaptive bin size as described here: https://openaccess.thecvf.com/content_CVPRW_2019/papers/Uncertainty%20and%20Robustness%20in%20Deep%20Visual%20Learning/Nixon_Measuring_Calibration_in_Deep_Learning_CVPRW_2019_paper.pdf. Note that there are many ECE algorithms that measures the calibration error with fixed bin size that is major problem for inhomogeneous data distribution.

Describe your proposed solution

We already have a tentative implementation here: https://github.com/neurodata/kdg/blob/cc88886819676020402f19ec8b224ed5aafdc440/kdg/utils.py#L8. We would like to adapt the code for sklearn so that people can use it.

Describe alternatives you've considered, if relevant

No response

Additional context

No response

Issue 2:
Describe the workflow you want to enable

I would like to add the ability to calculate Expected Calibration Error (ECE) within scikit-learn. ECE is defined in equation (3) from Guo et al. On Calibration of Modern Neural Networks. (2017). This is a well-cited paper (over 700 citations as of Aug. 26, 2020), and the ECE metric is now widely used in academic papers on model calibration. There is even a method now in TensorFlow Probability for computing ECE: tfp.stats.expected_calibration_error().

Describe your proposed solution

I can see several possibilities for how the ECE calculation could be added to scikit-learn, with pros and cons for each:

make ECE an extra return value of sklearn.calibration.calibration_curve(). This method currently already does 99% of the work towards calculating ECE. Computing ECE is simply a one-liner added to the end of that method:

def calibration_curve(...):
...
ece = np.sum(np.abs(prob_true - prob_pred) * (bin_total[nonzero] / len(y_true)))
return prob_true, prob_pred, ece

The downside is that introducing a 3rd return value is a breaking change. One possible mitigation is to add a boolean return_ece parameter to the function definition with a default value of False, and only return ece if return_ece=True.

add a dedicated function to sklearn.metrics, i.e., sklearn.metrics.expected_calibration_error(y_true, y_pred). Downside here is that it would need to re-compute everything that calibration_curve() already computes, so there is a performance penalty for a user who wants to both calculate ECE and plot a calibration curve.

add a dedicated function to sklearn.calibration, i.e., sklearn.calibration.expected_calibration_error(y_true, y_pred). This would keep the ECE calibration within the calibration subpackage. Same downside as in option 2.

Additional context

I am happy to write the code and tests to add ECE calculation to scikit-learn. After all, the code to calculate ECE is just a one line addition to calibration_curve(). However, as I am not a regular contributor to scikit-learn, I am unfamiliar with the best place within the scikit-learn library to add such a feature. Please advise!
Issue 1:
When copying a segment of code that starts with a new-line followed by tabbed-in code while "Auto Indent On Paste" is enabled, consecutive pastes will each be an additional tab deeper. I tested this with C++, Java, and JavaScript which makes me believe it is not a problem with the language specs.

Here is an example in the form of an animated gif:

It isn't just comments that this happens with, but it does require the previous line to be selected. Specifically, this happens when the copy-buffer matches a regex like /^\n\s+[^\s]/. That is, it starts with a newline, followed by one or more whitespace characters and then a non-whitespace character. And the previous line must be a blank line.

Issue 2:
Halp ticket:

support/c7984784bffc11e3936c51033c8a3e07

Snippet system needs to be worked on, when i setup a snippet in the config file, and then i save it and go back to my work, i use the short word and hit tab, and nothing ever expands.

I could reproduce this:

quit Atom

remove ~/.atom/snippets.cson

start Atom

go "Atom > Open your snippets", and add a snippet to snippets.cson

try triggering the snippet you just added -- it won't work

quit and restart Atom

try triggering the snippet again -- it will work