WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
I'm not sure if this is a bug, or I'm missing something.

I am compiling my TypeScript to ES6 and then using the babel preprocessor to run my tests in Karma. The class is as follows

import { BaseModel, notEmpty } from '../main';

export class TestModel extends BaseModel {

@notEmpty('Test property can not be empty')
public testProperty: string;

}

The above class compiles to

if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {

if (typeof Reflect === "object" && typeof Reflect.decorate === "function") return Reflect.decorate(decorators, target, key, desc);
switch (arguments.length) {
case 2: return decorators.reduceRight(function(o, d) { return (d && d(o)) || o; }, target);
case 3: return decorators.reduceRight(function(o, d) { return (d && d(target, key)), void 0; }, void 0);
case 4: return decorators.reduceRight(function(o, d) { return (d && d(target, key, o)) || o; }, desc);
}
};

import { BaseModel, notEmpty } from '../main';
export class TestModel extends BaseModel {
}
__decorate([
notEmpty('Test property can not be empty')
], TestModel.prototype, "testProperty");

This compiled code doesn't run. Unfortunately I don't get a helpful error either so I'm not exactly sure the problem. However if I mess with the compiled JavaScript a bit

// changing the first line from ...
if (typeof __decorate !== "function") __decorate = function (decorators, target, key, desc) {
// code here
}

// to this

if (typeof __decorate !== "function") window.__decorate = function (decorators, target, key, desc) {
// code here
}

// or to this, which would work in both browser and server environments
if (typeof __decorate !== "function") var __decorate = function (decorators, target, key, desc) {
// code here
}

with either of those changes everything seems to work fine. Like I said though, I'm not sure if its a bug or I'm missing some small thing.

Issue 2:
I believe it's expected that tsc -t es6 should be externally transpilable to ES5 (eg with Babel)

See https://gist.github.com/alexeagle/24243fbb87dbd8bad6f1

Babel replaces the __decorate line this.__decorate with undefined.__decorate so that gives a runtime error. Uncaught TypeError: Cannot read property '__decorate' of undefined app_bin.js:7

Note I also tried this with Closure Compiler ES6->ES5, and had a different problem because of this line in the emit:

Object.defineProperty(App, "name", { value: "App", configurable: true });

in ES6 spec, new objects are configurable:true by default, but in mainline Chrome it is configurable:false by default so this is also a runtime error. For this case, it leads me to wonder if ES5->ES6 transpilers should be expected to translate API incompatibilities in addition to new ES6 syntax.
Issue 1:
Please add ability to map Key to Shortcut in Keyboard Manager.

Example: Map CapsLock key to Alt + Shift shortcut to switch between input languages just like macOS.

Thank you very much

Issue 2:
Summary of the new feature/enhancement

My laptop vendor didn't included simple media keys on keyboard. I use PT to create shortcuts to virtual keys like Media Play/Pause, Volume Up/Down.

In Keyboard Manager there are two options: Remap Keyboard (key to key) and Remap Shortcuts (key combination to key combination). But when I try to create shortcut like this:

Ctrl + Alt + Up => Volume Up

Ctrl + Alt + Down => Volume Down

Ctrl + Alt + Right => Media Play/Pause

I always get an error Shortcut must start with a modifier key over target shortcut key. But in this case, there's no modifier key needed. So I end up with same combinations with Ctrl, as they work ok:

Ctrl + Alt + Up => Ctrl + Volume Up

Ctrl + Alt + Down => Ctrl + Volume Down

Ctrl + Alt + Right => Ctrl + Media Play/Pause

I would like to define shortcuts (especially for media keys) without needing to fake shortcut with Ctrl.

Proposed technical implementation details

I think the right side of shortcut shouldn't require modifier key. Even standard keys can be mapped as destination without modifier - if someone want to type X by pressing Ctrl + Alt + Shift + z, this should be allowed.
Issue 1:
Problem Description

If I render the slider with code like:

<Slider step={1} min={0} max={this.state.max} value={this.state.currentValue} />

And then I call setState to increase max, the slider does not update the position of the marker. If I increase max again, then the marker position updates to be where it should have been on the previous render (e.g. it is still wrong).

For example,

first render, max={100} value={50} and the marker appears in the middle of the slider as it should.

second render, max={200} value={50} and the marker is still in the middle of the slider (it should be at the 25% position)

third render, max={400} value={50} and the marker is now at the 25% mark (it should be at the 12.5% position).

