WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
Mark Pollack opened SPR-7793 and commented

Other MVC framework such as Ruby on Rails and ASP.NET MVC support interception after parameter binding has occured. Spring MVC should support this extension point. The use case driving this are storing of MVC event analytics data in NoSQL databases such as MongoDB. The current filter support in MVC is before binding has taken place and therefore harder to access information that will be converted to objects at the time of controller invocation.

See https://github.com/SpringSource/spring-data-document/tree/master/spring-data-document-core/src/main/java/org/springframework/data/document/web/servlet

for an example implementation.

These are called 'action filters' in Ruby on Rails/ASP.NET MVC

http://guides.rubyonrails.org/action_controller_overview.html

http://www.asp.net/mvc/tutorials/understanding-action-filters-cs

Affects: 3.0 GA

Issue Links:

#11103 @MVC should provide an "onBind" hook prior to automatic validation ("duplicates")

Issue 2:
Sam Brannen opened SPR-6437 and commented

When using @Valid to drive automatic validation of a model object, it is currently not possible to modify the bound model object prior to validation.

With the SimpleFormController hierarchy it was straightforward to override BaseCommandController's onBind() or onBindAndValidate() methods to achieve custom binding; however, with @MVC it is currently not possible. Neither the WebBindingInitializer API nor an @InitBinder method provides a mechanism to plug in custom binding.

Note that this was not an issue prior to support for @Valid, since without @Valid developers were responsible for executing validation code within a handler method.

One possible solution would be to add support for an @PostBinding method or @PreValidation method (or similar) which would be allowed to modify the model after binding but prior to executing the handler method.

Affects: 3.0 RC2

Issue Links:

#12449 Support for interception of controller method invocation after binding has completed ("is duplicated by")

#10091 Integrating validation into the @MVC request lifecycle

#11138 @MVC should provide a way to invoke custom code at preBind stage

6 votes, 6 watchers
Issue 1:
Their is a "find" function in sorted arrays: searchsorted:

julia/base/sort.jl

Lines 212 to 229
in
eb2a801

function searchsorted(v::AbstractVector, x, ilo::T, ihi::T, o::Ordering)::UnitRange{keytype(v)} where T<:Integer

u = T(1)

lo = ilo - u

hi = ihi + u

@inbounds while lo < hi - u

m = midpoint(lo, hi)

if lt(o, v[m], x)

lo = m

elseif lt(o, x, v[m])

hi = m

else

a = searchsortedfirst(v, x, max(lo,ilo), m, o)

b = searchsortedlast(v, x, m, min(hi,ihi), o)

return a : b

end

end

return (lo + 1) : (hi - 1)

end

Is that a possible option to add insorted that does the same as in but knowing that the collection is sorted?

Issue 2:
https://github.com/JuliaLang/julia/pull/5379/files#r8886140
Issue 1:
Description

The item is not passed through the pipeline for the following code, can someone tell me why?? This is the main crawler file:

import scrapy
from rough.items import RoughItem

class BotSpider(scrapy.Spider):
name = 'bot'
start_urls = ['https://www.iitbbs.ac.in']

def parse(self, response):
yield scrapy.Request('https://www.iitbbs.ac.in', callback=self.help)

def help(self, response):
yield scrapy.Request('https://www.iitbbs.ac.in', callback=self.returnObj)

def returnObj(self, response):
return RoughItem()

Pipeline:

# Define your item pipelines here
#
# Don't forget to add your pipeline to the ITEM_PIPELINES setting
# See: https://docs.scrapy.org/en/latest/topics/item-pipeline.html

# useful for handling different item types with a single interface
from itemadapter import ItemAdapter

class RoughPipeline:
def process_item(self, item, spider):
self.log('Hello!!')
return item

The prompt is not printed. I have enabled the pipeline in settings.py

Steps to Reproduce

Expected behavior: The prompt 'Hello!!' should be printed.

Actual behavior: The prompt is not printed which means the item is not passed through the pipeline.

Versions

Scrapy : 2.5.0
lxml : 4.6.3.0
libxml2 : 2.9.5
cssselect : 1.1.0
parsel : 1.6.0
w3lib : 1.22.0
Twisted : 21.2.0
Python : 3.9.5 (tags/v3.9.5:0a7dcbd, May 3 2021, 17:27:52) [MSC v.1928 64 bit (AMD64)]
pyOpenSSL : 20.0.1 (OpenSSL 1.1.1k 25 Mar 2021)
cryptography : 3.4.7
Platform : Windows-10-10.0.19043-SP0

