WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Error message says:

error TS2345: Argument of type 'Foo' is not assignable to parameter of type 'Foo'.

Given the exact same exported type, Typescript isn't able to deal with enums from multiple source locations. Here's an example with a Core project and a Bar project:

Core/
foo.ts
convertFooToString.ts
dist/
foo.js
foo.d.ts
convertFooToString.ts
convertFooToString.d.ts

Bar/
SomeComponent.tsx
dist/
SomeComponent.js
SomeComponent.d.ts

SomeComponent.tsx:

// some other imports
import {convertFooToString}
export default class SomeComponent extends React.Component<any, any> {
render() {
// Note, this.props.foo IS a Foo type
return (<div>{convertFooToString(this.props.foo)}</div>);
}
}

foo.ts:

enum Foo {
Yay = 0,
Nay = 1
};

export default Foo;

convertFooToString:

export function convertFooToString(foo: Foo): string {
switch (foo) {
case Foo.Yay:
return "YAYAYAYAYA";
default:
return "NANANANANA";
}
}

Issue 2:
The error relates to enums, and exports using the new typescript node resolution (with the typings property in the package.json). I have tested this on typescript@next.

The bug can be reproduced through the following scenario: (please go to https://github.com/christyharagan/typeScript-enum-export-bug to find this code):

Three projects: a, b, c.

b depends on a

c depends on b

a exports an enum through its index.ts:

export enum E{}

b then exports a function that returns E through its index.ts:

import {E} from 'a'
export function f():E {
return null
}

c then consumes f through its index.ts:

import {E} from 'a'
import {f} from 'b'

let e:E = f()

There is now an error for e:

Type 'E' is not assignable to type 'E'.

All three packages have a package.json that looks like this:

{
"name": "b",
"version": "1",
"main": "lib/index.js",
"typings": "lib/index.d.ts",
"dependencies": {
"a": "1"
}
}

And a tsconfig.json that looks like:

{
"compilerOptions": {
"declaration": true,
"module": "commonjs",
"rootDir": "./src",
"target": "es5",
"outDir": "./lib"
},
"files": [
"src/index.ts"
]
}

Furthermore, this defect occurs if f were to export another symbol (e.g. an interface) which references an exported enum somewhere within it's structure or hierarchy.

This only seems to affect enums, not other types.
Issue 1:
Website or app

https://github.com/Contrick64/scryfall-random

Repro steps

This error reproduces on initial page load. I can't seem to find what caused it to start showing up, as it points to a part of my code that has existed since well before I first got the error.

How often does this bug happen?

Every time

DevTools package (automated)

No response

DevTools version (automated)

No response

Error message (automated)

No response

Error call stack (automated)

No response

Error component stack (automated)

No response

GitHub query string (automated)

No response

Issue 2:
React version: V18.0.0

React router DOM: V5.2.1

Steps To Reproduce

Going to profile page

Warning: Internal React error: Expected static flag was missing. Please notify the React team.

Link to code example:

DynamicFilter.js component

The current behavior

The expected behavior
Issue 1:
josef betancourt opened SPR-2506 and commented

Some complex properties do not follow the get/set JavaBean spec. Thus, to wire these in with Spring is problematic. Whether Spring should support non-javabean accessors is of course a question. Anyway, there could be a way to explicitly specify these properties, for example:

<property method="addValue" value=doh"/>

or

<property method="addListener" ref=beanx"/>

Affects: 2.0 RC3

Issue Links:

#4961 Please improve BeanFactory support for containers & collections ("duplicates")

Issue 2:
Ben Hutchison opened SPR-230* and commented

Objects that contain other objects (common examples include Swing Containers and the Collections classes) frequently cannot have their initial state specified through setting javabeans properties alone.

This is a request for the spring core to include extensions to the syntax of the applicationContext.xml to allow such objects to be setup completely from XML. Some reasonably conveinient syntax is needed that allows methods like "add()" to be invoked on the bean at construction time. Ideally, I think the syntax should allow any arbritrary methods to be called on a bean during preparation.

There is a clear precendent to be found in the design of the java.beans.XMLEncoder/Decoder classes, designed to support long term bean perisstence. Consider the extract below generated by XML-serializing a List:

<?xml version="1.0" encoding="UTF-8" ?>

<java version="1.4.2_03" class="java.beans.XMLDecoder">

<object class="java.util.ArrayList">

<void method="add">

<string>item</string>

</void>

</object>

</java>

Evidently, it was recognized as an important feature as its present from the first release of the peristence mechanism.

Consider what is not readily doable from XML without this feature:

Cannot create any Swing component heirarchies.

Cannot initialize custom collections (ie anything not a vanilla set/map/list impl), unless it provides a copy-constructor.

Cannot init arbritrary state on objects which do not observe the get/setXXX convention (and legacy code is littered with them).

Affects: 1.0.2

Attachments:

SPR-230.patch (137.30 kB)

Issue Links:

#7195 Allow setting of properties without a javabean setter ("is duplicated by")

#7222 Support JavaBean Eventing methods in Spring ("is duplicated by")

#7488 "adder" injection in addition to "setter" (invoke addXX() instead of setXX()) ("is duplicated by")

#5727 support "add"-style List injection ("is duplicated by")

32 votes, 28 watchers
Issue 1:
Environment

Windows build number: 18363.836 (ver in PowerShell returned an error)
PowerToys version: 0.18.1
PowerToy module for which you are reporting the bug (if applicable): FancyZones

Steps to reproduce

maximize a window

press win+left/right arrow

Expected behaviour

Recently updated to v0.18.1 from ~v0.15ish. In previous versions, a maximised screen could snap to a zone simply by pressing win+left/right arrow.

Actual behaviour

In v0.18.1 I first need to press win+down to minimise the screen and then position it with win+left/right.

Questions

Not sure if this is an issue or just the new way it's working. Is this the desired behaviour?

Issue 2:
Environment

Windows build number: Version 10.0.19587.1000
PowerToys version: v0.16.1
PowerToy module for which you are reporting the bug (if applicable): FancyZones

Steps to reproduce

Configure FancyZones to "Override Windows Snap hotkeys"

Choose "Grid" as Zone layout

Maximize a Window using Win+Up. Window is then maximized.

Try to move the Window to the left zone using Win+Left

Expected behavior

Window is moved to the left zone.

Actual behavior

Nothing happens.

This issue refs #387

Screenshots

(Any maximized window - so not attaching a screenshot)
Issue 1:
🚀 Feature

Add nbytes and itemsize methods to Tensor. It has the same semantics as https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.ndarray.nbytes.html and https://docs.scipy.org/doc/numpy-1.15.0/reference/generated/numpy.ndarray.itemsize.html (though, in keeping with PyTorch style, it is a function call, not a property).

Motivation

The primary motivation is that caffe2::Tensor has these two methods, it's used somewhat frequently in the Caffe2 codebase, and it seems like a generally useful thing to have around.

Alternatives

Don't add them, and make users do the computation themselves. This might be a little annoying to do, because if we don't have itemsize() the user has to compute it themselves from the dtype.

Issue 2:
I am unable to use pytorch with CUDA despite having installed it.

OS: Windows 10

Pytorch Version: 1.1.0

CUDA Version: 10.0

I get the following error. Any help would be appreciated.
Issue 1:
Andrew Walters opened SPR-8992 and commented

Given:

@RunWith(SpringJUnit4ClassRunner.class)
@ActiveProfiles(profiles = "test")
@ContextConfiguration(classes = MyClass.class)
@ImportResource("/appContext.xml")
public class MyClass {
@Autowired
private ProfileSpecificResource resource;

@Bean
public String aBean() {...}

@Test
public void aTest() {...}
}

Spring is not cascading/passing through the active profile(s) down to the imported resource (where profile specific beans are defined).

If the tests are invoked with the -Dspring.profiles.active=test argument, the tests run as expected.

Affects: 3.1 GA

Issue Links:

#13685 @ActiveProfiles not taken into account for @ImportResource-imported XML context definitions from an @Configuration context definition ("is duplicated by")

#13040 AnnotatedBeanDefinitionReader's constructor should inherit Environment of supplied BeanDefinitionRegistry

Referenced from: commits ee36c80, b17d545

1 votes, 2 watchers

Issue 2:
Oliver Drotbohm opened SPR-9254 and commented

Imagine the following usage of the cache abstraction:

class MyComponent implements Component {

@Cacheable("myCache")
public Object myMethod(String key) {

}
}

Now assume the execution of myMethod(...) takes a huge amount of time (hence the caching in the first place). Now futher assume we access the method concurrently with two threads. With the current implementation of the cache interceptor works as follows:

thread 1 triggers the interceptor, we don't find a value for the key in the cache and thus invoke the method.

Now while the method invocation in thread 1 runs, thread 2 enters the interceptor with the same key, we don't find a value and re-trigger the method call

This is unfortunate as the second invocation is entirely obsolete as the second thread could just wait for the first invocation to succeed and use the value returned. Beyond that we might face this scenario in extended version as while the first thread calculates the value pretty much all threads invoking the method with the same key would re-trigger the calculation. So the longer the value calculation takes the more likely we will run into unnecessary duplicate invocations of the method.

So what I am suggesting is that we should keep track of actual method invocations by key and block all concurrent accesses to that cache value until the first thread calculating it has finished and let the other threads use that value then. The CacheBuilder API of the Google Guava project actually implements this out of the box.

Affects: 3.1.1

Issue Links:

#13942 Provide some synchronization between @Cacheable and @CacheEvict annotated methods

DATAREDIS-443 Support of synchronized mode introduced in Spring 4.3

#16165 Support of ehcache's BlockingCache

#18383 Better synchronization in ConcurrentMapCache

#18804 Allow @Cacheable method to return java.util.Optional variant of cached value

Referenced from: commits spring-projects/spring-data-redis@1f97623, spring-projects/spring-data-redis@ceccafb, spring-projects/spring-data-redis@5cc5da9, spring-projects/spring-data-redis@a03c444

17 votes, 25 watchers
Issue 1:
Additional information on Closed issue #8145 (I don't think I have permission to re-open)

TypeScript Version:

1.8.9

Thanks for investigating.

I noticed you are using tsc v1.8.10 to try to reproduce.

My globally-installed version is currently 1.8.9.

I think this version may have been installed with the recently-released VS Code 1.0.

It is with VS Code that I first encountered the issue - but it also occurs at the command line (with tsc v 1.8.9)

As an experiment, I used a local NPM install of tsc v.1.8.10.

If i then invoke the compiler thus:

.\node_modules.bin\tsc -p .

the HelloWorld.js file is generated.

So, for information:

Are you able to test this issue with tsc v1.8.9?

and/or

Is there a VS2015 tools installer for tsc v1.8.10 (which seems to resolve the problem) I can use?

I usually use this link to install the Typescript compiler and VS2015 tooling:

https://www.microsoft.com/en-us/download/details.aspx?id=48593&751be11f-ede8-5a0c-058c-2ee190a24fa6=True

Issue 2:
The issue is still there in v1.8.20160211.1-beta nightly. But works fine in node's 1.8 beta.

where tsc
C:\Users\*\AppData\Roaming\npm\tsc
C:\Users\*\AppData\Roaming\npm\tsc.cmd

Using node's tsc:

tsc
Files: 77
Lines: 53178
Nodes: 236600
Identifiers: 87604
Symbols: 3595694
Types: 13015
Memory used: 140666K
I/O read: 0.08s
I/O write: 0.01s
Parse time: 0.92s
Bind time: 0.68s
Check time: 1.88s
Emit time: 0.41s
Total time: 3.89s

Using MSBuild tsc:

"C:\Program Files (x86)\Microsoft SDKs\TypeScript\1.8\tsc.exe"

Files: 1

Lines: 18651

Nodes: 81293

Identifiers: 31487

Symbols: 23122

Types: 4867

I/O read: 0.01s

I/O write: 0.00s

Parse time: 0.23s

Bind time: 0.12s

Check time: 0.49s

Emit time: 0.01s

Total time: 0.85s

Sample tsconfig.json:

{
"compilerOptions": {
"diagnostics": true,
"inlineSourceMap": true,
"noResolve": false,
"outFile": "../output.es6",
"declaration": true,
"target": "es6",
"newLine": "CRLF"
}
}
Issue 1:
If a package is uninstalled while disabled, its entry in 'disabledPackages' is left behind. It should probably be deleted.

Similarly, any config for the package being removed is also left in config.cson. There is possibly more of a reason to leave this behind (don't want to nuke the user's settings), but deletion of these should maybe also be considered.

Not a huge deal, just something I noticed.

Issue 2:
In Atom, it's not possible to begin or end a selection at the midpoint of an indent, because the caret can't be jumped there. But as a text editor, I think it should be able to do anything a normal text editor can do, regardless of whether it's meaningful or not.

My suggestion: leave the default "as is", but add an option to disable the "quick jump".
Issue 1:
I noticed next build started to take quite some time, so long in fact that it started to fail with an exit code 137 when I deploy to now. It turns out __tests__ directories within pages/ caused it. Once I deleted them, which includes Jest snapshot files, next build took about a minute and worked fine when deploying to now.

My apologies if this has been discussed already, but I couldn't find anything on Github or in Slack. Is this a known issue? Do others have their test files within pages/?

Issue 2:
I'm trying to configure

https://github.com/VanquisherMe/with-nextjs-antd-app/blob/master/next.config.js#L28

I need to load it on demand ，‘less’ mode

https://github.com/VanquisherMe/with-nextjs-antd-app/blob/master/.babelrc#L9

I tried many times but I didn't get it right

I have ever seen

https://github.com/zeit/next.js/tree/canary/examples/with-ant-design-less

But this is not for the project

I need an example
Issue 1:
Hi,

I find that optimizer enforces every parameter to be requires_grad=True. However, if I used such a network where the first layer was a pre-trained AlexNet with every parameter set to requires_grad = False, and rest layers were left requires_grad = True, pytorch would complain optimizing a parameter that doesn't require gradients. Because in model.parameters(), some parameters do not require gradients.

Is there anything wrong with my method of freezing part of the model? or would it be better to enforce that not all parameters are set requires_grad=False .

Issue 2:
🐛 Bug

Many projects use QT for UI, but when compiling such code a special keyword "slots" is defined, which conflicts with the 'slots' function defined in IValue. Since IValue.h ends up being included when including Torch headers, this prevents using Torch in any code that also does QT stuff.

Even though this is not the fault of Torch, since QT is a popular cross-platform GUI library, it would probably be great for usability if that function is somehow renamed or some other smart trick is used.

To Reproduce

Steps to reproduce the behavior:

Tested with current Torch master.

Include some Torch headers in a file that uses QT slots functionality.
Issue 1:
import matplotlib.pyplot as plt

fig, (ax1, ax2) = plt.subplots(1, 2, True, False)
x1 = [1, 2, 3, 4, 5, 6, 7, 8, 9]
y1 = [x*x for x in x1]
ax1.plot(x1, y1)
x2=y2=[]
ax2.plot(x2, y2)
plt.show()

Now ax1.get_xlim() returns erroneous (-0.06, 0.06) because when bounding boxes of two plots are united, infinitely small bounding box of ax2 (Bbox('array([[ inf, inf],\n [-inf, -inf]])')) is considered infinitely large in transforms.BboxBase.union(). E. g. transforms.BboxBase.union([ax1.dataLim, ax2.dataLim]) returns Bbox('array([[-inf, -inf],\n [ inf, inf]])') which is incorrect.

This bug prevents correct display of two plots with shared axis while one of them has empty data.

Issue 2:
Looks like I missed two points when reviewing @tacaswell's parts of #11246: #11246 (review) and #11246 (review).
Issue 1:
I want to be able to search for text in terminal and see them highlighted. Like on iTerm 2.

Issue 2:
Environment

Windows build number: Microsoft Windows [Version 10.0.19013.1102]
Windows Terminal version (if applicable): 0.6

Steps to reproduce

Create a color scheme with foreground as #ffffff and background as #000000 to represent white and black respectively. Create two profiles of cmd, assign one the custom color scheme, and the other with no color scheme to give it the default background and foreground. The default profile has a slightly lighter black background, and a slightly darker white foreground.

Expected behavior

The schema found here: https://aka.ms/terminal-profiles-schema says that the default background is #000000 (black) and the default foreground is #ffffff (white).

Actual behavior

Default background is slightly lighter than black and default foreground is slightly darker than white.
Issue 1:
Describe the issue:

Currently np.array([np.nan], dtype=np.int64) raises an error, however np.array([np.nan]).astype(np.int64) is undefined behavior that only issues a warning. Would it be worth promoting this to an error to stay consistent with np.array behavior?

Reproduce the code example:

import numpy as np

np.array([np.nan]).astype(np.int64) # Works while issuing 'invalid value' warning

np.array([np.nan], dtype=np.int64) # Raises 'ValueError: cannot convert float NaN to integer'

Error message:

No response

NumPy/Python version information:

1.24.0.dev0+578.g918065167 3.9.12 (main, Jun 1 2022, 11:38:51)
[GCC 7.5.0]

Issue 2:
I tried to install recent NumPy (1.14.4), forced by SciPy :(

It works in local env but not in Docker running Alpine.

Minimal Docker file that reproduces the problem:

FROM python:3.6.5-alpine
RUN apk add --no-cache build-base
RUN pip install numpy==1.14.4

By using 1.14.3 it all works.
Issue 1:
hi,

the constructor of Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity\RoleSecurityIdentity takes $role as a parameter and checks if it is an instance of Symfony\Component\Security\Core\Role\Role. Following the guidelines in http://symfony.com/doc/master/cookbook/security/entity_provider.html, our Role class implements RoleInterface. This results in RoleSecurityIdentity::role being populated with an object during the PermissionsEvaluation phase.

the fix, for me was easy, and should not break any other parts of the implementation, as Core\Role\Role also implements Core\Role\RoleInterface.

[[WARNING: HANDWRITTEN DIFF]]

<<<

[Symfony\Component\Security\Acl\Domain\RoleSecurityIdentity\RoleSecurityIdentity.php]

-- use Symfony\Component\Security\Core\Role\Role;

++ use Symfony\Component\Security\Core\Role\RoleInterface;

[...]

public function __construct($role)

{

-- if ($role instanceof Role) {

++ if ($role instanceof RoleInterface) {

i can submit a proper patch if required.

regards,

sb

Issue 2:
The "Symfony\Component\Console\Command::setApplication" default value is set to null.

If null is pass to this method the execution of "$this->setHelperSet($application->getHelperSet());" will not be able to complete and throw a fatal error.

This default value should be remove, or a check before setting the helperSet must be done.
Issue 1:
I have searched the issues of this repository and believe that this is not a duplicate.

Expected Behavior

Current Behavior

Steps to Reproduce (for bugs)

npm install --save next react react-dom

Populate ./pages/index.js inside your project:

export default () =>

Welcome to next.js!

npm run dev

internal/child_process.js:325

throw errnoException(err, 'spawn');

^

Error: spawn EACCES

at _errnoException (util.js:1022:11)

at ChildProcess.spawn (internal/child_process.js:325:11)

at Object.exports.spawn (child_process.js:493:9)

at spawn (/Users/mac/Documents/lantts/node_modules/cross-spawn/index.js:17:18)

at startProcess (/Users/mac/Documents/lantts/node_modules/next/dist/bin/next:72:36)

at Object. (/Users/mac/Documents/lantts/node_modules/next/dist/bin/next:93:12)

at Module._compile (module.js:573:30)

at Object.Module._extensions..js (module.js:584:10)

at Module.load (module.js:507:32)

at tryModuleLoad (module.js:470:12)

Context

Your Environment

Tech
Version

next
4.1.4

node
v8.3.0

OS
macOS High Sierra v10.13.1

browser
chrome

etc

Issue 2:
This example works fine when using the stable version v5.1 but causes an error when upgrading to the latest canary. It looks like it might be related to the new Babel v7 beta or the babel-plugin-bucklescript that is used but I couldn't isolate/reproduce the problem in the other repo.

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

Expected Behavior

The with-reasonml example should work in v6 canary as it did under v5.x

Current Behavior

Steps to Reproduce (for bugs)

yarn create next-app --example with-reasonml with-reasonml-app

cd with-reasonml-app

yarn && yarn dev

Navigate to localhost:3000 It works!

Bump version of next in package.json to 6.0.0-canary.6 then run yarn and yarn dev again

Navigate to localhost:3000 and get the following error:

Context

Was wanting to test the new _app.js functionality to see if it makes using getInitialProps to load Apollo queries easier to use for pages implemented in ReasonML. Currently it's difficult/impossible to bind to the static getInitialProps from Reason pages.

Your Environment

Tech
Version

next
6.0.0-canary.6

node
9.4.0

OS
MacOS 10.13.4

browser
Chrome v65
Issue 1:
Issue Details

Electron Version:

6.0.8

Operating System:

Windows 10 (1809)

Expected Behavior

app.getLocale() should return value passed to app.commandLine.appendSwitch('lang', VALUE)

Actual Behavior

app.getLocale() always returns 'en-US'

To Reproduce

const app = require('electron').app;
app.commandLine.appendSwitch('lang', 'ja');
app.on('ready', () => console.log('locale:', app.getLocale()));

Additional Information

As far as I see, it was broken many versions ago. Is there any workaround or fixes?

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:

5.0.0

Operating System:

Windows 10 (1709)

Last Known Working Electron version:

4.1.5

Expected Behavior

I expected calling app.commandLine.appendSwitch('lang', 'el') and then later at app ready event that calling app.getLocale() would return "el"

Actual Behavior

Calling app.getLocale() returns "en-US" that is the system locale currently set on local machine.

To Reproduce

Run this code in main process:

var electron = require('electron');
var app = electron.app;
app.commandLine.appendSwitch('lang', 'el');

app.on('ready', function () {
console.log(app.getLocale());
});

Additional Information

Problem exists even if there is a browserWindow created before the console.log

Chromium window also uses the wrong locale.