This issue seems related to #3619.

Versions

Material-UI: v0.15.0-beta.2

React: 15.0.1

Browser: Chrome 49.0.2623.112 m (Windows 10 x64)

Issue 2:
Changing value, min and/or max props at the same time results in an broken state. This happens because on value change percent is re-calculated based on current min/max not based on the new ones:

componentWillReceiveProps(nextProps, nextContext) {
...
if (nextProps.value !== undefined && !this.state.dragging) {
this.setValue(nextProps.value);
}
},

...

setValue(i) {
// calculate percentage
let percent = (i - this.props.min) / (this.props.max - this.props.min);
....
},
Issue 1:
I'm cross compiling from linux to arm using a custom cross tool and getting the following error. It looks like it is switching the arch from arm to x86_64 during the build of the standard library.

/root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/external/io_bazel_rules_go/BUILD.bazel:9:1: GoStdlib external/io_bazel_rules_go/linux_arm_stripped/stdlib%/pkg failed (Exit 1) process-wrapper failed: error executing command
(cd /root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/execroot/__main__ && \
exec env - \
CC=tools/compilers/arm/gcc/clang/clang \
CGO_CFLAGS='--sysroot=external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot --target=armv6z-raspberrypi-linux-gnueabihf -mfloat-abi=hard -mfpu=vfp -isystem external/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0/include -isystem external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/usr/include -isystem external/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0/include-fixed -U_FORTIFY_SOURCE -fstack-protector -fPIE -fdiagnostics-color=always -fno-omit-frame-pointer -no-canonical-prefixes -Wno-builtin-macro-redefined -D__DATE__="redacted" -D__TIMESTAMP__="redacted" -D__TIME__="redacted"' \
CGO_ENABLED=1 \
CGO_LDFLAGS='--sysroot=external/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot -lstdc++ -latomic -lm -lpthread -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/lib -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/lib -Lexternal/arm_compiler/arm-buildroot-linux-gnueabihf/sysroot/usr/lib -Lexternal/arm_compiler/lib/gcc/arm-buildroot-linux-gnueabihf/5.4.0 -Bexternal/arm_compiler/arm-buildroot-linux-gnueabihf/bin -Wl,--dynamic-linker=/lib/ld-linux-armhf.so.3 -no-canonical-prefixes -pie -Wl,-z,relro,-z,now' \
GOARCH=arm \
GOOS=linux \
GOROOT=external/go_sdk \
GOROOT_FINAL=GOROOT \
PATH=tools/compilers/arm/gcc:tools/compilers/arm/gcc/clang:/bin:/usr/bin \
TMPDIR=/tmp \
/root/.cache/bazel/_bazel_root/f8087e59fd95af1ae29e8fcb7ff1a3dc/execroot/__main__/_bin/process-wrapper '--timeout=0' '--kill_delay=15' bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/stdlib -sdk external/go_sdk -installsuffix linux_arm -out bazel-out/armeabi-v7a-fastbuild/bin/external/io_bazel_rules_go/linux_arm_stripped/stdlib% -filter_buildid bazel-out/host/bin/external/io_bazel_rules_go/go/tools/builders/linux_amd64_stripped/filter_buildid)
# runtime/cgo
arm-buildroot-linux-gneabihf-ld: unrecognised emulation mode: elf_x86_64
Supported emulations: armelf_linux_eabi armelfb_linux_eabi

System information (version)

OpenCV => ❔

Operating System / Platform => ❔

Compiler => ❔

Detailed description

Steps to reproduce

Issue 2:
Detailed description

Several builds (e.g. this and this) are failing, due to bad parsing of the test results..

Actual results

Failure with the following status:

test_dnn test_dnn ; cases (tests): 0 (0) ; passed: 695 ; failed

Expected results

Success with the following status:

test_dnn test_dnn ; cases (tests): 60 (887) ; passed: 887 ;
Issue 1:
I am webpacking the cheerio library and hit an error in its index.js:

ERROR in ./~/cheerio/index.js
Module not found: Error: Cannot resolve file or directory ./package in MYPROJECT\node_modules\cheerio.
@ ./~/cheerio/index.js 13:18-38

The code:

exports.version = require('./package').version;

It's obviously just trying to load package.json from the same directory. The Node Modules documentation states:

If the exact filename is not found, then node will attempt to load the required filename with the added extension of .js, .json, and then .node.