Issue 2:
The documentation for pipeline specifies that process_item must either return a dict with data, Item object or raise a DropItem exception. Is there a reason why we aren't allowed to return an iterable of dictionaries with data (or Item objects)? It seems impossible to write a pipeline that modifies the input item and returns multiple items under the current framework.

Thank you!
Issue 1:
Angular2 currently provide a way to bind css class as [class.fa-train]="true", it is great if you can also bind them at runtime, something like [class:variable]="true" or simply [class:variable].

Here is a simple example,

this.icons = ['fa-train', 'fa-subway', 'fa-bed']

<i *ng-for="#icon of icons" class="fa" [class:icon]="true"></i>

<!--output-->
<i class="fa fa-train"></i>
<i class="fa fa-subway"></i>
<i class="fa fa-bed"></i>

Here is an example with bootstrap and form. Before:

<div class="form-group" [class.has-success]="form.controls.name.valid && !database.duplicate" [class.has-warning]="form.controls.name.valid && database.duplicate" [class.has-error]="!form.controls.name.valid">
<input type="text" class="form-control" placeholder="Your name">
</div>

After:

<div class="form-group" [class:nameValidity]="true">
<input type="text" class="form-control" placeholder="You name">
</div>

get nameValidity () {
if (this.form.controls.name.valid && !this.database.duplicate) return 'has-success';
if (this.form.controls.name.valid && this.database.duplicate) return 'has-warning'
if (!this.form.controls.name.valid) return 'has-error';
}

Thanks!

Issue 2:
[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

If a ControlValueAccessor component is used as a child of a component with it's ChangeDetectionStrategy is set to OnPush the current value is always one change behind.

Expected behavior

If a ControlValueAccessor component is used as child of a component with it's ChangeDetectionStrategy is set to OnPush it should work exactly as if the ChangeDetectionStrategy is set to Default.

Minimal reproduction of the problem with instructions

Plnkr http://plnkr.co/edit/1WboKWCqmPZFF8DOBfsd?p=preview. Click on the Button Push Changes. As you can see the red bordered input control did not reflect the current value. Please note: the blue bordered control is the same component type - but is used as a child of a component with ChangeDetectionStrategy.Default.

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

Custom Controls are not working as childs of components with ChangeDetectionStrategy.OnPush

Angular version: 2.0.X

2.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 ]

all

Language: [all | TypeScript X.X | ES6/7 | ES5]

TypeScript

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

v5.10.1
Issue 1:
Chris Beams opened SPR-7555 and commented

Per #12202, changes made in Spring 3.0.4 to spring-mvc-3.0 were never pushed to springframework.org. This task will resolve that problem.

This issue is a sub-task of #12211

Issue Links:

#12230 Publish updated spring-mvc.xsd with resources element definition ("is duplicated by")

#12202 Update documentation and XSD for mvc:default-servlet-handler

4 votes, 4 watchers

Issue 2:
Stefan Magnus Landrø opened SPR-6560 and commented

I have the following request mapping.

@RequestMapping(value = "/{username}/{domain}/{theme}/{locale}/{documenttype}", method = RequestMethod.GET)

In RC1 it works like a breeze, regardless the values of the different elements. In RC3, however, whenever a path element contains a . (dot), the URI is not mapped correctly.

In this project, we're using email addresses as usernames, and this is a major problem for us now.

Affects: 3.0 RC3

Issue Links:

#11148 @RequestMapping handled incorrectly when value contains "." (dot) character ("duplicates")
Issue 1:
Is your feature request related to a problem? Please describe.

As a superset user, I need the clipboard button which copies data, to copy the data in such a format that you can paste it right into a Google Sheet, including column names, without having first to save as CSV, then import the CSV, so that I save time while taking results from the SQL run.

Describe the solution you'd like

Feature expected requirements:

Copy will extract the resulting data (in table format) into the clipboard of the computer.

Pasting into a document should paste a table (not data which have spaces in between). Ideally it will be smart enough to limit the width of a column if there is massively long text in it.

Pasting into a spreadsheet should paste into correct individual cells (not one cell).

Ideally it should be smart enough not to pull quotation marks ("") that sometimes appear in the output of SQL lab when the value is numeric.

It should pull the entire dataset.

If the dataset is too large, it may be worth adding functionality to ask the user if they are sure they want to copy it (tell them it takes too long).

Data copied should include column names.

Ideally no 'formatting' is copied (eg., bold font).

Issue 2:
I am experiencing this new issue with superset 36.

I am pretty sure in the previous versions of superset Table exported in CSV had column order preserved.

