WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
According to the manual — by default — the compiler option strict is set to true, and the option useUnknownInCatchVariables is currently set to false.

That manual page also shows an example of what an implied tsconfig.json looks like — which doesn't currently depict the state of this relationship, but that's not the focus of this issue...

The TSConfig reference includes this documentation:

useUnknownInCatchVariables

In TypeScript 4.0, support was added to allow changing the type of the variable in a catch clause from any to unknown. Allowing for code like:

try {
// ...
} catch (err) {
// We have to verify err is an
// error before using it as one.
if (err instanceof Error) {
console.log(err.message);
}
}

This pattern ensures that error handling code becomes more comprehensive because you cannot guarantee that the object being thrown is a Error subclass ahead of time. With the flag useUnknownInCatchVariables enabled, then you do not need the additional syntax (: unknown) nor a linter rule to try enforce this behavior.

Default:

true if strict, false otherwise.

Related:

strict

Released:

4.4

Here are two links to the TS playground comparing the two behaviors (based on the code above):

enabled (true)

disabled (false)

As the documentation describes: this feature is enabled by default when strict is enabled, but that's not currently the case in Deno — and, as the code in the playground links demonstrate, this feature is useful in providing better type safety in catch blocks — helping prevent further potential exceptions.

I would like to see Deno set this compiler option to true by default, just like vanilla TS does — and have better type safety in catch blocks.

Issue 2:
In TypeScript 4.4, the option "useUnknownInCatchVariables" was introduced and was default enabled under "strict" which is the default for Deno. It is a good change, as it helps ensure code properly guards against non-errors being thrown, which if not properly guarded can cause their own runtime errors. The problem is that there is a lot of unsafe code out there, which isn't validating that the value is actually an instance of Error including quite a lot in std, so for 1.14 we are doing to disable it, and then enable it for 1.15 to minimise the impact on code.

A reminder about our position on breaking changes in TypeScript: https://deno.land/manual@v1.13.2/typescript/faqs#there-was-a-breaking-change-in-the-version-of-typescript-that-deno-uses-why-did-you-break-my-program

More on the change in TypeScript: https://devblogs.microsoft.com/typescript/announcing-typescript-4-4-rc/#use-unknown-catch-variables

Ref #11678
Issue 1:
Using 0.10.7-insider on Windows 7

The implements keyword isn't highlighting correctly

Issue 2:
Try the following example in VS code (0.10.6) in the dark theme:

module Conway {
export interface Foo {
}
export class Bar {
}
export class Cell extends Bar implements Foo {
}
}

Note that implements is colored like the type. It gets the same scope as the type name

(block declaration heritage meta object parent storage type ts)
Issue 1:
Using SQLAlchemy 1.2.14, I attempted to reflect a schema from a customer which contained several thousand tables, and noticed this was very slow. Using echo="debug" as an option on the engine, I noticed that the SQLAlchem reflection code is iteratively querying the database for table metadata, instead of issuing one query.

I believe this is sub-optimal, and performance would be greatly enhanced if the SQLAlchemy reflection code issued one query to the backend instead of iterating over the table list.

Example times: MS SQL Server database with 3,300 tables: 15 minutes.

PostgreSQL database with 694 tables: 4 minutes.

PostgreSQL database with 18,000+ tables: 45 minutes.

Issue 2:
Migrated issue, originally created by Mark Amery (@ExplodingCabbage)

https://www.postgresql.org/docs/current/static/datatype-json.html recommends using "jsonb" over "json" for most use cases, since its performance is superior. (The "json" type just stores the input as text, which has to be parsed in order to do any queries, and keys within the JSON can't be indexed. "jsonb" stores a proper structured representation of the given JSON that can be indexed for faster querying.) This guidance seems obviously good to me.

For that reason, wouldn't it make sense for sqlalchemy.types.JSON to translate to "jsonb" on Postgres instead of "json"?

Besides the "jsonb is just plain better in almost all cases" argument, it also seems relevant that PostgreSQL's "jsonb" type is a closer match behaviourally to MySQL's "JSON" type than PostgreSQL's "json" type is. Since SQLAlchemy translates sqlalchemy.types.JSON to "JSON" on MySQL, this perhaps means that translating to "jsonb" on Postgres is more portable?
Issue 1:
How do I write it in JSX

Issue 2:
Example name

experimental-amp

Describe the bug

I try to use a sample from https://ampbyexample.com/dynamic_amp/dynamic_content_after_user-interaction/ without luck.

When I add <div [text]="products[productId] + ' available'">Please select a product</div> error while compiling occured SyntaxError: /experimental-amp-app/pages/product.amp.js: Unexpected token (38:5)