So, if we expect that npm packages are going to make use of this with vanilla 'require,' I think webpack should make the json loader default. I believe that would mean changing:

options.resolve.extensions = ["", ".node", ".er.js", ".js"];

in https://github.com/webpack/enhanced-require/blob/master/lib/require.js

to:

options.resolve.extensions = ["", ".node", ".er.js", ".js", ".json"];

Right?

Issue 2:
Bug report

What is the current behavior?

i am not sure whether this is webpack-dev-server issue or webpack or something else, however after 1st hot reload happens there is a constant error:

jsonp chunk loading:103 Uncaught TypeError: Cannot read property 'push' of undefined
at self.webpackHotUpdatePACKAGEJSONNAME (jsonp chunk loading:103)

self["webpackHotUpdatePACKAGEJSONNAME"] = (chunkId, moreModules, runtime) => {
for(var moduleId in moreModules) {
if(__webpack_require__.o(moreModules, moduleId)) {
currentUpdate[moduleId] = moreModules[moduleId];
if(currentUpdatedModulesList) currentUpdatedModulesList.push(moduleId);
}
}
if(runtime) currentUpdateRuntime.push(runtime); // error happens here
if(waitingUpdateResolves[chunkId]) {
waitingUpdateResolves[chunkId]();
waitingUpdateResolves[chunkId] = undefined;
}
};

If the current behavior is a bug, please provide the steps to reproduce.

launch dev-server with hot:true

What is the expected behavior?

does not happen in webpack@4

i think that the issue is that this variable currentUpdateRuntime is accessed before it is initialized in:

__webpack_require__.hmrI.jsonp

or

__webpack_require__.hmrC.jsonp

Other relevant information:

webpack version: 5.1.0

Node.js version: v12.18.0

Operating System: Windows 10

Additional tools:

webpack-devs-server@latest
Issue 1:
Environment

Windows build number: Microsoft Windows [Version 10.0.18362.10005]
Windows Terminal version (if applicable): um? The windows terminal preview, current one in store

Any other software?
Used boht vim 8 and nano to test.

# Steps to reproduce

Open a multi line file in a terminal editor. I have tried both vim 8 and nano. In the editor attempt to hold the down key vim: j & nano: down arrow. The cursor will love down. However, when you release the key the cursor will continue to move down multiple lines past where stopped.

# Expected behavior

The expected is that the terminal be more response and when a key is released it is registered soon

# Actual behavior

When released the editor continues to move for 5-7 lines of text.

Issue 2:
Change the UI for tab tiles, increase the height respective to the window action buttons. Same as edge, currently there height is not suitable and there edges are cornered, which resemble material design instead of fluent design. Plus make the design consistent with the tab actions buttons (e.g. '+'). One has outline effect on hover, other has text color change. The edge design is very polished, it should follow its footsteps for fluent design.
Issue 1:
After upgrading to 0.19.9, Elastisch test suite that resets indexes by specifying index name as _all now fails. ElasticSearch responds with 404s:

curl -XDELETE 'http://localhost:9200/_all?pretty=true'
{
"error" : "IndexMissingException[[_all] missing]",
"status" : 404
}

I am not sure if this change is intentional but looks like _all should not be treated as a regular index name. action.disable_delete_all_indices is not set in my config.

Issue 2:
curl http://localhost:9200/_all/_status

{"error":"IndexMissingException[[_all] missing]","status":404}

Works in 0.19.8

Looks like /_status does work, is /_all/_status no longer supported on purpose? http://www.elasticsearch.org/guide/reference/api/admin-indices-status.html kind of says it should still work, but not clear.
Issue 1:
console.log(router) shows correct asPath but If I access console.log(router.asPath) shows the previous URL

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

Code (_app.js)

export default class MyApp extends App {
constructor(props) {
super(props)
}

static async getInitialProps({ Component, router, ctx }) {
// Router.asPath shows current URL, can be seen from browser console as below
console.log(router)
// But if i access the asPath property as below, it shows previous URL. On server side, it's fine
console.log(router.asPath)
}
...
}

Expected Behavior

Refer to above code, router.asPath should return current URL on client side

Current Behavior

Refer to above code, router.asPath returns previous URL on client side

Steps to Reproduce (for bugs)

Please refer to above code example.

Context

After url is deprecated, we pass URL from _app.js, as all pages need this for some sort of SEO related stuffs.

as a workaround using ctx.asPath for now

Your Environment

Tech
Version

next
6.0.0

node
9.x

OS
mac