I also have trouble exporting CSV data with 'latin-1' encoding, which I did not have before

Is this possible or I am dreaming and it never worked ? :/
Issue 1:
Probably related to #11030.

Running this produces an error:

package main

import (
"bytes"
"compress/zlib"
"fmt"
"io"
"log"
)

var blob = []byte{
0xa2, 0x02, 0x78, 0x9c, 0x05, 0x00, 0xb1, 0x09, 0xc0, 0x20,
0xcc, 0xa5, 0xd0, 0x17, 0xdc, 0xbc, 0xa0, 0x44, 0x88, 0x1e,
0xe1, 0x03, 0x4e, 0xc1, 0x49, 0xc8, 0x98, 0x0b, 0xbc, 0x41,
0x3c, 0x2a, 0xb3, 0x5b, 0xe9, 0xdc, 0xb1, 0x47, 0x34, 0x44,
0x80, 0x8c, 0x18, 0xb8, 0x5f, 0xc2, 0xe2, 0xe8, 0x48, 0x6d,
0x3c, 0xf5, 0x3f, 0xcb, 0x5c, 0xe4, 0xdf, 0x4f, 0xb7, 0xde,
0x06, 0xbb, 0xbd, 0x0e, 0x21, 0xb6, 0x02, 0x78, 0x9c, 0x1d,
0xc8, 0x51, 0x0a, 0xc0, 0x20, 0x08, 0x00, 0xd0, 0x7f, 0x4f,
0x21, 0xb2,
}

func main() {
fmt.Printf("blob: % x\n", blob[2:])

var buf = bytes.NewBuffer(blob[2:40])
r, err := zlib.NewReader(buf)
if err != nil {
log.Fatal(err)
}

var out bytes.Buffer
n, err := io.Copy(&out, r)
if err != nil {
log.Fatal(err)
}

r.Close()

fmt.Printf("io.Copy buf->out, %d bytes\n", n)
fmt.Printf("out=% x\n", out.Bytes())
fmt.Printf("buf=% x\n", buf.Bytes())
}

Playground link

I'm using compress/zlib heavily to process git packfiles and this error happens ocasionally.

Versions tested:

go version go1.3.3 windows/amd64

go version go1.4.2 windows/amd64

go version go1.4.2 linux/amd64

go version go1.4.2 darwin/amd64

It's implementation related because Python (example is py3) does just fine:

>>> zlib.decompress(bytearray.fromhex("78 9c 05 00 b1 09 c0 20 cc a5 d0 17 dc bc a0 44 88 1e e1 03 4e c1 49 c8 98 0b bc 41 3c 2a b3 5b e9 dc b1 47 34 44 80 8c 18 b8 5f c2 e2 e8 48 6d 3c f5 3f cb 5c e4 df 4f b7 de 06 bb bd 0e 21"))
b'100644 he.php\x00]\x055_~\xd9W\xff\x08J\x90\x92]\x19\xe3\xeb\xc6\xd0\xc6\xd7'

Issue 2:
by milanbella:

The problem is with calling postgres large object interface. Normally calling
lo_close() on unlinked large object is safe, but if I do it in Go that will corrupt my
database.

I am attaching my C and Go test programs, both are same (difference being only
language). See my comments in Go program.

Create new database. Then run the Go program connecting to new database. If you run it
first time you shall see that you were able to open unlinked large object. If you run it
next time (and all next successive calls) lo_create() will always fail. Also see my
comments in Go program.

The same C program is ok.

What is your $GOOS? $GOARCH?
linux 386

Which revision are you using? (hg identify)
5992bf56aa72 tip

Attachments:

pgtest_go.tar (10240 bytes)

pgtest_c.tar (10240 bytes)
Issue 1:
Something that was solved in 2.0-wip:

http://jsbin.com/evuduw/6/

Has resurfaced:

http://jsbin.com/evuduw/7/

Notice that in http://jsbin.com/evuduw/7/ if you click on the terrain or satellite button, the label that appears has the checkbox on one line, and the text on the next. Without Bootstrap, or even with 2.0-wip (http://jsbin.com/evuduw/6/) the display is correct.

Issue 2:
When a "bare bones" Google Map is embedded on a Bootstrap-styled page inside a grid row & span, the terrain drop-down menu gets pushed off the side of the map:

http://imagebin.org/index.php?mode=image&id=174078

The satellite drop-down menu is similarly affected when 2 entries are present, but looks normal when only 1 entry is present:

http://imagebin.org/index.php?mode=image&id=174079

Removing the Bootstrap CSS link from the page (i.e. displaying the map un-styled) restores normal behavior.

