WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I wish I could turn duck-typing off sometimes because it leads to bugs that very hard to detect.

For example:

Suppose I have 2 interfaces with the same surface but completely unrelated sematics:

interface Chicken {
id: number;
name: string;
}

interface JetPlane {
id: number;
name: string;
}

then doing the following is completely fine in TypeScript:

var chicken : Chicken = { id: 1, name: 'Thomas' };
var plane: JetPlane = { id: 2, name: 'F 35' };
chicken = plane;

I wish there was an option to prevent such assignment from being valid.

Issue 2:
Proposal: support non-structural typing (e.g. new user-defined base-types, or some form of basic nominal typing). This allows programmer to have more refined types supporting frequently used idioms such as:

Indexes that come from different tables. Because all indexes are strings (or numbers), it's easy to use the an index variable (intended for one table) with another index variable intended for a different table. Because indexes are the same type, no error is given. If we have abstract index classes this would be fixed.

Certain classes of functions (e.g. callbacks) can be important to be distinguished even though they have the same type. e.g. "() => void" often captures a side-effect producing function. Sometimes you want to control which ones are put into an event handler. Currently there's no way to type-check them.

Consider having 2 different interfaces that have different optional parameters but the same required one. In typescript you will not get a compiler error when you provide one but need the other. Sometimes this is ok, but very often this is very not ok and you would love to have a compiler error rather than be confused at run-time.

Proposal (with all type-Error-lines removed!):

// Define FooTable and FooIndex
nominal FooIndex = string; // Proposed new kind of nominal declaration.
interface FooTable {
[i: FooIndex]: { foo: number };
}
let s1: FooIndex;
let t1: FooTable;

// Define BarTable and BarIndex
nominal BarIndex = string; // Proposed new kind of nominal declaration.
interface BarTable {
[i: BarIndex]: { bar: string };
}
let s2: BarIndex;
let t2: BarTable;

// For assignment from base-types and basic structures: no type-overloading is needed.
s1 = 'foo1';
t1 = {};
t1[s1] = { foo: 1 };

s2 = 'bar1';
t2 = { 'bar1': { bar: 'barbar' }};

console.log(s2 = s1); // Proposed to be type error.
console.log(s2 == s1); // Proposed to be type error.
console.log(s2 === s1); // Proposed to be type error.

t1[s2].foo = 100; // Gives a runtime error. Proposed to be type error.
t1[s1].foo = 100;

function BadFooTest(t: FooTable) {
if (s2 in t) { // Proposed to be type error.
console.log('cool');
console.log(t[s2].foo); // Proposed to be type error.
}
}

function GoodBarTest(t: BarTable) {
if (s2 in t) {
console.log('cool');
console.log(t[s2].bar);
}
}

BadFooTest(t1); // Gives runtime error;
BadFooTest(t2); // No runtime error, Proposed to be type error.
GoodBarTest(t1); // Gives runtime error; Proposed to be type error.
GoodBarTest(t2);
Issue 1:
This might be a duplicate of #801 but I don't think so.

I'm trying to import seaborn into iPython, however I get this error:

%matplotlib inline
import numpy as np
import matplotlib.pyplot as plt
import seaborn;
from sklearn.linear_model import LinearRegression
from scipy import stats
import pylab as pl

---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-5-e3d40abd657b> in <module>()
2 import numpy as np
3 import matplotlib.pyplot as plt
----> 4 import seaborn;
5 from sklearn.linear_model import LinearRegression
6 from scipy import stats

ImportError: No module named seaborn

I can import seaborn into my python shell, but not into iPython.

Suggestions?

Issue 2:
I'm wondering if anyone else is seeing this error when trying to use one of the color palette choosing widgets:

%matplotlib inline
import seaborn as sns
import maptlotlib.pyplot as plt
sns.choose_colorbrewer_palette('sequential')

/Users/drew.okane/anaconda/envs/deo-env/lib/python2.7/site-packages/IPython/html.py:14: ShimWarning: The `IPython.html` package has been deprecated. You should import from `notebook` instead. `IPython.html.widgets` has moved to `ipywidgets`.
"`IPython.html.widgets` has moved to `ipywidgets`.", ShimWarning)
---------------------------------------------------------------------------
ImportError Traceback (most recent call last)
<ipython-input-2-b527a7d9da9b> in <module>()
----> 1 sns.choose_colorbrewer_palette('sequential')