browser
Chrome

Issue 2:
Feature request

Client-side navigation without getInitialProps being called

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

Headless CMS data is requested on every client-side route, slowing down the site.

API keys are visible

Describe the solution you'd like

I'd like to be able to navigate through a site client-side (for page transitions) without having data requests in getInitialProps

Describe alternatives you've considered

Gatsby

if statements inside getInitialProps() that only runs requests on the server. Results in an error, An unexpected error has occurred.
Issue 1:
In the following program:

package main

import "fmt"

func main() {
const A = 0xfffffffffffffffff // error
// const A = 0x8000000000000000 // error
// const A = 0x7fffffffffffffff // ok
a := string(A)
for i, r := range a {
fmt.Printf("%d: %x\n", i, r)
}
}

The compiler issues error message overflow in int -> string.

Form the Go Spec https://golang.org/ref/spec#Conversions

A constant value x can be converted to type T in any of these cases:

x is an integer constant and T is a string type. The same rule as for non-constant x applies in this case.

...

A non-constant value x can be converted to type T in any of these cases:

x is an integer or a slice of bytes or runes and T is a string type.

...

Conversions to and from a string type

Converting a signed or unsigned integer value to a string type yields a string containing the UTF-8

representation of the integer. Values outside the range of valid Unicode code points are converted to

"\uFFFD".

According to the above, the conversion should succeed, with the resulting string containing the UTF-8 encoding of 0xfffd.

gccgo does not issue an error and behaves as in the spec.

Issue 2:
Gc rejects to compile the following program:

package a
var a = string(9223372036854775808)

saying:

overflow in int -> string

go/types compile it successfully.

Compilers must agree on whether it is a valid Go program or not.

on commit af81789
Issue 1:
Currently, json.Unmarshal (and json.Decoder.Decode) ignore fields in the incoming JSON which are absent in a target struct.

For example, the JSON { "A": true, "B": 123 } will successfully unmarshal into struct { A bool }.