To Reproduce

Steps to reproduce the behavior, please provide code snippets or a repository:

Create amp all

Add "product.amp.js" page with this content:

import Head from 'next/head'
import { useAmp } from 'next/amp'

export default () => {
const isAmp = useAmp()

return (
<>
<Head>
<script async custom-element="amp-bind" src="https://cdn.ampproject.org/v0/amp-bind-0.1.js"></script>
</Head>
<h1>AMP Product</h1>
<a href="https://ampbyexample.com/dynamic_amp/dynamic_content_after_user-interaction/" />
<amp-state id="products"
src="https://ampbyexample.com/json/products.json"></amp-state>

<amp-img on="tap:AMP.setState({ productId: 0})"
src="https://ampbyexample.com/img/red_apple_1_60x40.jpg"
width="60"
height="40"
role="button"
tabindex="0">
</amp-img>
<amp-img on="tap:AMP.setState({ productId: 1})"
src="https://ampbyexample.com/img/green_apple_1_60x40.jpg"
width="60"
height="40"
role="button"
tabindex="0">
</amp-img>
<amp-img on="tap:AMP.setState({ productId: 2})"
src="https://ampbyexample.com/img/product1_alt1_60x40.jpg"
width="60"
height="40"
role="button"
tabindex="0">
</amp-img>
<div [text]="products[productId] + ' available'">Please select a product</div>
</>)
}

See error

Expected behaviour

It should compile or suggest an alternative way how to write such AMP code

System information

OS: latest macOS

Browser chrome

Version of Next.js: 8.0.4-canary.24

Is there any alternative way how to write [text] inside div?
Issue 1:
The QA Vagrant tests are vital for ensuring the correctness of the Elasticsearch distributions. These tests do not currently pass and should be brought to green.

Relates #16854

Issue 2:
Now that doc values have become the default fielddata implementation, we should progressively deprecate in-memory fielddata so that doc values would be the only way to sort or aggregate on fields.

#14082 Numerics, dates and booleans

#16589 Not-analyzed strings

Geo-points (need to add doc values by default first)
Issue 1:
Electron version: 1.6.10

Operating system: Windows 10 (System scaling factor is 2.5)

Expected behavior

Create a BrowserWindow and the BrowserWindow's size is the same of option.

Actual behavior

The created BrowserWindow's size is larger than the option

How to reproduce

Just create a BrowserWindow as below.

Seems only happens on devices that doesn't have an integer scaling factor.

Issue 2:
Electron version: 1.6.8 or 1.7.1

Operating system: Windows

Expected behavior

In windows multiple monitor setup with different DPIs, electron app starts out of bounds

Actual behavior

Should start at the same place where app was last opened

How to reproduce

Have two monitors with 200% and 100% DPI

Start electron app and move the app to monitor with 100% DPI (non maximized)

Quit and Restart the app

App starts out of the bounds in the 100% DPI monitor.

This is a regression after #8786 . I reverted this change and this issue no longer repros.
Issue 1:
In my application, I update figures every several seconds. I am not sure why, but WebAgg backend tends to draw text wrong. For example:

The bottom-left matrix should contain the same labels as the upper-right. Sometimes, even the upper-right matrix is displayed without text, but after some time it recovers. Sometimes, the text for the bottom-left matrix is drawn on the upper-right matrix, causing unreadable overlapped labels.

I wonder, where I should start digging for that difference between drawing boxes and color (always valid) and text (randomly skipped on some figures)?

Issue 2:
Bug summary

Hi,

When using triplot with a label the resulting legend contains two duplicated entries (even though the markers is None):

plt.triplot([0,2,1],[0,0,1],[[0,1,2]], label='Label');
plt.legend()

I think expected behavior would be either

Remove the second legend entry if no markers are given, or

Remove the second legend entry altogether, e.g. by using kw_markers.pop('label',None) around here

matplotlib/lib/matplotlib/tri/triplot.py

Line 78
in
2aa71eb

}

Code for reproduction

see above

Actual outcome

see above

Expected outcome

see above

Additional information

No response

Operating system

MacOS

Matplotlib Version

3.6.0.dev2140+g2aa71eb355.d20220503

Matplotlib Backend

QtAgg

Python version

No response

Jupyter version

No response

Installation

pip
Issue 1:
Describe the bug

A clear and concise description of what the bug is. Before submitting, please remove unnecessary sections.

To Reproduce

Steps to reproduce the behavior:

add event listener to a div mounted with three

Code