This behavior observed in Chrome 14.0.835.186 and Firefox 3.6.22 on Ubuntu 10.04.
Issue 1:
Add support for glob patterns to the linter. It is analyzing .js files

something like this would be nice:

exclude": [ "src/*.js",]

Issue 2:
Allow an --ignore flag to exclude files. The only good and common way of defining excludes are globs, so I'm including glob support in this issue. Existing tools have this.

Allow the following usages:

deno fmt --ignore=<csv-globs> <globs>...
deno lint --ignore=<csv-globs> <globs>...
deno test --ignore-files=<csv-globs> <globs>...

Glob support was removed when we brought deno test and deno fmt into the CLI from std because:

The shell can expand globs for you. However, this doesn't work when spawning with process APIs, or with exclude patterns (or generally things that are meaningless to expand in the shell). You ultimately have to use platform-specific tools like find. It's not ideal.

There are no good glob expansion/matching tools in Rust. The ones considered were buggy on Windows and didn't have feature parity with the glob tools we have in std. This is still a blocker.

Ref #3820, #3865, #3865 (comment), #3865 (comment).
Issue 1:
strings shows this issue:

func ExampleCount() {
fmt.Println(strings.Count("cheese", "e"))
fmt.Println(strings.Count("five", "")) // before & after each rune
// Output:
// 3
// 5
}

The "before & after each rune" hint why 5 is the answer belongs technically
to the example output comment group. Thus go/doc does not recorgnise the
"Output:" because it is not on the first line and godoc will not show the
example output.

This could be fixed by eiher adding a blank line to the example or by
making go/doc aware of the "last statement may have a comment which does
not belong to the example output".

As this might be a not uncommon issue for users writing examples it
might be worth fixing in go/doc (and not by a blank line in
strings/example_test.go). I've got a working fix but it is a bit
hacky.

Issue 2:
What steps will reproduce the problem?
1. godoc -path=. bencode

What is the expected output?

Documentation for my package.

What do you see instead?

2011/12/22 15:17:31 open /home/joiner/src/go/src/pkg/bencode: no such file or directory

Which revision are you using?

b4e4cd40f394+ tip

Please provide any additional information below.

Patch attached.

Attachments:

godoc-paths-command-line-mode.patch (297 bytes)
Issue 1:
Electron version: 1.5.x

Operating system: mint 18.1

Expected behavior

Window transparency with --enable-transparent-visuals is supposed to produce see thru window

Actual behavior

Window produce black background with old frames not disposing

How to reproduce

Use 1.5.x version; works well with 1.4.x version

Issue 2:
Hi, I've some issue with the transparent window, my code is:

win = new BrowserWindow({
width: 100,
height: 50,
transparent: true,
frame: false
});

On Mac I have not any kind of problem, on my Windows 7 Parallels virtual machine again no problem, but on another pc (not virtualized) with Windows 7 transparent windows doesn't work (I have a white background).

I haven't error logs from console.

In both Windows 7 machines I have DWM enabled and running (in fact, both are using aero).
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

We are injecting ComponentFactoryResolver into a modal service to dynamically create modal components. When testing this service, we discovered that when we create a second test with the modal service (with a different module created with entry components), the instance of the ComponentFactoryResolver from the previous test is still used. Because it only recognizes the entry components from the previous test, it throws errors with a "No component factory found for ModalTest2Component" Error. Note that using beforeEach to inject the ComponentFactoryResolver manually into the test and calling resolveComponentFactory instantiates the correct instance of ComponentFactoryResolver.

Expected behavior

The updated ComponentFactoryResolver will be injected into our modal service on subsequent tests.

Minimal reproduction of the problem with instructions

I pared down our repository to the files necessary to run the modal tests here: https://github.com/Blackbaud-PatrickOFriel/skyux2/tree/modal-ut-issue. The second test file which displays the strange behavior is at https://github.com/Blackbaud-PatrickOFriel/skyux2/blob/modal-ut-issue/src/modules/modal/modal.component2.spec.ts. I inserted a couple console logs to show the injected ComponentFactoryResolver working in the test and not working in the Modal service call immediately after.

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]

TypeScript

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

Thanks for your help and let me know if I can offer any more information

Issue 2:
The ComponentFactoryResolver has an internal map containing factories for components that have been compiled.

However, when TestBed compiles components declared in the DynamicTestModule, the factories are stored in the TestBed's internal _moduleWithComponentFactories. These factories are never made known to the ComponentFactoryResolver, so any tests that use the resolver to create a component declared in the test module will fail with Error: No component factory found for YourTestComponent.

As a workaround, you can simply create a real @NgModule in which to declare your test components and import that into the test module.

cc @tbosch @IgorMinar
Issue 1:
Given the following parent component:

import React = require('react');
import ChildView = require('./child');

interface Props extends React.Props<View> {
foo: string;
}

interface State {
}

class View extends React.Component<Props, State> {

private removeItem = (evt: React.DragEvent) => {
}

render() {
return <ChildView {...this.props} />;
}
}

export = View;

And the following child component:

import React = require('react');

interface Props extends React.Props<View> {
foo: string;
}

interface State {
}

class View extends React.Component<Props, State> {

private removeItem = (evt: React.MouseEvent) => {
}

render() {
return <div>{this.props.foo}</div>;
}
}

export = View;

I get an error like this:

Error TS2606: Property 'ref' of JSX spread attribute is not assignable to target property.
Type 'string | ((component: View) => any)' is not assignable to type 'string | ((component: View) => any)'.
Type '(component: View) => any' is not assignable to type 'string | ((component: View) => any)'.
Type '(component: View) => any' is not assignable to type '(component: View) => any'.
Types of parameters 'component' and 'component' are incompatible.
Type 'View' is not assignable to type 'View'.
Property 'removeItem' is missing in type 'View'.

This is caused by the ref attribute of the React.Props having different View (my classes)

Here is the interface defined:

interface Props<T> {
children?: ReactNode;
key?: string | number;
ref?: string | ((component: T) => any);
}

I could declare props like interface Props extends React.Props<React.Component<any, any>> but I feel like something should be done to be able to "omit" certain attributes when using spread attributes.

Something like:

<div {...this.props omit React.Props<View>} />

Or handling key and ref specially in JSX and having them checked automatically, allowing the props definition to be just

interface Props {
foo: string;
}

while allowing key and ref to be used implicitly..

Issue 2:
A following code was compiled with no error on TS1.7 but latest nightly build is not. Is this breaking changes?

declare module "a" {
export default 0
export const a;
export type a = typeof a;
}

$ node_modules/.bin/tsc --version
Version 1.8.0-dev.20151210
$ node_modules/.bin/tsc a.d.ts
a.d.ts(3,16): error TS2323: Cannot redeclare exported variable 'a'.
a.d.ts(4,3): error TS2323: Cannot redeclare exported variable 'a'.
Issue 1:
Bug Report

I would like to work on a fix!

Current behavior

As suggested in your documentation, if you create a fork of @babel/parser and try to call that in parserOverride(), it will fail with a parsing error. Even if you make a copy of the @babel/parser folder in node_modules, call it @babel/parser2, it will fail with the same error if you try to use that instead. It is the same issue reported here in the old babel-eslint repo:

babel/babel-eslint#786

Basically because eslint/babel-eslint-parser/src/convert/convertTokens.js is using the types exported by @babel/core, (which is from @babel/parser), all type comparisons will fail, unless you are using the parser from @babel/parser, which defeats the point of parserOverride()

Environment

Babel: 7.12.11
System:
OS: Windows 10 10.0.19041
Binaries:
Node: 10.16.0 - C:\Program Files\nodejs\node.EXE
Yarn: 1.16.0 - C:\Program Files\nodejs\yarn.CMD
npm: 6.9.0 - C:\Program Files\nodejs\npm.CMD

Possible Solution

As suggested here, #9009, a typesOverride option either for babel itself or babel-eslint-parser could solve this issue. I have already implemented this on my own fork as an option to babel-eslint-parser and it works fine, although it would make more sense to put this on a lower level and change the types exported by @babel/core. What do you think?

Additional context

Related issues:

#9009

babel/babel-eslint#786

Issue 2:
Is there a way to specify a custom version of @babel/types to be used when using a custom parser with the parserOverride option? I am working on an experimental plugin that requires custom syntax, so I forked @babel/parser and got the parsing part working, and parserOverride works well to tell Babel to use my custom version of babel-parser. I also forked babel-types and pointed my package.json to the forked version. But @babel/core is still loading the official version of @babel/types, so in my transform plugin, I can't write visitors for the new AST types I added.

If the ability to specify a custom version of babel-types isn't currently available, I think this would be an important feature to add, otherwise it definitely limits the usefulness of parserOverride. It occurred to me that I might be able to use yarn's resolutions feature as a workaround, but then anyone else who wants to try my plugin would also need this configuration in their project. I'm open to any other ideas of how to force @babel/core to use my forked version of @babel/types... Thanks!