This makes it difficult to do strict JSON parsing. One place this is an issue is in API creation, since you want to reject unknown fields on incoming JSON requests to allow safe introduction of new fields in the future (I've had this use case previously when working on a JSON REST API). It also can lead to typos leading to bugs in production: when a field is almost always the zero value in incoming JSON, you might not realise you're not even reading a misspelled field.

I propose that a new method is added to Decoder to turn on this stricter parsing, in much the same way UseNumber is used today. When in strict parsing mode, a key in the incoming JSON which cannot be applied to a struct will result in an MissingFieldError error. Like UnmarshalTypeError, decoding would continue for the remaining incoming data.

d := json.NewDecoder(r.Body)
d.UseStrictFields()
err := d.Decode(myStruct)

Issue 2:
What version of Go are you using? 5.3

What operating system and processor architecture are you using? amd64,windows

What did you do?

Read this: https://mailarchive.ietf.org/arch/msg/json/Ju-bwuRv-bq9IuOGzwqlV3aU9XE

What did you expect to see?

...

What did you see instead?

...
Issue 1:
Proposed functionality

A new setStorageState() API on the context object that applies any given storage state to the current page.

context.setStorageState({ path: '/storage.json' })
context.setStorageState({
cookies: [...],
origins: [...]
})

This API is opposite in its functionality to the existing context.storageState() that flushes the storage state to the disk.

Use case

The Authentication docs showcase a great example of creating a browser context, performing sign-in, and storing that session in a JSON file. However, to use that session file you need to create a new browsing context. This is not suitable when using @playwright/test and wanting to control auth state per test.

The recommended example shows that we can create separate contexts with a different session, and that works great, but you lose the ability to use the already existing context that gets created by the Playwright test runner. You also lose any custom fixtures as they are attached to that default context.

In general, I see no reason not to have the "read" functionality for the session state.

Implementation

You're already using this logic in Playwright, it's just internal:

playwright/packages/playwright-core/src/server/browserContext.ts

Lines 512 to 537
in
1303e3e

async setStorageState(metadata: CallMetadata, state: NonNullable<channels.BrowserNewContextParams['storageState']>) {

this._settingStorageState = true;

try {

if (state.cookies)

await this.addCookies(state.cookies);

if (state.origins && state.origins.length) {

const internalMetadata = serverSideCallMetadata();

const page = await this.newPage(internalMetadata);

await page._setServerRequestInterceptor(handler => {

handler.fulfill({ body: '<html></html>' }).catch(() => {});

});

for (const originState of state.origins) {

const frame = page.mainFrame();

await frame.goto(metadata, originState.origin);

await frame.evaluateExpression(`

originState => {

for (const { name, value } of (originState.localStorage || []))

localStorage.setItem(name, value);

}`, true, originState, 'utility');

}

await page.close(internalMetadata);

}

} finally {

this._settingStorageState = false;

}

}

I propose to abstract it into a general function, dropping internals like this. _settingStorageState, and reuse it in the new page.setStorageState() API.

Issue 2:
We have the ability to sniff websockets and use events on messages bi directionally, which is great, but can we also modify those messages? Either change them if they are fired, or send them directly to the websocket? It seems like following the "Route.ContinueAsync" flow works well, but it'd be even better if we can create a request since we already have the "WebSocket" class within the event handler.

Note: also created on the C# implementation repo since that's what I'm using, but figured I'd put it here too since this appears to be the main repo. We can close whichever is more appropriate:

microsoft/playwright-dotnet#1450
Issue 1:
From #6380 (comment)

I think it's critical. It's not about atom crashing or not crashing. It's about a myriad of other things crashing on a computer. It's about being able to not kill a junior because he or she accidentally hit the reset button on your computer. Sublime gives you the "don't worry about it" guarantee. It's a state of mind and affects your workflow. I was used to having many unnamed buffers open with random scratch data. I didn't need to save it anywhere but sublime kept them around.

From @maxbrunsfeld on #6380 (comment)

I think this use case is covered though, because Atom should quit normally during a system restart (at least on OSX and Linux).

Not when I hard reset my computer with a physical reset button which is quite accessible and happens to be right next to the USB ports.

Open atom, type some text, and hit Ctrl+Q

I should not be able to lose work at all, at any time, for any reason. In sublime I can do the above and then immediately re-open and all is well.

To summarize, we need a few things:

Save unnamed buffers when atom is closed normally

Porting the "hot exit" feature from sublime. When atom is closed, it is immediately closed without any popup and can be re-opened in the exact state it was left

On some configurable interval we save the state to allow the application to pick back up in case of fire

Issue 2:
One feature I love of an increasing number of Mac OSX Lion and above apps is the auto-saving of untitled buffers. If I quit an app that supports this behavior and re-open it, even untitled buffers (never explicitly named and saved) are restored. This lets me have greater confidence about using these apps as "clipboards," knowing that even if I crash or accidentally close the app, I'll have some reasonably up-to-date copy of the file restored.

Sublime is the front-of-mind example for this in my daily workflow.
Issue 1:
Instructions

Summary

Context

Issue 2:
For example, twitter uses stream api to publish tweet updates in a single http connection via chunked encoding.

I'm doing something similar with one of my servers for a publish-subscribe model.

As far as I can tell, axios doesn't support chunked encoding at the moment - if I just do a .get it just keeps going forever without triggering .then and there's no way to handle new data as it arrives.
Issue 1:
Running Chrome [Version 44.0.2403.155 (64-bit)] on Mac [Version 10.10.5 (14F27)]. Solution appears to be correct, but is not being accepted. Entered manually and also cut & paste from example.

Challenge http://www.freecodecamp.com/challenges/waypoint-target-html-elements-with-selectors-using-jquery has an issue. Please describe how to reproduce it, and include links to screenshots if possible.

Issue 2:
Challenge http://www.freecodecamp.com/challenges/waypoint-target-html-elements-with-selectors-using-jquery has an issue. Please describe how to reproduce it, and include links to screenshots if possible. On this challenge I'm trying to figure out if I got the right code or not. I talk to a camper about this challenge and he said there was bugs, but they have been fixed. So I'm just wondering if its me or not. My code is

<script>
$(document).ready(function() {
$("button").addClass("animated bounce");
});
</script>
Issue 1:
Atom will reload a file if no changes have been made but if you make changes and then the file is updated by another person before you save there is no indication that you are about to override someone else changes. This is problematic when working on remote shares where a team can be editing the same file. It would be nice if Atom would prompt you that the file was changed outside of Atom and ask if you would like to reload the file.

Issue 2:
today i worked on a project with sublime text and atom. i edited a file on sublime text, saved the changes and opened atom(the same file). both editors were open at the same time. but when i go to atom, there was no change detection to the file and all the changes, made in sublime text, were gone.

what i miss is a popup, mentioning that the file has changed and ask whether reloading.