currentMount.addEventListener('mousemove', event => this.onMouseMove(event));
currentMount.addEventListener('mousedown', event => this.onMouseDown(event));
currentMount.addEventListener('mouseup', event => this.onMouseUp(event));

//mousemove works, mouseup and mouse down doesnt

Platform:

Device: Desktop

OS: Windows

Browser: Chrome

Three.js version: r121

Issue 2:
In r120, disabling orbit controls on mousedown no longer triggers mousemove events when dragging. To reproduce add the following code to misc_controls_orbit.html. This worked in the last several releases. Thanks.

renderer.domElement.addEventListener('mousemove', ()=>{
console.log('mousemove');
});
renderer.domElement.addEventListener('mousedown', (e)=>{
controls.enabled = false;
});
renderer.domElement.addEventListener('mouseup', ()=>{
controls.enabled = true;
});
Issue 1:
I'm using Next.js framework and react-player component to play some music on my site. Everything is good until I navigate to the second page. Then the music player stops and when I go back to the first page, the music starts playing again.

While I want the music to not be interrupted by going to different pages and be an upstream component that I can change the music files from different pages.

What way do you suggest to this case?

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

Expected Behavior

Automatically render the static folder to get access to some assets for the manifest.json file.

Current Behavior

The routing seems confused thinking that static is a page instead of an asset folder. Doesn't work in both cases : static folder at the root, and static folder in src.

Steps to Reproduce (for bugs)

https://github.com/glemiere/nextjs-starter/tree/Static-Folder-Routing-Bug

Context

Impossible to set icon in the manifest.json

Your Environment

Tech
Version

next
5

node
9

OS
OSX

browser
X

etc
X
Issue 1:
I've got an opaque string type. We basically use this type for things that are strings under the hood, but shouldn't be interchanged with actual free text strings- for example GUIDs. We also use the nominal type checking hack with the private void property to nominally type check them.

We have a problem, though, which is that the compiler won't permit them as dictionary keys.

Can we permit a type annotation or something to say that the type is really a string or integer under the hood and should be permitted as a dictionary key?

Issue 2:
IDBKeyRange is defined as follows.

https://github.com/Microsoft/TypeScript/blob/master/bin/lib.d.ts#L11630

interface IDBKeyRange {
upper: any;
upperOpen: boolean;
lower: any;
lowerOpen: boolean;
}
declare var IDBKeyRange: {
prototype: IDBKeyRange;
new(): IDBKeyRange;
bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;
only(value: any): IDBKeyRange;
lowerBound(bound: any, open?: boolean): IDBKeyRange;
upperBound(bound: any, open?: boolean): IDBKeyRange;
}

But it does not work.

new IDBKeyRange(); // error

Please recovery.

interface IDBKeyRange {
upper: any;
upperOpen: boolean;
lower: any;
lowerOpen: boolean;
bound(lower: any, upper: any, lowerOpen?: boolean, upperOpen?: boolean): IDBKeyRange;
only(value: any): IDBKeyRange;
lowerBound(bound: any, open?: boolean): IDBKeyRange;
upperBound(bound: any, open?: boolean): IDBKeyRange;
}
Issue 1:
Platform ServicePack Version VersionString
-------- ----------- ------- -------------
Win32NT 10.0.18362.0 Microsoft Windows NT 10.0.18362.0

Steps to reproduce

Test-CTRLC.ps1

[console]::TreatControlCAsInput = $true
Start-Sleep -Seconds 1
$Host.UI.RawUI.FlushInputBuffer()
Do {
if ($Host.UI.RawUI.KeyAvailable) {
$Key = [int]$Host.UI.RawUI.ReadKey("AllowCtrlC,IncludeKeyUp,NoEcho").Character
Write-Host "Key available - $Key"
if (3 -eq $Key -or ' ' -eq $Key) {
[console]::TreatControlCAsInput = $false
Write-Host "Ctrl-C detected, exiting script..." -ForegroundColor Yellow
Break
}
#$Host.UI.RawUI.FlushInputBuffer()
}
} While ($true)

Expected behavior

Ctrl+C should be readable from the $Host.UI.RawUI.KeyAvailable and $Host.UI.RawUI.ReadKey functions

Actual behavior

[console]::TreatControlCAsInput = $true Does turn off Ctrl+C

Either $Host.UI.RawUI.KeyAvailable or $Host.UI.RawUI.ReadKey is not working correctly

What works

Start PowerShell console outside of Windows Terminal. aka. standard powershell console window

Run the above style of code and Ctrl+C is detected

Images

PowerShell 6 (x64) Console (works)

PowerShell 7 in Windows Terminal

Issue 2:
Environment

