WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I've created a discussion topic on Reddit, but for some reason it disappeared from the Rust page, so I'm filling an issue here. If there's a better place to discuss similar suggestions, please tell me.

I was just playing with Rust on http://rustbyexample.com/, and I've accidentally discovered that writeln can be called without a semicolon.

It doesn't look like a big deal, but for a perfectionist like me, I see it as a consistency flaw, especially for (probably) the most common macro in the language.

The author of Rust by example explained what's going on here, but that doesn't look right to me. Even C has a do-while(0) hack for this case.

This is an expanded println!("test"). The match looks very similar to the do-while(0) C hack for macros, and I think that it's the wrong way to do it, not only because it looks and feels like a hack, but also because it behaves differently than a native Rust function. For example, println!("test") println!("test") compiles, while returns_unit() returns_unit() doesn't.

My proposal: use a self-calling function, similar to what JavaScript allows. I don't know whether it's currently possible in Rust, but if not, I think it could be a natural addition to the language. Here's how I expect it to look, more or less.

Issue 2:
I have encountered an issue which seems very unusual to me and I believe it might be a bug.

Below is a small example which illustrates the issue.

struct CountDown {
count: uint,
// Including the vector causes `Some(self.current())` to fail later on.
vector: Vec<uint>
}

impl CountDown {
fn new() -> CountDown {
CountDown {
count: 10,
vector: vec!(3u, 4, 5)
}
}

fn current(self) -> uint {
self.count
}
}

impl Iterator<uint> for CountDown {
fn next(&mut self) -> Option<uint> {
self.count -= 1;
if self.count == 0 {
None
} else {
// Whether the vector is in the struct or not, this work:
//Some(self.count)

// When the struct contains a vector, the following causes the error:
// cannot move out of dereference of `&mut`-pointer
// If the vector is not in the struct, this work fine.
Some(self.current())
}
}
}

fn main() {
for n in CountDown::new() {
println!("n = {}", n);
}
}

