WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
var htmlElement:HTMLElement = getElement()

//
var offsetParent = htmlElement.offsetParent;
if(offsetParent instanceof HTMLElement){
htmlElement = offsetParent; // OK!
}

// alternatively this will cause an error:
if(htmlElement.offsetParent instanceof HTMLElement){
htmlElement = htmlElement.offsetParent; // ERROR: Assigned expression type Element is not assignable to type HTMLElement
}

Issue 2:
This is a proposal for using property access as another form of type guards (see #900) to narrow union types. While we're investigating expanding the power of type guards (#1007) this feature would support the natural style that JavaScript programmers have in their code today.

Using property access to narrow union types

var x: string|number;
if (x.length) { // no error even though number lacks a length property
var r = x.charAt(3); // x is of type string inside this block
}

var r2 = x.length || x * x; // no error, x narrowed to number on right hand side, r3 is number

var y: string[]|number[]|string;
if (y.length && y.push) {
// y is string[]|number[] now
var first = y[0]; // first is string|number
if (first.length) {
// first is string in here
} else {
// first is number in here
}
}

We do not expand the situations in which types are narrowed, but we do expand the known type guard patterns to include basic property access. In these narrowing contexts it would be an error to access a property that does not exist in at least one of the constituent types of a union type (as it is today). However, it would now be valid to access a property that exists in at least one, but not all, constituent types. Any such property access will then narrow the type of the operand to only those constituent types in the union which do contain the accessed property. In any other context property access is unchanged.

Invalid property access

var x: string|number;

var r = x.length; // error, not a type guard, normal property access rules apply

if (x.len) { } // error, len does not exist on type string|number

var r3 = !x.len && x.length; // error, len does not exist on type string|number

var r4 = x.length && x.len; // error, len does not exist on type string

Issues/Questions

Should the language service behave differently in these type guard contexts? Should dotting off a union type in a type guard list all members on all types rather than only those that exist on all of them?

Need to understand performance implications

I have a sample implementation and tests in a branch here: https://github.com/Microsoft/TypeScript/tree/typeGuardsViaPropertyAccess. There're a couple bugs remaining but examples like the above all work and no existing behavior was changed.
Issue 1:
Bug report

Bug summary

When an axis is shared with another its registered "xlim_changed" callbacks does not get called when the change is induced by a shared axis (via sharex=).

In _base.py the set_xlim for sibling axis are called with emit=False:

matplotlib/lib/matplotlib/axes/_base.py:

/.../
def set_xlim(...)
/.../
if emit:
self.callbacks.process('xlim_changed', self)
# Call all of the other x-axes that are shared with this one
for other in self._shared_x_axes.get_siblings(self):
if other is not self:
other.set_xlim(self.viewLim.intervalx,
emit=False, auto=auto)

I'm very new to matplotlib, so perhaps there is a good reason for this? emit=False seems to disable both continued "inheritance" of axis (why?) and triggering of change callbacks (looking at the code above).

It seems like one would at least want to trigger the xlim_changed callbacks as they would be intended to react to any change in axis limits.

Edit: Setting emit=True seems to introduce a recursion issue (not sure why but as inheritance seems to be passed along anyway it doesn't really matter). Moving the callback call to outside of the "if emit:"-statement seems to solve the issue as far as I can see when trying it out. Any reason to keep it inside the if-statement?

Issue 2:
When I saving a SVG figure is slowed down significantly (10-100x) when I use LaTeX, enabled by the following rc-setting:

text.usetex : true

Note that rendering is somewhat slower, but not much. It is really the saving. I am on macOS 10.12.6 with matplotlib (2.1.0).
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Using previous releases of Next.js build time for pages in development mode as been more or less instant (taking at most a second or two to build a page for the first time, with changes being hot reloaded instantly).

Current Behavior

When using Next.js 5.0 build times for pages in development mode are much slower, often taking several (e.g. 5-10) seconds both for initial page build and for a change to be hot reloaded.

I am seeing this same issue across multiple codebases, and someone has raised it as a performance issue against nextjs-starter project, which recently upgraded to 5.0: iaincollins/nextjs-starter#67

Steps to Reproduce

Clone example project 'https://github.com/iaincollins/nextjs-starter' and start with npm run dev.

Observe performance building pages with Next.js 5.

Stop it and run npm i next@4.2.3 --save and start again with npm run dev.

Observe much better performance building pages.

Context

I don't see this issue on very small sites (4-5 pages, no components) but I see it across all production Next.js sites I run, so it's not just project specific for me.

I appreciate it might still be something specific I am doing in those projects, or perhaps just because they all have more components involved.

I'm not sure how best to investigate what's causing this (and was a bit uncomfortable raising an issue without a better understanding of how to diagnose it) but as the performance is fine with Next.js 4, it seemed worth raising as an issue as I assume I'm not the only one impacted and if there are things I'm doing that can be avoided to improve performance then it's good to know what they are for others too.

Your Environment

Tech
Version

next
5.0

node
7.10.1

OS
macOS 10.13.2

browser
Chrome, Safari

Issue 2:
Feature request

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

I'm currently struggling to find a good way to always keep the scroll height when navigating between 2 pages. It would be great to find a document explaining or an example. The component is being unmounted automatically. Which shouldn't be the case in my opinion?

Describe the solution you'd like

A. Make sure the component stays alive when navigating from and to component. So the scroll height will be on the same spot.

Describe alternatives you've considered

On navigation, I'm currently scrolling towards the correct scrollheight, but with inconsistent behaviour.
Issue 1:
Please:

Check for duplicate requests.

Describe your goal, and if possible provide a code snippet with a motivating example.

I would like to have a warning that tells me that I should consider increasing the value of max_squarings when expm outputs nan values. For example Warning: expm outputs is nan because max_squarings was reached. Consider increasing max_squarings in order to solve this problem.

I had this issue and did not realize that it was the cause of my problem (see this).

Typically this would be useful in this example:

import jax
import jax.numpy as jnp
from jax.scipy.linalg import expm as jexpm

dimension_x = 10
t = 1e6

# the jax way
sqrt_H = jax.random.normal(jax.random.PRNGKey(1), (dimension_x, dimension_x))
H = jnp.dot(sqrt_H, sqrt_H.T)
print(jexpm(-t*H))

Issue 2:
The following code does not work,

class Foo:
@jax.jit
@staticmethod
def foo(x):
return x * 2

with an error TypeError: Expected a callable value, got <staticmethod object at 0x7fe007e767f0>. This is because a staticmethod is NOT a callable, until Python 3.10. Of course, staticmethod is callable -- something we can call.

In #1251 one possible workaround is suggested:

class Foo:
@functools.partial(jax.jit, static_argnums=(0,))
def foo(self, x):
# this function should not make use of `self` to be pure-functional
return x * 2

which is a bit ugly, but basically does the same thing as long as self is not used.

I don't see any reason staticmethod cannot be jit-ed as other non-method functions. I think this is just a matter of extending _check_callable(fun) to support staticmethods (which will happen automatically in Python 3.10); any pitfalls I would've missed?
Issue 1:
Hey there -- I have a plugin (flutter_stetho) that should be used only during development for inspecting Network requests and Databases for Flutter apps.

I ask users to use a main.dart and main_dev.dart so they can instantiate the code only during their dev process, and to include the plugin only in the dev_dependencies section in the pubspec.yaml file.

However, if you build the app in production mode using the main.dart entry point, I believe the Dart code will be properly removed / tree shaken, but the Android plugin code is still being shipped. That makes the app size larger, and potentially makes Stetho a security risk (might accidentally allow users to inspect the Database or network requests)

Is there a way for plugin authors to indicate to Flutter: "Hey, only include this Android/iOS for Dev builds, but not for production builds"?

Also, more of a General Question: I was a bit confused as to why dev_dependencies are being included in Production builds at all. Is this by design? If so, could you describe why / when those are included?

Issue 2:
Use case

I'm maintaining a package providing bindings to sqlite via dart:ffi. For Android apps, we need to compile sqlite3 as a dynamic library that gets put into the apk. For iOS and non-Flutter Dart apps, we use the sqlite3 library from the system, if available.

Since dart:ffi is still in an early stage, many users want to use native bindings for tests only, and use another package like sqflite for production. Unit tests are run on a desktop machine, so we don't compile any native libraries and instead use the one from the system. Unfortunately, the Flutter tool will include the native build script even if the package is just a dev_dependency. This means that native libraries are added into the built apk for no reason, but are still increasing app size.

Proposal

The dev_dependecies section of a pubspec indicates that a package is only used for development. So, I believe that the Flutter tool should not view packages in dev_dependencies as a native package and not run their native buildscripts when using flutter run or flutter build.
Issue 1:
I would like to describe a snippet where at a certain tab stop there is a finite list of possible values. They should show up from the intellisense widget.

Alternatively being able to describe that intellisense should popup once you tab into a tab stop would also work for me.

@aeschli fyi

Issue 2:
VSCode Version:

Version 1.9.0-insider

Commit 32222e2

Date 2016-12-16T07:18:07.856Z

Shell 1.4.6

Renderer 53.0.2785.143

Node 6.5.0

OS Version:

Ubuntu 14.04

Currently there is no way to specify a simple choices in the templates which makes developers life easy when expanding templates

For eg.,

For bootstrap buttons, there are almost 6 types. If we need to support templates for bootstrap button, we need to add either 6 templates/a single template with the template variable class's default value as

<button class="btn btn-${1:default|primary|secondary|info|warning|danger}">$2</button>

While selecting this template, the user needs to delete the complete selection & type the required choice/selectively delete portions of this default value.

Instead, if snippets consider any value with pipe| separators to be choice & display a dropdown, then the user just need to use his up & down arrows in the keyboard/mouse click to select the actual choice.

This will improve the user experience for expanding templates significantly & improve developer productivity.
Issue 1:
On all pages that have an embedded html editor, there is a bug where, when you put your cursor on a given line and try to edit (add a character, delete a character etc), the modification is applied to the next line instead of the line where the cursor is located.

Challenge Name

https://www.freecodecamp.com/challenges/line-up-form-elements-responsively-with-bootstrap

Issue Description

Occurred on all pages having an embedded html editor. To reproduce, place cursor on a given line a press a key to insert a character a the cursor position, the character will be added to the next line.

Browser Information

firefox 47.0

Ubuntu 14.04

Desktop

Issue 2:
Challenge Name

Issue Description

Browser Information

Browser Name, Version:

Operating System:

Mobile, Desktop, or Tablet:

Your Code

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

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.8

Operating System version: macos

Java version: 1.8

I looked at the source code of ClassUtils.convertPrimitive，In my opinion, it would be better to use Converter to optimize this conversion.

source code:

public static Object convertPrimitive(Class<?> type, String value) {
if (value == null) {
return null;
} else if (type == char.class || type == Character.class) {
return value.length() > 0 ? value.charAt(0) : '\0';
} else if (type == boolean.class || type == Boolean.class) {
return Boolean.valueOf(value);
}
try {
if (type == byte.class || type == Byte.class) {
return Byte.valueOf(value);
} else if (type == short.class || type == Short.class) {
return Short.valueOf(value);
} else if (type == int.class || type == Integer.class) {
return Integer.valueOf(value);
} else if (type == long.class || type == Long.class) {
return Long.valueOf(value);
} else if (type == float.class || type == Float.class) {
return Float.valueOf(value);
} else if (type == double.class || type == Double.class) {
return Double.valueOf(value);
}
} catch (NumberFormatException e) {
return null;
}
return value;
}

Modify as follows:

public static Object convertPrimitive(Class<?> type, String value) {
if (value == null) {
return null;
}
Object result = null;
try{
result = converter.convertIfPossible(value, type);
}catch(Exception e){
result = null;
}
return result;
}

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

I have checked the FAQ of this repository and believe that this is not a duplicate.

Environment

Dubbo version: 2.7.4.1

Operating System version: windows 10

Java version: 8

Steps to reproduce this issue

自定义filter类，同时实现Filter和Filter.Listenerl类，无法编译。
Issue 1:
I feel like this a duplicate issue, but I could not find it. A little ironic I guess.

julia> @code_warntype match(r"([M,G])([0-9.])+", "foo")
Variables:
r::Regex
s::ASCIIString

Body:
begin # regex.jl, line 134:
GenSym(2) = box(Int32,checked_trunc_sint(Int32,0))
GenSym(8) = (top(getfield))(s::ASCIIString,:data)::Array{UInt8,1}
return match(r::Regex,$(Expr(:new, :((top(getfield))(Core,:UTF8String)::Type{UTF8String}), :((top(convert))(Array{UInt8,1},GenSym(8))))),1,GenSym(2))::Union(RegexMatch,Void)
end::Union(RegexMatch,Void)

This behavior is documented, but I feel like it should not be the default for performance reasons. This seems like a use case for Nullables.

Issue 2:
I'm using a 32-bit Windows build (MinGW, source pulled 6-Aug-13) on Windows 8.

I wanted to try out the new built-in profiler so, following the example in the manual, I defined myfunc.jl as:

function myfunc()
A = rand(100, 100, 200)
max(A)
end

and ran the following

julia> require("myfunc.jl")

julia> @profile (for i=1:100; myfunc(); end)
@profile (for i=1:100; myfunc(); end)

julia> Profile.print();
Profile.print();
516 client.jl; _start; line: 372
516 client.jl; run_repl; line: 166
516 client.jl; eval_user_input; line: 91
516 profile.jl; anonymous; line: 1
2 ...r\bin\myfunc.jl; myfunc; line: 2

julia>

However, this doesn't look quite right, in particular all traces except two seem to vanish into thin air after profile.jl.

Any ideas what's happening and/or how to debug it further?
Issue 1:
When resizing chrome, class in does not go away after the navbar is big enough.

Issue 2:
Currently this is duped a few times over: #11243, #11301, and #11382—but the issue is described differently everywhere. This should clear things up and help us figure out what to do to fix it.

Problem

Starting with a narrow viewport, one with the collapsed navbar contents, open the menu, then resize to full-width with all navbar contents visible. Shrinking the viewport back to the narrow size still shows the un-collapsed navbar contents.

(Btw, this is currently visible in the docs.)

Why this happens

We're using the collapse plugin to do this. Right now it has no idea about the dimensions of your viewport. All it does is toggle the appropriate classes based on clicks—click to open, click to hide.

Our CSS utilizes those changes in classes from the plugin to style the menu accordingly. The CSS has no way to remove the .in class that the JS adds.

Fix

We need the JS plugin to be updated to detect the viewport changes and remove the class. I don't know when or how this could happen, but that's the only solution. Will need to hear from @fat or anyone else with more JS-fu.
Issue 1:
I get this error each time I open Visual Code.

[c:/Program Files/Microsoft VS Code/resources/app/extensions/csharp-o]: Cannot read file c:/Program Files/Microsoft VS Code/resources/app/extensions/csharp-o/package.json: ENOENT: no such file or directory, open 'c:\Program Files\Microsoft VS Code\resources\app\extensions\csharp-o\package.json'

Issue 2:
Looking into repository, there is no longer folder named csharp-o.

I manually deleted the folder and restarted vscode and issue is gone. So, problem looks like installer not removing that file.
Issue 1:
To create a setup where:

There are multiple worker processes on different servers.

Using multiple threads in each worker process.

Then one currently needs to jump through some hoops to setup the JULIA_NUM_THREADS environment variable for each worker process. Thus one can't use a simple addprocs with something like SshClusterManater. A possible workaround is writing a shell script which sets the environment variable and launches julia and specify this as the Julia executable.

It would be much more convenient and natural if julia provided a command line option for specifying the number of threads. If such a command line option is explicitly specified, it should override the value of JULIA_NUM_THREADS, if any.

This setup is useful because the threads within each worker process automatically share "everything" without having to resort to constructs like SharedArray. Of course this also means one needs to be more careful.

Issue 2:
I like the environment variable JULIA_NUM_THREADS, but it should be overridable with a -t(hreads) choice. If -p works, -t could reasonably do this, too.
Issue 1:
Preflight Checklist

I have read the Contributing Guidelines for this project.

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

Issue Details

Electron Version:

6.0.5

Rejection Email

Dear Developer,

We identified one or more issues with a recent delivery for your app, "ProDoctor Cloud Consultórios" 1.0.5 (867). Please correct the following issues, then upload again.

ITMS-90338: Non-public API usage - The app references non-public symbols in Contents/Frameworks/Electron Framework.framework/Versions/A/Electron Framework: _fileport_makefd, _fileport_makeport. If method names in your source code match the private Apple APIs listed above, altering your method names will help prevent this app from being flagged in future submissions. In addition, note that one or more of the above APIs may be located in a static library that was included with your app. If so, they must be removed. For further information, visit the Technical Support Information at http://developer.apple.com/support/technical/

Best regards,

The App Store Team

Issue 2:
Electron Version: 3.0.0-beta.1

Operating System (Platform and Version): macOS 10.13

Last known working Electron version: 2.0

Expected Behavior

Clicking a link in a webview should navigate to that page.

Actual behavior

When I click a link inside a webview, the webview freezes completely. However, the webview devtools appear to work correctly, so it appears that the page is actually being loaded, and just not being displayed.

To Reproduce

<!DOCTYPE html>
<html>
<head>
</head>
<body>
<webview src="https://electronjs.org/"/>
</body>
</html>
Issue 1:
I think the following should compile with no error:

declare module Backbone {
interface RoutesHash {
[routePattern: string]: string | {(...urlParts: string[]): void};
}
class Events { }
class Router extends Events {
routes: RoutesHash;
}
}

declare module Marionette {
class AppRouter extends Backbone.Router {
}
}

module Backbone.Tests {
// Error, routes is not contextually typed
class MyRouter extends Backbone.Router {
routes = {
"some/route": "someMethod",
"some/otherRoute": () => {}
};
}
}

module Marionette.Tests {
// Error, routes is not contextually typed
class MyRouter extends Marionette.AppRouter {
routes = {
"some/route": "someMethod",
"some/otherRoute": () => {}
};
}
}

Issue 2:
When a property has exactly one type from an extends or implements clause, we should contextually type that property's initializer by the type from the clause. For example:

interface ThingListener {
handleEvent: (x: MouseEvent) => void;
}

class Foo implements ThingListener {
handleEvent = x => {
// No error, but this code is incorrect
console.log(x.timestamp);
}
}

Ideally we could take this one step further when widening. The following behavior is also undesirable:

interface HasLength {
length: number
}

class Foo implements HasLength {
// length: any, not really what we intended
length = undefined;
}

var x = new Foo();
x.length = 'wat'; // should not be allowed

e.g. #3666
Issue 1:
It would be great if TypeScript had support for wrapping generated AMD/commonjs module declarations inside a toplevel "external" module, e.g.

tsc -d -m commonjs -mname test src/test.ts --outDir out

would result with out/test.d.ts containing

declare module "test" {
// entire .d.ts file goes here
export ...
}

Currently I do this manually with a quick and hacky tool I wrote which seems to work correctly so far for my limited needs

Issue 2:
Sorry if this is a duplicate - I'd imagine someone else has asked the same thing - but the absence of a node-facing require'able API has other tools like tern requiring files within typescript, and these files predictably move and break those tools.
Issue 1:
The instructions of the waypoint read "Nest one div element with the class well within each of your col-xs-6 div elements." Which I understand it requires something like this:

<div class="col-xs-6">
<div class="well"></div>
</div>
<div class="col-xs-6">
<div class="well"></div>
</div>

However the first test require "Add two div elements inside your div class="well"> element both with the class col-xs-6" which I understand is asking this:

<div class="well">
<div class="col-xs-6"></div>
</div>
<div class="well">
<div class="col-xs-6"></div>
</div>

In other hand, that very test is fulfilled by just nesting one "well" div inside one of the "col-xs-6" (see the screenshot below).

Waypoint URL:

http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells

Issue 2:
Challenge http://www.freecodecamp.com/challenges/waypoint-create-bootstrap-wells has an issue. Please describe how to reproduce it, and include links to screenshots if possible.