Windows build number: 10.0.18362.175
Windows Terminal version: 0.2.1831.0
PowerShell Core 6.2.1
PowerShell 5.1

I'm on a Microsoft Surface Book. There is no Pause key and no Break key. Ctrl+Break is not an option for stopping a program unless I plug in an external keyboard or do some sort of key remapping specifically for this.

Steps to reproduce

Create a script in PowerShell that intercepts Ctrl+C so it can gracefully shut down. Run that script and try to use Ctrl+C. The script can't intercept it.

It behaves the same in PowerShell Core and in PowerShell.

[Console]::TreatControlCAsInput = $True
Start-Sleep -Seconds 1
$Host.UI.RawUI.FlushInputBuffer()
$exiting = $false
while ((-Not $exiting)) {
Write-Host "Sleeping..."
Start-Sleep -Seconds 1
while ($Host.UI.RawUI.KeyAvailable -and ($Key = $Host.UI.RawUI.ReadKey("AllowCtrlC,NoEcho,IncludeKeyUp"))) {
If ([Int]$Key.Character -eq 3) {
Write-Warning "Got CTRL-C!"
$exiting = $true
}

$Host.UI.RawUI.FlushInputBuffer()
}
}
Write-Host "Done."
[Console]::TreatControlCAsInput = $False

Expected behavior

I should be able to hit Ctrl+C to stop the program. In a standard PowerShell terminal (not hosted in the new Microsoft Terminal) this works fine.

Actual behavior

The program pauses, ostensibly to allow copy/paste behavior to work, and if I hit Enter it continues running. There is no way to capture Ctrl+C.
Issue 1:
Having votes on a signle request does not appear to be effective, so maybe if in stead of voting on an exisisting one we create hundreds of code folding requests will they add it?

been wanting to use VS Code for months now, and it's frustrating to have complicated features like extenstions added, but something simple like code folding is left.