It appears to me quite strange that the presence of a Vector within the struct (even if it isn't used) causes the issue. It also seems strange to me that returning a struct field works, but returning a method which itself returns that struct field fails.

Admittedly, I don't really understand what cannot move out of dereference of '&mut'-pointer really means; a Google search doesn't yield very much, and the documentation doesn't seem to contain much regarding the error.
Issue 1:
Something like the following isn't possible at the moment:

<select name="select">
<option class="x" value="1">red</option>
<option value="2">blue</option>
<option class="y" data-value="3" value="3">green</option>
</select>

I want to add some custom attributes to choice options.

Issue 2:
It would be nice to be able to define extra HTML attributes for choices in a choice list that are added to the option or input tags.

Origin of this ticket: #3456
Issue 1:
Challenge Build JavaScript Objects has an issue.

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

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

After running the test and passing it, I click the "Submit and move on to the next Challenge" button. However, I am not taken to the next challenge and the pop up box "orb" continues to move.

My code:

// Example
var ourDog = {
"name": "Camper",
"legs": 4,
"tails": 1,
"friends": ["everything!"]
};

// Only change code below this line.

var myDog = {
"name": "Tobi",
"legs": 4,
"tails": 1,
"friends": ["Family!"]
};

Issue 2:
I cann't press the button "Submit and go to my next challenge (ctrl + enter)". But if I clicked I only see the infinite loading. How to solve this problem?
Issue 1:
VSCode Version:1.1.1

OS Version: Microsoft windows 7-6.1.7601

-Node -v4.4.5-x86

Steps to Reproduce:

Hover on the object

the list of the object hover popup displayed top position only.

3.I couldn't see the full list, even the scroll feature also not in the hover popup.

Issue 2:
Would be possible to get a editor agnostic Json Schema npm package or something we can use as a service? Something similar to OmniSharp but for Json Schema I suppose. Ideally it would also be able to be hosted independent of VSCode, so editors like Sublime could call on the same functionality as well.

All the hard work is done to get Json Schema support into VSCode, and I'm looking to derive from it to enhance the Atom support for Json Schema (and Json in general). Now that said that means two duplicate code bases, doing essentially the same thing. It would be great if we had one shared code base, so fixes could be shared amoung many editors.

Having a set of API's that could API's for...

completion

hover

symbols

formatting

contributions

list

add

[remove?]
Issue 1:
This test hasn't succeeded in the last 30 runs on GCE or GKE. Trying to figure out what's going on.

Issue 2:
[k8s.io] Kubectl client
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework.go:420
[k8s.io] Simple pod
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/framework.go:420
should support exec through an HTTP proxy [It]
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/kubectl.go:458

Mar 23 15:38:18.838: Unexpected kubectl exec output. Wanted "running in container\n", got "Unable to connect to the server: http: error connecting to proxy http://10.245.3.6:8080: dial tcp 10.245.3.6:8080: i/o timeout\n"

/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/kubectl.go:446
------------------------------

Summarizing 1 Failure:

[Fail] [k8s.io] Kubectl client [k8s.io] Simple pod [It] should support exec through an HTTP proxy
/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/kubectl.go:446

Ran 159 of 266 Specs in 4598.064 seconds
FAIL! -- 158 Passed | 1 Failed | 0 Pending | 107 Skipped --- FAIL: TestE2E (4598.48s)
FAIL
Issue 1:
if (true)
a = b
return

"Return" should have the same indent as "if"

Issue 2:
This issue can include this earlier one.

It seems that a lack of braces break the auto indentation. For example:

if (true)
i = 1;
else
i = 2;

Turns into:

if (true)
i = 1;
else
i = 2;
Issue 1:
The problem seems to be the inclusion of a mix of *.c, *.h and *.c.src files in multiarray_src, the list that only include *.*.src files seem to do better.

Issue 2:
Sometimes, I have a sample of data which I want to divide into bins and then sum an associated vector over all samples within each bin. This could be accomplished by creating a histogram with array-valued weights. Perhaps there are other ways to do it, but this seems to be the best conceptual match to what I want to do, and is a very natural extension of np.histogram.

In the particular example that I am dealing with at the moment, I want to re-weight my samples according to a 4th-order polynomial of an associated quantity. That is, I have an array hist_variable with shape (n,), and another array reweighting_variable also of shape (n,). My weights are some polynomial function of reweighting_variable:

rv = reweighting_variable
weights = a0 + a1*rv + a2*rv**2 + a3*rv**3 + a4*rv**4
counts, edges = np.histogram(hist_variable, weights=weights)

This works fine, as long as a0, a1, etc. are known and fixed. If I instead want to vary a0, a1, etc., then I can create five different histograms:

counts0, edges = np.histogram(hist_variable)
counts1 = np.histogram(hist_variable, weights=rv, bins=edges)[0]
counts2 = np.histogram(hist_variable, weights=rv**2, bins=edges)[0]
counts3 = np.histogram(hist_variable, weights=rv**3, bins=edges)[0]
counts4 = np.histogram(hist_variable, weights=rv**4, bins=edges)[0]

def weighted_counts(a0, a1, a2, a3, a4):
return a0*counts0 + a1*counts1 + a2*counts2 + a3*counts3 + a4*counts4

And then I can choose any a0, a1, etc. that I like, and get my weighted histogram with the function weighted_counts, without performing the expensive np.histogram step again. This works, but it is not ideal.

The reason that it is not ideal is that I must re-do the binning step of np.histogram many times. This is expensive. I've tried to create a solution using np.digitize and fancy indexing, but that is also quite slow. What I wish I could do is

weights = array([rv**0, rv**1, rv**2, rv**3, rv**4])
counts_array, edges = np.histogram(hist_variable, weights=weights)

Can this be implemented efficiently? It seems like summing array-valued weights shouldn't be drastically slower than summing scalar-valued weights.
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
[x] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When using a parametrized route which targets a component, only this component can access those parameters.

Expected/desired behavior

It might be necessary to read the parameters in other components.

Reproduction of the problem

If the current behavior is a bug or you can illustrate your feature request better with an example, please provide the steps to reproduce and if possible a minimal demo of the problem via https://plnkr.co or similar (you can use this template as a starting point: http://plnkr.co/edit/tpl:AvJOMERrnz94ekVua0u5).

Consider the following route configuration

export const routes: RouterConfig = [
{ path: 'confirmation/:hashID', component: ConfirmationComponent, canActivate: [AuthGuard] },
];

Consider the following code as part of the ConfirmationComponent

this.activatedRoute.params.subscribe(params => {
var hashID = params['hashID'];
},

If I use the above code in any other component, hashID won't be available. It is necessary to read location.path() and extract the hashID value.

What is the expected behavior?

Although I understand that the targeted component it the ConfirmationComponent, sometimes other components might need to have access to the parameters explicitly written in the URL.

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

Please tell us about your environment:

Angular version: 2.0.0-rc.4

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 ]

Language: [all | TypeScript 1.8 | ES6/7 | ES5]

Issue 2:
I'm submitting a ...

[x] feature request

Expected/desired behavior

Introduce a way to bundle css with the help of NgModules (see #9726). These styles would only be usable/scoped to the components inside the NgModules.

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

Sharing styles between multiple components is currently not supported out of the box. The user either has to insert these styles globally into the head, or copy them into each component's individual stylesheet. Both of these solutions are problematic.
Issue 1:
The Collapse component's onEntered prop is not destructured in the render method. So the onEntered prop is spread into the Transition component through ...other, thereby overwriting the Collapse components this.handleEntered method as the onEntered prop to Transition. So this.handleEntered is never invoked.

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

Expected Behavior

onEntered should be destructured out of this.props so it is not included in ...other. Collapse handleEntered method should get invoked.

Current Behavior

Collapse handleEntered method is never invoked.

Steps to Reproduce (for bugs)

Try to console.log something in Collapse handleEntered method and it will not log.

render() {
const {
children,
classes,
onEnter,
onEntering, // <-- onEntered prop should be destructured somewhere here
onExit,
onExiting,
transitionDuration,
theme,
...other
} = this.props;

return (
<Transition
onEntering={this.handleEntering}
onEnter={this.handleEnter}
onEntered={this.handleEntered}
enteredClassName={classes.entered}
onExiting={this.handleExiting}
onExit={this.handleExit}
onRequestTimeout={this.handleRequestTimeout}
{...other} // <-- onEntered prop overwriting this.handleEntered
>

Context

I was trying to invoke a call back that helps measure dom elements in Collapse onEntered. I realized it was not being called in the Collapse method because the element did not have the style values that are assigned in that method.

Your Environment

Tech
Version

Material-UI
1.0.0-beta.12

React

browser

etc

Issue 2:
The following code snippet:

React.createElement<SvgIconProps>(icon, { classes: { root: classes.nonActiveColor }});

returns the following type error:

(36,60): error TS2345: Argument of type '{ classes: { root: string; }; }' is not assignable to parameter of type '(Attributes & SvgIconProps) | undefined'.
Object literal may only specify known properties, and 'classes' does not exist in type '(Attributes & SvgIconProps) | undefined'.

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

Tech
Version

Material-UI
v1-beta.9
Issue 1:
Description

When using KubernetesPodOperator with the option do_xcom_push=True, I would also like to be able to change the image being used by the sidecar container that extracts the JSON file from the main container.

Use case / motivation

I would like to have all images pulled from a private repository. Main reason being that I've seen rate limiting issues with Docker Hub, since the image being pulled for the sidecar container is alpine:latest. It would be helpful if I can set Airflow's behaviour to pull a mirror of this image from ECR.

Issue 2:
Description

Problem

It is not easy to rename dags.

Suggestion

It would be better if dag can have both id and name. Id could be some guid/uuid. If not given then id can be generated. At least when required the id can be queried from the database. This way we can change the dag name without changing the id.

DAG_ID = '76c9eb30-4f9c-4806-aad8-931c03679726'
DAG_NAME = 'test'

with DAG(dag_id=DAG_ID, dag_name=DAG_NAME, ...):
# some tasks

If I want to rename the dag then I can simply change the name and I can still get the dag history and not running into the risk of backfilling the dag again.

DAG_ID = '76c9eb30-4f9c-4806-aad8-931c03679726'
DAG_NAME = 'test_edited'

with DAG(dag_id=DAG_ID, dag_name=DAG_NAME, ...):
# some tasks

Use case/motivation

So that dag can be easily renamed.

Related issues

No response

Are you willing to submit a PR?

Yes I am willing to submit a PR!

Code of Conduct

I agree to follow this project's Code of Conduct
Issue 1:
OpenCV => master

Detailed description

A typo in the get_duration_sec method is possible - two times the same condition is written.

https://github.com/opencv/opencv/blob/3.3.1/modules/videoio/src/cap_ffmpeg_impl.hpp#L1103

double CvCapture_FFMPEG::get_duration_sec() const
{
double sec = (double)ic->duration / (double)AV_TIME_BASE;

if (sec < eps_zero)
{
sec = (double)ic->streams[video_stream]->duration * r2d(ic->streams[video_stream]->time_base);
}

if (sec < eps_zero) // repeat?
{
sec = (double)ic->streams[video_stream]->duration * r2d(ic->streams[video_stream]->time_base);
}

return sec;
}

Issue 2:
git clone https://github.com/opencv/opencv
cd opencv
mkdir build
cd build
pwd
#prints: /Users/username/opencv/build
python ../platforms/js/build_js.py . --build_wasm
DESTDIR=/tmp/build make install

this builds under /tmp/build/Users/username/opencv/build/install/{lib,include,...}

instead of /tmp/build/usr/local/{lib,include,...}

(eg that'd be the behavior of other software like libjpeg)

NOTE: this is independent building via ../platforms/js/build_js.py, would've been same with standard build followed by DESTDIR=/tmp/build make install
Issue 1:
It would be nice if the HistGradientBoostingClassifier works takes the same input as the GradientBoostingClassifier.

The following script on sklearn 0.23.0 raises:

TypeError: A sparse matrix was passed, but dense data is required. Use X.toarray() to convert to a dense numpy array.

Switching to GradientBoostingClassifier makes the script work.

from sklearn.experimental import enable_hist_gradient_boosting # noqa
from sklearn.ensemble import HistGradientBoostingClassifier, GradientBoostingClassifier
import numpy as np
from scipy import sparse
arr = np.array([[0, 1, 0, 1],
[1, 0, 1, 0]])
labels = [0, 1]
clf = HistGradientBoostingClassifier()
# clf = GradientBoostingClassifier()

arr = sparse.csr_matrix(arr)
clf.fit(arr,labels)

Issue 2:
This is a placeholder issue for sparse matrices support in the Histogram-based GBDT estimators.

I guess #15550 should be tackled first.

Below are my thoughts and potential plan on the matter, feel free to ignore.

Binning:

We need a utility to compute quantiles on sparse data, and we need to map a float sparse matrix to a binned sparse matrix given those quantiles. To avoid having to densify X_binned, the zeros in X should be mapped to bin 0, even if that's not their actual bin (called actual_bin_zeros). I guess that means all the bins in range(0, actual_bin_zeros) have an offset of 1, i.e. now they're actually mapped to range(1, actual_bin_zeros + 1). Though maybe we can avoid the offset by distinguishing between explicit and implicit zeros, IDK.

Histograms:

We need a histogram builder that can handle sparse data and that is aware of actual_bin_zeros in some way. We can't just build the histograms as usual, because that would mean that the zeros would be treated as the lowest value in the splitter. In the histogram, the zeros should be placed in their proper bin, i.e. at index actual_bin_zeros. This way, the splitter can be left unchanged. The offset of the bins in range(1, actual_bin_zeros) should also be canceled here.

When building a histogram, we can focus only on the non-zeros entries. We already know the totals sum_gradients, sum_hessians, and count at any given node. So we can just go through the samples that have non-zero values and fill-in the histogram at their respective bins, and then set hist[actual_bin_zeros]['grad'] = total_sum_gradients - hist[:]['grad'].sum().
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

The SW-Precache demo should precache all .next folder's ressources?

Current Behavior

The SW-Precache demo cache nothing.

Steps to Reproduce (for bugs)

Clone the repo

Go in the demo's folder with-sw-precache

Run npm build

The result is:

Using "webpack" config function defined in next.config.js.
Total precache size is about 0 B for 0 resources.

Context

I would like to use sw-precache with NextJS

Your Environment

Tech
Version

next
4.1.4

React
16.2

node
8.9.0

OS
MacOSX

browser
Chrome

etc

Issue 2:
I followed #799 but couldn't get a clean way to have a styled-component link, I had to duplicate the href:

const StyledLink = styled.a`
color: red;
background: blue;
`

export default ({ href, name }) => (
<Link prefetch href={href}>
<StyledLink href={href}>{name}</StyledLink>
</Link>
)

What's the proper way to make styled-component links?

Using next.js 2.3.1.
Issue 1:
Some programming languages leave binary compiled files to the source tree by default. .pyc files in Python being the most notably example.

Together with tree-view hideIgnoredNames being false by default this makes navigation in the source tree little bit cumbersome due to scrolling through unnecessary .pyc duplicates, as demonstrated in the screenshot below:

What is Atom stance towards "sane defaults"? Could it be acceptable patch to have .pyc in the ignored files by default (thus giving better out of the box experience), or should things like that go to a separate package which all Python developers then install? (Though Python highlighter comes with the default installation.) I am not sure if I want to make a pull request on this, as I am not aware of the authors stance on the matter like this.

For comparison, Sublime Text & co. seem to hide .pyc files by default.

Issue 2:
Suppose I have a package that's only activated in response to the my-package:start command, and in response to that command, it adds an instance of MyPackageView as a new item in the current Pane.

If I want that view to be serialized when the editor closes, it seems like I'd just register deserialization like this:

class MyPackageView
atom.deserializers.add(this)

constructor: (@data) -> #property assigned
serialize: -> { deserializer: 'MyPackageView', data: @data }
@deserialize: ({data}) -> new MyPackageView(data)

(from serialization docs, see also DeserializeManager)

But the problem with this is that, if we add this view and then close/reopen Atom, it can't find MyPackageView when trying to deserialize this pane item.

It seems that instead of loading the package but then waiting until activation event to call activate(), the package isn't even being loaded until the activation event fires. I'm not sure whether this is the intended behavior or not, but based on the comments about deferring requires in #2654 and also in How To Speed Up Your Packages, it appears to be a change, one consequence of this is that deferring require until activate() makes no difference to application load time. (Although, deferring it until some point even later than that could still speed up package activation time.)

If this is actually the intended behavior of the package loading system, then one approach would be to register your package (or have it automatically inferred) when doing deseralizers.add(), so that the package could be stored as deserializer metadata, and then loaded during deserialization if necessary.
Issue 1:
I have a TextField inside a stacked scafold (the outer one contains a bottombar and the inner one a tabbar with a pageView below it containing the textfield), I've had to set resizeToAvoidBottomPadding: false in order to keep the textfield from disappearing when the keyboard pops-up.

I need to have the textfield occupy the whole available pageview's area, which I can accomplish visually with maxLines = null and InputDecoration.collapsed, The issue that I have (might be related to the scafold flag) is that when the keyboard pops-up, the textview does not resize, so the keyboard appears over what you're writing.

I tried Enveloping the Textfield in a container with a BoxConstraints.loose and that allows me to limit it's height, but then it never spans the rest of the pageview.

What's the correct way to have the TextField occupy the whole pageView and have it resize when the keyboard pops-up? is the container approach the appropriate one? Maybe there's a way to change the boxContraints when the keyboard pops-up, although that seems a lot of work.

Issue 2:
I use flutter framework with following revisions:

Flutter 0.4.4 • channel beta • https://github.com/flutter/flutter.git
Framework • revision f9bb4289e9 (4 weeks ago) • 2018-05-11 21:44:54 -0700
Engine • revision 06afdfe54e
Tools • Dart 2.0.0-dev.54.0.flutter-46ab040e58

I cannot use ListView or ListViewBuilder inside Column widget. No list item is shown until I remove Column wrapper. Is it supposed not to work in that way, or is it a bug?

Here it is my test widget.

new Container(
child: new Column(
children: <Widget>[
new ListView.builder(
itemCount: 3,
padding: const EdgeInsets.only(top: 10.0),
itemBuilder: (context, index) {
return new Text(" asdasd");
})
],
))