/Users/drew.okane/anaconda/envs/deo-env/lib/python2.7/site-packages/seaborn/palettes.pyc in choose_colorbrewer_palette(data_type, as_cmap)
1011
1012 """
-> 1013 from IPython.html.widgets import interact, FloatSliderWidget
1014
1015 if data_type.startswith("q") and as_cmap:

ImportError: cannot import name FloatSliderWidget

There seem to be two issues here. One, imports seem to need to come from ipywidgets now, and two, FloatSliderWidget doesn't exist anymore.
Issue 1:
I've encountered the structure below in the wild. Although I don't know whether it's valid Yaml, Ruby's parser and the Yaml PECL extension allow it.

test: "Probably not the right
way to wrap a string,
but it parses with Ruby
and the PECL extension."

I get a parse error "Malformed inline YAML string"

Issue 2:
The YAML specification has the following example for a multi line message in double quotes:

quoted: "So does this
quoted scalar.\n"

Write that in a MultilineDoubleQuotedMessage.yml and try to Yaml::parse('MultilineDoubleQuotedMessage.yml') - Symfony will throw an exception like this:

Malformed inline YAML string ("So does this) in .../MultilineDoubleQuotedMessage.yml at line 1 (near "quoted: "So does this").

in .../symfony/symfony/src/Symfony/Component/Yaml/Inline.php at line 244

...

I tried that in Symfony 2.2.0 and 2.4.6, but the underlying issue seems to be the reg exp in https://github.com/symfony/symfony/blob/master/src/Symfony/Component/Yaml/Inline.php#L246 , which lives on in Symfony 2.5.0.

A unit test in Symfony\Component\Yaml\Tests\YamlTest could look something like this:

public function testParseAcceptsMultilineDoubleQuotedMessage()
{
$filename = __DIR__ . '/Fixtures/MultilineDoubleQuotedMessage.yml';
$this->setExpectedException(null);
Yaml::parse($filename);
}
Issue 1:
The TemplateNormalizer push the content of any <style> tag to the styles List discarding any media attribute (the same applies to <link rel="stylesheet">).

I guess we want to add support for that ?

This would need some thinking wrt to @import rules (i.e. it would not be possible to only add them to styleUrls when a media query applies).

Issue 2:
I have the following in a component template:

<style is='custom-style'>...</style>

which is transformed and inserted under the 'head' tag:

<style>...</style>

losing the "is='custom-style'" during the process.

This marker is needed by polymer.
Issue 1:
I'm submitting a ... (check one with "x")

[x] bug report => search github for a similar issue or PR before submitting
[ ] feature request
[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question

Current behavior

When building form inputs dynamically, if the type property for a radio button is a binding the radio inputs don't function correctly.

Expected behavior

The type binding for an input element is dynamically set to to radio and the form still functions.

Minimal reproduction of the problem with instructions

http://plnkr.co/edit/6mU55f?p=preview

Open the plunker

Note the first form with generated input fields and a type='radio' functions correctly

Note the second form with generated input fields and a type binding doesn't function correctly

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

Simple form generation with reuse of an input element while providing different type values.

Please tell us about your environment:

Angular version: 2.0.X

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 X.X | ES6/7 | ES5]

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

Issue 2:
in creating a options list that allows the user to change different settings i found a problem with the type checkbox . take this component

(function(app){
app.testing=ng.core.Component({
selector:"testing",
template:"<input type='checkbox' [(ngModel)]='testing'/>"+
"<template ngFor #item [ngForOf]='list'>"+
"<input [type]='item.type' [(ngModel)]='item.value'/>"+
"</template>"
}).Class({
constructor:[function(){
this.testing=true;
this.list=[
{type:"checkbox",value:true},
{type:"text",value:"hello world"}
];
}],
});
})(window.app||(window.app={}));

because of the ngFor loop combining with the dynamic setting of inputs and their types ngModel does not work on the second checkbox although it does on the first which is not dynamically set. im guessing this is a problem with how ngModel determines that the input is type checkbox. a example of this can be found here

sorry to those of you who work in typescript i was not able to use typescript so it is in plain es5. i hope you can still interpret what its meaning and maybe someone can translate it to typescript.
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

As per the documentation, one should be able to:

import { Slide } from 'material-ui/transitions'

const { Slide } = require('material-ui/transitions')

import { Slide } from 'material-ui'

Current Behavior

At present, none of these behave as expected as the transitions in question are not exported correctly. The only way to require a transition is to invoke it directly due to missing an index file, i.e. const Slide = require('material-ui/transitions/Slide')

Steps to Reproduce (for bugs)

https://codesandbox.io/s/lxlwxmr479

Attempt to import the Slide transition as per documentation:

Observe that it fails to require that dependency

Tech
Version

Material-UI
Affects v1.0.0-beta.19, v1.0.0-beta.20

Issue 2:
Problem description

I have a responsive layout for Stepper in which if the media query is mobile size it will have a vertical orientation and if tablet and above will render a horizontal orientation. The problem is that Stepper component will issue an error if I will place a conditional statement on StepContent and if I don't an annoying warning will be shown on console. I know this will be removed in production but it shows an annoying warning when doing unit tests.

Link to minimally-working code that reproduces the issue

<Stepper activeStep={stepIndex} orientation={isVertical ? 'vertical' : 'horizontal'} linear={false}>
<Step>
<StepButton onTouchTap={() => this.setState({stepIndex: 0})}>User</StepButton>
{isVertical &&
<StepContent>
{getContent(stepIndex)}
</StepContent>
}
</Step>
</Stepper>

Error

Versions

Material-UI: Latest

React: Latest

Browser: All
Issue 1:
Keesun Baik opened SPR-6567 and commented

Why don't you add AnnotationContextLoader that supports annotation configuration based TestContext.

for example. If there is an annotation configuration like this

@Configuration

public class SpringAnnotationConfigTestAppConfig {

@Bean
public String name(){
return "keesun";
}

}

and, at the same package, I can make test like this.

@RunWith(SpringJUnit4ClassRunner.class)

@ContextConfiguration(loader = AnnotationContextLoader.class, locations = {"."})

public class SpringAnnotationConfigTest {

@Autowired ApplicationContext ac;
@Autowired String name;

@Test
public void di(){
assertNotNull(ac);
assertThat(name, is("keesun"));
}

}

then, conventionally SpringJUnit4ClassRunner finds SpringAnnotationConfigTest + "AppConfig.java" for an annotation configuration.

Of course, It makes sence that we sould use 'locations' attribute of @ContextConfigruation like these.

@ContextConfiguration(loader = AnnotationContextLoader.class, locations = {"/sandbox/springtest/sample/SpringAnnotationConfigTestAppConfig.java"})

@ContextConfiguration(loader = AnnotationContextLoader.class, locations = {"/sandbox/springtest/sample/"})

@ContextConfiguration(loader = AnnotationContextLoader.class, locations = {"/sandbox/springtest/sample"})

@ContextConfiguration(loader = AnnotationContextLoader.class, locations = {"./SpringAnnotationConfigTestAppConfig.java"})

@ContextConfiguration(loader = AnnotationContextLoader.class, locations = {"./"})

@ContextConfiguration(loader = AnnotationContextLoader.class, locations = {"."})

with '.Java' locations can be used to AnnotationConfigurationApplicationContext.regist(), and without '.java' locations will be used to AnnotationConfigurationApplicationContext.scan().

What do you think about this?

Affects: 3.0 RC3

Attachments:

AnnotationContextLoader.java (5.89 kB)

AnnotationContextLoaderTest.java (1.95 kB)

SpringAnnotationConfigTest.java (1.61 kB)

SpringAnnotationConfigTestAppConfig.java (476 bytes)

Issue Links:

#10852 Provide TestContext support for @Configuration classes ("duplicates")

3 votes, 5 watchers

Issue 2:
Jeff Sanders opened SPR-9837 and commented

"http-0.0.0.0-8080-7":at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:184) - waiting to lock <455368173> (a java.util.concurrent.ConcurrentHashMap@1b245ded ) which is held by http-0.0.0.0-8080-4

The above error happens a few times and stops the Web App from processing. We have to restart JBoss to get the app back up and processing requests.

Affects: 3.2 M1, 3.2 M2

Attachments:

deadlock info Document1.txt (1.94 kB)

Issue Links:

#13117 Performance bottleneck and potential thread deadlock in DefaultSingletonBeanRegistry ("duplicates")

0 votes, 5 watchers
Issue 1:
Version

2.5.17

Reproduction link

https://codepen.io/anon/pen/EOaXpd

Steps to reproduce

打开chrome dev tool

点击页面的add按钮

控制台会打印三个updated

What is expected?

最终值没有改变的情况下组件不需要重新渲染

What is actually happening?

最终值没有改变的情况下组件重新渲染了

2.5.17-beta已经没有这个问题了，什么时候会添加到正式版？

Issue 2:
as you can see,i repeatly defined the methods option twice

so the last one will overwrite the first one

but,there will be no warning for that

i didn't know what is the matter when there was an error said that handleFoo is not defined

cause of actually i did have defined it
Issue 1:
Hello,

I am trying to load vtk files in three.js using the VTKLoader. I just modified the file "webgl_loader_vtk.html" and replace the original file "bunny.vtk" with my own vtkdata.

The vtk file is produced by paraview.

But the loader fails and there is no data shown in browser (no error shown). I trid to use "console.log(geometry)" and found no data in it.

You can click this link to get the vtk file.

Any suggestion?

Thank you!

Issue 2:
Hello,

I am trying to load vtk files in three.js using the VTKLoader. The vtk files are produced by paraview. However, the loader fails silently and no vtk data is shown on the browser.

Any suggestion?

Thank you!
Issue 1:
Issue originally made by @track0x1

Bug information

Babel version: Latest

Node version: 4

Input code

export { myFunction } from 'functions'

transpiles to:

Object.defineProperty(exports, 'myFunction', {
enumerable: true,
get: function get() {
return _functions.myFunction;
}
});

which creates an issue because getters are not supported in IE8, therefore breaking IE8.

Description

Issue 2:
Issue originally made by @timdorr

Bug information

Babel version: 6.7.7

Node version: 5.5.0

npm version: 3.8.7

Options

{
"presets": ["es2015-loose", "stage-1", "react"],
"plugins": [
"transform-es3-member-expression-literals",
"transform-es3-property-literals"
]
}

Input code

export { foo, bar } from './baz'

Description

Apologies if this has been discussed before. T2322 is tangentially related and fixed by add-module-exports.

When using the above input code, you get something like this as output:

var _baz = require('./baz');

Object.defineProperty(exports, 'foo', {
enumerable: true,
get: function get() {
return _baz.foo;
}
});
Object.defineProperty(exports, 'bar', {
enumerable: true,
get: function get() {
return _baz.bar;
}
});

While core-js/babel-polyfill can add in defineProperty support, it cannot do getters. I'm not sure why defineProperty is used, so pardon my ignorance if I'm missing something super-obvious. But can't a simple property assignment be used instead? It's enumerable anyways, so I'm not sure of the practical difference.

It appears the code template remains untouched since the original 6.0.0 release, so perhaps it needs to be touched up a bit? I'm happy to submit a PR.
Issue 1:
cli/js/ directory holds all of internal runtime code. Due to the way we ship the code, we ended up with situation where some of the docstrings are duplicated in declaration files (lib.deno.ns.d.ts, et al) as well as implementation files. It's mundane and error-prone to synchronise them manually so until we bring back auto-generation of declaration files docstrings should be removed from implementation code (that means docstrings should be left only in declaration files).

Issue 2:
There is a thread about limiting --allow-env variables to some explicit keys.

#3137

This issue is a bit different. Instead of allowing access to environment at runtime at all, the user should be able to provide environment values during startup with the --env flag --env SECRET=secret. If possible, it would be great to have the ability to use it multiple times (in multiple lines) like the -e from Docker

deno run \
--allow-net \
--env SECRET=$SOME_SECRET \
--env OPTION_X=true \
--env URL \ # provide systems variable
main.ts

Pros: All Env are still protected

Cons: immutable. To have access to new values, one would need to restart the program. (lets call it a feature)
Issue 1:
Description

DecisionTreeClassifier builds overtly complicated trees (assuming splitter=’best’) as on the example below. The tree used as an example could be easily pruned to two decision nodes. Pruning wouldn't affect the results when using splitter=’best’, but would improve readability of the results (and possibly performance, since smaller number of decisions need to be made) to great extent.

Expected Results

The pruning could happen either automatically, on the stage of building the tree, or via external prune() function. I guess that someone could argue that setting the splitter argument should not affect how the tree is build and otherwise it could be seen as inconsistent behaviour, but this souldn't be a problem if it was properly documented.

Issue 2:
I frequently get asked about post-pruning. Often using single trees is important for interpretability, and post-pruning can help both interpretability and generalization performance.

[I'm surprised there is no open issue on this, but I couldn't find one]
Issue 1:
Below is my code:

var app = require('app');
var ipc = require('ipc');
var BrowserWindow = require('browser-window');
var settings = require('./settings');

var mainWindow = null;

app.on('window-all-closed', function() {
if (process.platform != 'darwin') {
app.quit();
}
});

app.on('ready', function(){
var mainWindow = new BrowserWindow({
fullscreen: true,
autoHideMenuBar: true
})

mainWindow.loadUrl('file://' + __dirname + '/index.html') // FIRST WEBPAGE

mainWindow.on('closed', function() {
mainWindow = null;

});

ipc.on('redirect', function(){
mainWindow.loadUrl('http://192.168.1.10/page2') // SECOND WEBPAGE

mainWindow.webContents.on("did-fail-load", function() {
console.log("did-fail-load");

mainWindow.loadUrl('file://' + __dirname + '/index.html');
// REDIRECT TO FIRST WEBPAGE AGAIN
});

});

I will first go into the first webpage, then after it received a command "redirect" from the javascript using ipc module, it will redirect to a second webpage. But I need to check whether or not the second webpage can be connected. If it cannot be connected (did-fail-load), it will go to the first webpage again. And the cycles goes on.

I use the console.log("did-fail-load") to check whether or not it had failed to connect to the second page. But I found out that it had duplicated call. The first time it fail to connect to second webpage, there is one console.log("did-fail-load"), when it retry the second time, there is two console.log("did-fail-load") appear, and the 3rd time it retry, there is three console.log("did-fail-load") appear. Is it that it some how got duplicated calls on mainWindow?

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.

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

Issue Details

Electron Version:

8.2.0

Operating System:

Windows 10 Pro (1903)

Expected Behavior

'show' event on a BrowserWindow fires when a window is first shown on all platforms.

Actual Behavior

'show' event fires on mac, but not on win.

To Reproduce

fiddle gist: https://gist.github.com/5cae7ebca7c33226a49c06f6a177c258
Issue 1:
On the standard login form, using 'form_login' in security.yml, the CSRF feature can be disabled by removing the 'csrf_provider'. However this does not seem to be the case for the 'simple_form'. The only way I can remove the CSRF is by adding a 'csrf_protection' = false to the setDefaultOptions() of the FormType.

I'm not sure if this is intended behaviour or not, but messing about with firewall options from within a FormType (as in checking the csrf_provider status and programmatically disabling) could lead to a security breach.

Issue 2:
I've decided to use a model and a FormType for my Login form. This works great and is in my opinion a lot neater than the default approach in the docs (with the manually typed inputs etc...).

However, it seems to me that it's impossible to validate the form. By validating the form, I mean adding constraints on the Login model and having them validated with $form->handleRequest($request); if ($form->isValid()) .... This could be powerful as it would allow you firstly to make sure no empty credentials are checked and also because you could validate a username (e.g. it must be a valid email).

I'm going through the code and as far as I can tell Symfony/Component/Security/Http/Firewall/UsernamePasswordFormAuthenticationListener would have to be coupled with the form component. I understand why this is not the case at the moment.

Is it possible to create a different Listener, one that is coupled with the Form component?
Issue 1:
Just read about this new TypeScript feature and tried to use it in my project, but...

TypeScript Version:

1.8.9

Code

type T = {a:any} | {b:any};

let myObject:{c:T};

function hasA(value:T):value is {a:any}{
return 'a' in value;
}
if(hasA(myObject.c)){
myObject.c.a; // <- the error goes from here
}

Expected behavior:

No error.

Actual behavior:

Error:(24, 14) TS2339: Property 'a' does not exist on type '{ a: any; } | { b: any; }'.

Shouldn't it be considered as a bug?

Issue 2:
I just found out that property access expressions doesn't work on type predicate functions and instanceof type guards.

class A {
propA: number;
}

class B {
propB: number;
}
class C {
propC: A;
}

declare function isA(p1: any): p1 is D;

interface D {
a: A | B
b: A | C;
}

let d: D;
if (isA(d.b)) {
d.b.propA; //error
}

function foo(d: D) {
if (d.b instanceof A) {
d.b.propA // error
}
}

I'm not sure if there is an easy fix on this problem. We are provided just a symbol when narrowing. That symbol represent the left most expression and then we walk up the if statement. There is no easy way of controlling symbol by symbol on each namespace in a property access expression in the if-statement-body. Because there is no info about the property access expression provided in getTypeOfSymbolAtLocation(symbol: Symbol, node: Node).

I also found that type assertion expressions are also not working in type predicate functions. But I will land a fix on that.

if (isA(<A>union)) {
a = union;
}
if (isA(union as A)) {
a = union;
}