Gonna give up on VS Code in a month :(

Issue 2:
I searched but couldnt find this in the issues. Id love to be able to collapse sections of the code. Any thoughts?
Issue 1:
I would like to know if it is possible to mix validation group and group sequence ?

I used GroupSequence like this :

* @Assert\GroupSequence({"Branch", "Step2"})
* @ProjectAssert\Configuration(groups={"Step2"})
*/
class Branch

// some property with validator.
// and
/**
* @SensioAssert\Yaml()
*/
private $configurationVariables;

/**
* @SensioAssert\Twig()
*/
private $configurationTemplate;

And it works like a charm.

But now, I want to preview the branch configuration. So I do not need validate everything. I just want to validate configurationVariables and configurationTemplate in a first step, and then the whole configuration with ProjectAssert\Configuration in a second step.

So I added groups={"preview"} on configurationVariables and configurationTemplate.

But I do not know how to add a group on my validation sequence.

AFAIK, a POPO can attach only one GroupSequence, and a GroupSequence can not be inside a group.

Issue 2:
Currently, the API of ValidatorInterface does not support group sequences. This should be made possible by supporting the following calls:

$validator->validate($object, new GroupSequence(array('first', 'second')));
$validator->validateProperty($object, 'foo', new GroupSequence(array('first', 'second')));
$validator->validatePropertyValue('Class', 'foo', 'bar', new GroupSequence(array('first', 'second')));
$validator->validateValue($object, array($constraint1, $constraint2), new GroupSequence(array('first', 'second')));
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.

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

Issue Details

Electron Version:

7.0.0-beta.4 through 7.0.0, 8.x

Operating System:

macOS 10.14.6

Last Known Working Electron version:: 7.0.0-beta.3, 6.x

Expected Behavior

Starting an app with a proxy server should not lead to a crash, the login event should be emitted.

Actual Behavior

Electron 7.0.0-beta.4: Silent crash

Electron 7.0.0-beta.5 – 7.0.0: login event not emitted, network non-functional

To Reproduce

You'll need a proxy server to reproduce the missing login event, which might be a somewhat difficult to get. In our testing, the issue exists regardless of the proxy server used (even a simple basic auth proxy fails just like a fancy NTLM one).

https://gist.github.com/4d032c5ec44983f714d5bbab2bb472e9

Screenshots

Additional Information

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:

7.0.0

Operating System:

macOS

Last Known Working Electron version:

6.1.2

Expected Behavior

https://github.com/electron/electron/blob/v7.0.0/docs/api/web-contents.md#event-login triggered

Actual Behavior

login event not triggered

To Reproduce

run following code

const {app, BrowserWindow} = require('electron')
app.once('ready', async () => {
win = new BrowserWindow()
app.on('login', console.log)
win.webContents.on('login', console.log)
win.webContents.once('did-finish-load', async () => {
const html = await win.webContents.executeJavaScript('document.documentElement.innerHTML')
console.log(html)
app.quit()
})
await win.webContents.loadURL('https://httpbin.org/basic-auth/user/passwd')
})
Issue 1:
🐛 Bug

To Reproduce

import torch
input = torch.zeros ([1,1,1])
input2 = torch.zeros ([1,4,1,1])
out= torch.zeros([1])
torch.cholesky_solve(input=input, input2=input2, out=out)

Output:

free(): invalid pointer
Aborted (core dumped)

Expected behavior

Expect no aborts

Environment

Please copy and paste the output from our

environment collection script

(or fill out the checklist below manually).

You can get the script and run it with:

wget https://raw.githubusercontent.com/pytorch/pytorch/master/torch/utils/collect_env.py
# For security purposes, please check the contents of collect_env.py before running it.
python collect_env.py

PyTorch version: 1.5.0

Is debug build: No

CUDA used to build PyTorch: 10.1

OS: Ubuntu 18.04.4 LTS

GCC version: Could not collect

CMake version: version 3.14.0

Python version: 3.7

Is CUDA available: No

CUDA runtime version: No CUDA

GPU models and configuration: No CUDA

Nvidia driver version: No CUDA

cuDNN version: No CUDA

Versions of relevant libraries:

[pip] numpy==1.18.1

[pip] torch==1.5.0

[pip] torchvision==0.6.0a0+82fd1c8

[conda] blas 1.0 mkl

[conda] cudatoolkit 10.1.243 h6bb024c_0

[conda] mkl 2020.1 217

[conda] mkl-include 2020.1 217

[conda] mkl-service 2.3.0 py37he904b0f_0

[conda] mkl_fft 1.0.15 py37ha843d7b_0

[conda] mkl_random 1.1.0 py37hd6b4f25_0

[conda] numpy 1.18.1 py37h4f9e942_0

[conda] numpy-base 1.18.1 py37hde5b4d6_1

[conda] pytorch 1.5.0 py3.7_cuda10.1.243_cudnn7.6.3_0 pytorch

[conda] torchvision 0.6.0 py37_cu101 pytorch

Additional context

cc @ezyang @gchanan @zou3519

Issue 2:
Duplicate of pytorch/vision#1172, but in main torch repo so we can keep all milestone issues together.
Issue 1:
System info

Playwright Version: [v1.31.1]

Operating System: [All]

Browser: [not relevant]

Source code

Config file

// playwright.config.ts
import { defineConfig, devices } from '@playwright/test';

export default defineConfig({
...
testDir: "tests",
testMatch: "**/*.spec.ts",
...
});

Test file (self-contained)

// test.utl.ts
import { expect, test } from "@playwright/test";

export function sharedTest() {
return test("The Shared Test", () => expect(true, "the smart shared test").toBeTruthy());
}

// suiteN.spec.ts
...
test.describe.serial("Suite N", () => {
test("Test A", () => {...});

sharedTest();

test("Test B", () => {...});
});

Steps

playwright test --list

Expected

The output contains the filenames and suites according to the *.spec.ts mask only.

Actual

The output contains also the permutations of test.utl.ts > Suite N The Shared Test instead of suiteN.spec.ts > Suite N The Shared Test

Workaround

Not found.

Trying to set config property testIgnore: "**/test.utl.ts" doesn't effect.

Issue 2:
System info

Playwright Version: 1.32.2

Operating System: Pop!_OS 22.04

Browser: Chromium and WebKit (Firefox is ok)

Other info:

Source code

I provided exact source code that allows reproducing the issue locally.

Config file

N/A

Test file (self-contained)

// script.mjs
import { chromium } from 'playwright-core'
// import { firefox as chromium } from 'playwright-core'
// import { webkit as chromium } from 'playwright-core'

const module = String(new URL('module.js', import.meta.url))

const browser = await chromium.launch({ headless: false })
const page = await browser.newPage({ bypassCSP: true })
// await page.goto(String(new URL('index.html', import.meta.url)))
await page.addScriptTag({ type: 'module', url: module })

// module.js
console.log('hello')

Steps

node script.mjs

Expected

hello is logged to the browser console.

Actual

In Chrome and WebKit, the script fails due to an error. Inspecting the network tab in the browser reveals this is a CSP error, despite bypassCSP being true.

Likewise, a dynamic import inside page.evaluate() causes a CSP error.

Creating an index.html file to navigate to doesn’t work either.