WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
The following code snippet:

import numpy as np
print(np.array(-2, dtype=np.float32).astype(np.uint8))

returns different results on x86 and ARM:

ARM:
> 0
x86:
> 254

The issue seems to be similar to #16073 and #2398.

My guess is that char might be used internally, which "has an implementation-defined choice of “signed char” or “unsigned char” as its underlying type" (source, ARM reference).

Using this assumption, I've rebuilt numpy using:

CFLAGS="-fsigned-char" python setup.py develop -vvv

but the behavior didn't change.

After discussing this issue with @t-vi I'm unsure, if this is expected (undefined) behavior or a bug, which could be fixed.

Numpy version:

1.22.0.dev0+1068.gdc7dafe70 3.8.10 | packaged by conda-forge | (default, May 11 2021, 06:25:29)
[GCC 9.3.0]

Issue 2:
With ndarray.astype(..., casting="unsafe") float arrays with NaN/inf will be converted to np.iinfo(dtype).min/max,

>>> np.array([1, np.nan], dtype=np.float32).astype(np.int32)
array([ 1, -2147483648], dtype=int32)
>>> np.array([1, np.inf], dtype=np.float32).astype(np.int32)
array([ 1, -2147483648], dtype=int32)

(there are also some inconsistencies there cf #6109). This is very bad in practical applications as output data will be wrong by orders of magnitude. Other casting options simply disallow casting float to int.

At the same time, casting from dtype=np.object works as expected,

>>> np.array([1, np.inf], dtype=np.object).astype(np.int32)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
OverflowError: cannot convert float infinity to integer

It could be useful to have some additional casting option allowing to convert int to float, but would error on NaN or inf. This could be done manually,

if array.dtype.kind == 'f' and np.dtype(dtype).kind == 'i':
# check for overflows and NaN
_assert_all_finite(array)
result = array.astype(dtype)

but having it in numpy would be useful.

I also wonder if there is really a case when not raising on such conversions is meaningful (even with casting='unsafe'). For instance pandas does this conversions as expected (using numpy dtypes),

>>> pd.Series([1, np.nan], dtype=np.float64).astype(np.int)
[...]
ValueError: Cannot convert non-finite values (NA or inf) to integer

Numpy/Python version information:

>>> import sys, numpy; print(numpy.__version__, sys.version)
1.16.4 3.7.3 (default, Mar 27 2019, 22:11:17) [GCC 7.3.0]
Issue 1:
After closing a modal once, when I open it again and try to close (using the "Close" buton or "X" button) nothing happens.

I found that it has to do with commit a4f0e8d (I reverted it and it works fine).

BS 3 RC2 tested with Chrome 28.

Issue 2:
Hi,

The code used on last Thursday worked fine. But after updated to latest code on Monday (GMT+8), the modal dialog when clicks to dismiss for seconds onward cannot be close.

I am checking on source code line 932, if I commented out this line then it is working again.

this.$element

.removeClass('in')

.attr('aria-hidden', true)

//.off('click.dismiss.modal')

Am I missing anything...?

Sorry for the grammar. Thanks.
Issue 1:
Original ticket http://projects.scipy.org/scipy/ticket/1080 on 2009-12-29 by trac user mshafiei, assigned to unknown.

the new version of scipy i.e. 0.7.1 and 0.7.0 des not include the "signal" subpackage. I need to inform my operating system is windows and I downloaded the .exe file for python 2.5. I installed older version 0.6 for using the signal processing subpackage of scipy. Please add these subpackage to new version as well.

Issue 2:
Original ticket http://projects.scipy.org/scipy/ticket/1079 on 2009-12-29 by trac user mshafiei, assigned to unknown.

I installed new version of the scipy () for windows using exe file for python 2.5 and the subpackage "signal" does not exist. Since I needed some signal processing , I start to download the 0.7.0 version and I found that version have signal in its functions
Issue 1:
From @aayushkapoor206 on April 7, 2016 19:33

VSCode Version: 0.10.11

OS Version: Windows 10

Steps to Reproduce:

Before

After

Copied from original issue: microsoft/vscode#5086

Issue 2:
In VS Code (as it uses the built in formatter, I assume this is the best place to put the issue), the TS formatting produces this:

foo()
.then<void>(
function(): void {
},
function(): void {
}
)
.then<void>(
function(): void {
},
function(): void {
}
);

I would expect this:

foo()
.then<void>(
function(): void {
},
function(): void {
}
)
.then<void>(
function(): void {
},
function(): void {
}
);

The former is pretty hard to read.
Issue 1:
Right now while using decorators the javascript seems to work, but the types are too strict.

As you can see here the following does not compile:

declare var _: any;
export function Throttle(milli: number) {
interface Throttled extends Function {
now: Function
}
return function<T extends Throttled>(target: Object, propertyKey: string, descriptor: TypedPropertyDescriptor<Function>): TypedPropertyDescriptor<T> {
let originalMethod = descriptor.value;
// NOTE: Do not use arrow syntax here. Use a function expression in
// order to use the correct value of `this` in this method
descriptor.value = <any>_.throttle(function() {
originalMethod.apply(this, arguments);
}, milli);
(<Throttled>descriptor.value).now = <any>function() {
originalMethod.apply(this, arguments);
};
return <TypedPropertyDescriptor<T>>descriptor;
}
}

class Ctrl {

constructor(scope: any) {
scope.$watch("foo", this.throttledByClassWatch);
this.throttledByClassWatch.now() //unrecommended now call
}
@Throttle(100000)
private throttledByClassWatch() {
}
}

I might have the types a little wrong but I have tried many other permutations. It seems to be because the expected type is declare type MethodDecorator = <T>(target: Object, propertyKey: string | symbol, descriptor: TypedPropertyDescriptor<T>) => TypedPropertyDescriptor<T> | void; and so the input T must match the output T.

Ideally the now could also inherit the generic type T so it could be type checked.

Issue 2:
If we can get this to type check properly, we would have perfect support for boilerplate-free mixins:

declare function Blah<T>(target: T): T & {foo: number}

@Blah
class Foo {
bar() {
return this.foo; // Property 'foo' does not exist on type 'Foo'
}
}

new Foo().foo; // Property 'foo' does not exist on type 'Foo'
Issue 1:
I desire to visualize a mesh + its wireframe. The mesh is open and therefore some back faces are visible.

Using a solid color for the wireframe gives uneven contrast between the shaded triangles and the unshaded edges:

http://jsfiddle.net/4nf8y3z1/1/

Using lights: true on the LineBasicMaterial seems not to work:

http://jsfiddle.net/4nf8y3z1/2/

Uncaught TypeError: Cannot set property 'value' of undefined
three.js:22031 Uncaught TypeError: Cannot set property 'needsUpdate' of undefined
three.js:22031 Uncaught TypeError: Cannot set property 'needsUpdate' of undefined

As a workaround, I'm using a MeshPhongMaterial and a Mesh for the wireframe too, using the same geometry, and passing wireframe: true. This works great for the front-faces, but not for the back faces:

http://jsfiddle.net/4nf8y3z1/3/

Therefore, I played a bit with the GLSL shaders to change the illumination models such that instead of saturating dotNL, it takes the absolute value, so that back faces are shaded exactly as if they were front-facing:

http://jsfiddle.net/4nf8y3z1/4/

(this last jsfiddle is the same as the previous, except that it includes three_fix.js instead of three.min.js)

I just wanted to share this with you, and let you decide whether you want to integrate these changes, possibly with more thought (is changing saturate -> abs always ok, or could it break other thing? is the additional cost of the abs() ok? maybe this should be a parameter of the material? etc.).

For now, I just directly modified the build file three.js to get what I wanted, I don't have much more time for further investigation. :)

Great library by the way, I've started using it two days ago and I love it!

Issue 2:
Know of anything like that? Trying to learn more about the history, approach, goals, etc.

Thanks!
Issue 1:
Hi,

I am new to electron. I tried to build my own Internet browser with several tabs using electron. Each tab contains a webview element. I have put src value to each webview element but I found when I launch the browser only the webview in active tab was immediately loading. The rest of the webviews were not loading. It only starts to load if I select the tab belongs to the webview.

I want the webviews to load immediately when the browser launch. How can I do that?

Issue 2:
Hi,

It would be nice if element can be detached into separate window for rendering. I don't know if this can be done in electron atm.
Issue 1:
Describe the workflow you want to enable

I need to use StratifiedGroupKFold on my data.

Unlike cross_validate, SequentialFeatureSelector.fit method has no **fit_params or groups parameter, so I can't use group split.

Describe your proposed solution

Adding **fit_params or groups parameter to SequentialFeatureSelector.fit method.

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 be able to pass sample weights to the fit method of the estimator in SequentialFeatureSelector. (SelectFromModel has this feature as well.)

Looking at the code, it seems to me that sklearn.model_selection._validation._fit_and_score, which is where the actual scoring takes place, already supports sample weights in cross-validation (i.e., takes care of passing only the weights for samples that are actually part of the fold).

Describe your proposed solution

Based on my current understanding, SequentialFeatureSelector.fit() would need to get an additional argument fit_params (cf. SelectFromModel.fit()) that is passed on to the cross_val_score function called in SequentialFeatureSelector._get_best_new_feature_score. Everything else appears to be in place already.

if that's all it takes, I'm happy to prepare a PR. But I might very well be overlooking issues or unintended consequences.

Describe alternatives you've considered, if relevant

No response

Additional context

No response
Issue 1:
Challenge Waypoint: Add a Submit Button to a Form has an issue.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36.

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

My code:

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
</form>

Issue 2:
Challenge Waypoint: Add a Submit Button to a Form has an issue.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36.

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

My code:

<link href="http://fonts.googleapis.com/css?family=Lobster" rel="stylesheet" type="text/css">
<style>
.red-text {
color: red;
}

h2 {
font-family: Lobster, Monospace;
}

p {
font-size: 16px;
font-family: Monospace;
}

.thick-green-border {
border-color: green;
border-width: 10px;
border-style: solid;
border-radius: 50%;
}

.smaller-image {
width: 100px;
}
</style>

<h2 class="red-text">CatPhotoApp</h2>

<p>Click here for <a href="#">cat photos</a>.</p>

<a href="#"><img class="smaller-image thick-green-border" alt="A cute orange cat lying on its back" src="https://bit.ly/fcc-relaxing-cat"></a>

<p>Things cats love:</p>
<ul>
<li>cat nip</li>
<li>laser pointers</li>
<li>lasagna</li>
</ul>
<p>Top 3 things cats hate:</p>
<ol>
<li>flea treatment</li>
<li>thunder</li>
<li>other cats</li>
</ol>
<form action="/submit-cat-photo">
<input type="text" placeholder="cat photo URL">
</form>
Issue 1:
Hi all,

In my Electron app, I capture navigation events from a webview in the main window and display the contents in a second window.

Capturing the event and displaying the selected contents in the second window using webview.addEventListener('will-navigate', ...) and some renderer->main->renderer ipc works just fine, but I haven't been able to prevent the main window webview from also loading the linked page contents, despite calling Event.preventDefault() and Event.stopPropagation(). I'm aware of issue #4191 and others that have reported this before, but if there's a fix or a workaround for this problem, I haven't found one.

The following complete code is supposed to ignore all navigation events and leave the original page in place, but instead it replaces it with the navigated page contents every time.

app.js:

const {app, BrowserWindow} = require('electron')
app.on('ready', () => {
let win = new BrowserWindow({width: 800, height: 600})
win.loadURL('file://' + __dirname + '/app.html')
win.on('closed', () => app.quit())
})

app.html:

<html>
<head>
<title>Navigate</title>
</head>
<style>.view {width: 100vw; height: 100vh}</style>
<body style="margin: 0">
<webview class="view" id="view" src="https://electronjs.org/docs/all"></webview>
</body>
<script>
const webview = document.getElementById('view')
webview.addEventListener('will-navigate', event => {
console.log('Preventing navigation to ' + event.url)
event.preventDefault()
event.stopPropagation()
}, false)
</script>
</html>

Am I missing something?

Environment:

Electron version: 1.8.2

Operating system: Windows 10

Issue 2:
Preflight Checklist

I have read the Contributing Guidelines for this project.

I agree to follow the Code of Conduct that this project adheres to.

[ x] I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

Electron Version:

4.0.0. , 5.0.0

Operating System:

Windows 10 (1803)

Last Known Working Electron version:

I did not find any working version

Repro steps:

open developer tools

go to Elements tab

select any html element

open Accessibility tab

Expected Behavior

accessibility tab show accessibility tree

Actual Behavior

accesisbility tab is empty

Error in console:

[99978:0610/175341.131749:ERROR:CONSOLE(24)] "Empty response arrived for script 'devtools://devtools/remote/serve_file/@f200986dfaabd6aad6a4b37dad7aae42fec349e9/accessibility/accessibility_module.js'", source: devtools://devtools/bundled/shell.js (24) [99978:0610/175341.140809:ERROR:CONSOLE(109)] "Uncaught (in promise) Error: Could not instantiate: Accessibility.AccessibilitySidebarView", source: devtools://devtools/bundled/shell.js (109)

Screenshots

Screenshot took from Electron Fiddle:

Additional Information
Issue 1:
Looking at wells (http://getbootstrap.com/components/#wells) and contextual text and backgrounds (http://getbootstrap.com/css/#helper-classes) and noticed these are not complementing each other.

A .well will make the element ignore the text and background provided by the contextual classes, so

<p class="well bg-info">
...
</p>

is no different from

<p class="well">
...
</p>

I propose that either the fact that .well will override the contextual classes be documented, or (preferably) .well and the contextual classes will complement each other.

Issue 2:
I've coded:

<div class="well bg-success">some text</div>

But I didn't get the green background color.

Shouldn't the well component accept the contextual background class background-color?
Issue 1:
I am building a blog with Next.js. I need my contact page to include a contact form so visitors can send emails via Nodemailer.

I am fairly new to Express so I feel in a little over my head. Should I be customizing the Next.js server?

Or should I make a separate server? If so, is that completely separate from my Next.js app?

I currently have pages/contact rendering a form. I am not worried about actually sending the email and all that Nodemailer stuff. I just don't understand where I should be hooking up my configurations.

What would be the recommended way to do implement such a contact form?

Any help greatly appreciated. Thank you!

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

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

Expected Behavior

document says:

import Router from 'next/router'
export default ({ url }) => (
<div>
<a onClick={ () => setTimeout(() => url.pushTo('/dynamic'), 100) }>
A route transition will happen after 100ms
</a>
{
// but we can prefetch it!
Router.prefetch('/dynamic')
}
</div>
)

Current Behavior

While use Router.prefetch('/foo') in render() would got an error:

No router instance found. You should only use "next/router" inside the client side of your app.

Alternative Usage

Use it in componentDidMount works as expected:

componentDidMount () {
Router.prefetch('/foo')
}

Is it a bug or the document needs update?
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

Expected behavior

Posibility to have multiple query params with the same name url?foo=bar&foo=baz

Reproduction of the problem

not currently possible with angular2 and router

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

align with @angular/http URLSearchParams

Angular version: 2.0.0-rc.X

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 ]

all

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

all

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

Currently when going to a url with multiple query parameters with the same key the DefaultUrlSerializer is removing all but the last one from the url.

/something/route?room=a1&room=a4&room=a6

This link will be rewritten to:

/something/route?room=a6

Expected/desired behavior

The url should remain the same and keep all parameters.

Please tell us about your environment:

Angular version: 2.0.0-rc.6

Browser: all

Language: Typescript

This pull request fixes the issue but it's my first one - #11373
Issue 1:

Issue 2:
So, I use my text editor for all kinds of things (writing code, reading readmes, editing dotfiles, etc). One of the things I do most often during any given day is open up large log files to troubleshoot Enterprise problems. These files can sometimes get as large as 500-800MB.

I just tried viewing a 350MB log file and Atom locked up immediately -- the file selector didn't change and the entire window went completely white 4 seconds after I tried viewing the file. I could still close the top level window, but we should still have better handling for this kind of thing.

Sublime Text 2 took about 55 seconds to open the file, but gave a nice progress indicator while it was loading:

Once it loaded it was as responsive as any other file I load (scrolled fast, normal text highlight performance, etc). It would be nice if we set this as a baseline for expected behavior (progress bar + responsive after loading).
Issue 1:
First discussed here: https://discourse.julialang.org/t/unnecessary-where-t-causes-huge-performance-drop/31078

Given the following functions in a Julia 1.3rc4 session:

function f1(x) where {T}
return x*2
end

function f2(x)
return x*2
end

function f3(::Type{T}, x) where {T}
return x*2
end

I'd assume that all of them would generate the same machine code for the same x. This is however not the case:

@btime f1(1)
10.825 ns (0 allocations: 0 bytes)
2

@btime f2(1)
0.017 ns (0 allocations: 0 bytes)
2

@btime f3(Bool, 1)
0.017 ns (0 allocations: 0 bytes)

For both f2 and f3 the constant folding worked, but f1 does something differently. I also tried it using broadcasting to trick the constant folding:

a = rand(1000);
@btime f1.($a);
14.736 μs (2001 allocations: 39.19 KiB)

@btime f2.($a);
471.755 ns (1 allocation: 7.94 KiB)

@btime f3.(Bool, $a);
445.223 ns (1 allocation: 7.94 KiB)

There are a lot of allocations which I do not understand. Is this some kind of a lowering bug?

Update: sorry, I did a silly mistake, v0.7 of Julia shows the same behaviour

Issue 2:
Under some circumstances, having an unused typevar in a method definition causes the method to unexpectedly allocate and perform poorly. For example:

julia> function foo(y::T) where {N, T}
1.0 * y
end
foo (generic function with 1 method)

julia> using BenchmarkTools
[ Info: Recompiling stale cache file /home/BOSDYN/rdeits/.julia/compiled/v1.0/BenchmarkTools/ZXPQo.ji for BenchmarkTools [6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf]

julia> @btime foo($(1))
13.938 ns (1 allocation: 16 bytes)
1.0

where the N parameter is unused. Removing that parameter fixes the problem:

julia> function foo(y::T) where {T}
1.0 * y
end
foo (generic function with 1 method)

julia> @btime foo($(1))
1.239 ns (0 allocations: 0 bytes)
1.0

Is this and expected performance issue? I've observed it with Julia 1.0 and the latest nightly build.

julia> versioninfo()
Julia Version 1.0.1-pre.171
Commit 398d87829d (2018-09-26 22:52 UTC)
Platform Info:
OS: Linux (x86_64-pc-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E3-1535M v6 @ 3.10GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-6.0.0 (ORCJIT, skylake)
Issue 1:
I tried using the @types/xxxx package 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).

Mention the authors (see Definitions by: in index.d.ts) so they can respond.

Authors: @martinduparc and @iPoul

The Settings should have a branding?: boolean property, as per the tinymce documentation: https://www.tinymce.com/docs/configure/editor-appearance/

Issue 2:
@andy-ms @tkrotoff @zaggino @micksatana @alex3165

I have this issue on SO:

https://stackoverflow.com/questions/49260387/express-router-file-has-a-typescript-error/49260575

I have a case where this doesn't compile:

import * as express from 'express';
let router = express.Router();
export = router;

but this does:

import * as express from 'express';
let router = express.Router() as express.Router;
export = router;

seems superfluous and I am trying to figure out if it can be fixed.
Issue 1:
>>> df = pd.DataFrame([[1, 2], [3, 4]], columns=['a', 'b'])
>>> ar = np.array(0)
>>> df.iloc[ar]
Traceback (most recent call last):
...
...
File "/home/float2/Documents/Python/Pandas/pandas/pandas/core/indexes/base.py", line 529, in _shallow_copy_with_infer
if not len(values) and 'dtype' not in kwargs:
TypeError: object of type 'numpy.int64' has no len()

A 0-d array passes this check cause it is an Iterable. But later, when len() is called on, TypeError is raised.

It would be nice to implement PEP 357 to prevent this error.

The matter has been raised at PyTorch project. #9237

Issue 2:
Code Sample, a copy-pastable example if possible

The code below works correctly.

df=pd.DataFrame([[1,2],[3,4]])
df.iloc[np.array([0])]

But the code below raises an error.

df.iloc[np.array(0)]

TypeError: object of type 'numpy.int64' has no len()