WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
The definition of argmax from Wikipedia,

Given a collection of elements (domain), which map to an ordered set (range), what is the subset containing those elements in the domain whose image is the frontier.

Currently, argmax is actually indmax which is defined for indexed collections and returns the index of the first encountered element whose image is equal to the frontier. The generalization of keymax (discussed, but not implemented) extends the supported collections from indexed to pairs-implemented collections. This is the result of renaming indmax to argmax. A current proposal is for argmax to be defined for Generator (#27613),

argmax(f(x) for x ∈ domain)

with that change, we could fix the implementation with something like

import Base: Generator, argmax
function argmax(f::Function, domain::Generator)
T = eltype(domain)
tested = Set{T}()
output = Set{T}()
frontier = nothing
for elem ∈ domain
if !(elem ∈ tested)
push!(tested, elem)
value = f(elem)
if (frontier === nothing) || (value > frontier)
frontier = value
output = Set(elem)
elseif value == frontier
push!(output, elem)
end
end
end
return output
end

and call it with the following syntax

argmax(abs2, elem for elem ∈ -3:3) == Set([-3, 3])

Issue 2:
From https://discourse.julialang.org/t/serialization-serialize-strings-are-not-interned-de-duplication/35626

@vtjnash asked me to open this as an Issue on the repo. Can we implement string interning when serializing (large) strings? Can we maybe share this logic with the interning for Symbols? Thanks!

--

Copied from discourse:

julia> using Humanize # For pretty printing, not necessary for reproduction

julia> using Serialization

julia> struct StringHolder
a::String
b::String
end

julia> s = join(rand('a':'z', 1024*1024)); # 1 MiB string

julia> sh = StringHolder(s, s);

julia> Humanize.datasize(Base.summarysize(sh), style=:bin) # The string is shared in memory.
"1.0 MiB"

julia> serialize("/tmp/sh", sh)

julia> run(`ls -lh /tmp/sh`) # Size on disk is 2 MiB! (duplicated!)
-rw-r--r-- 1 nathan.daly wheel 2.0M Mar 6 00:06 /tmp/sh
Process(`ls -lh /tmp/sh`, ProcessExited(0))

julia> sh_deserialized = deserialize("/tmp/sh"); # It's big now! :'(

julia> Humanize.datasize(Base.summarysize(sh_deserialized), style=:bin)
"2.0 MiB"
Issue 1:
Sometimes "child" docs have a common parent ID but are missing a physical parent doc - @paullovessearch would like to see these "orphans" grouped in search results to achieve pagination of top-ranking groups.

Background

Number-one-voted issue #4915 contained several requests for paging in aggregations. Several different use cases were tied up on that issue so it was closed and this issue has been opened to focus on the use case of paginating top-ranked groups. However, my assumption here is that pagination of ranked groups should be achieved by search and not the aggregations framework.

Pagination = search API

What we established in #21785 is that efficient search (and especially efficient paginated search) depends on heavy down-selection of results at the local level. "Local" can mean same document, same segment (nested docs) or same shard (parent/child). We can rank and page related items only if they are grouped locally (i.e. we do not attempt inefficient pagination on related content that is spread across multiple shards).

The existing parent/Child construct is our means of:

Routing related items to the same shard at index-time

Ensuring a child has exactly one parent and therefore shard

Producing paginated search results for the grouped items

This is why I think Parent/Child might be the answer to tackling the "top group pagination" requirement.

Support for "Orphans"

@paullovessearch suggested that in some systems the parent ID for child docs may serve only as a grouping key and there is no physical parent document to group child docs around at query-time. Some suggested using terms aggs and top_hits but this does not provide the pagination support that is required (or the required indexing discipline which means we can rely on the fact related items are held on the same shard).

Next steps.

I think we have two possible solutions:

Parent/Child queries are adapted to work with missing physical parent docs

Users wanting pagination should provide physical parent docs

As with most things this is a cost/benefit analysis:

Re costs: @martijnvg - we spoke briefly. How insanely complex is 1) to implement?

Re benefits: @paullovessearch - I'd assume parent IDs nearly always have an authoritative data source simply to generate the unique numbers (order numbers, transaction IDs..) and are likely to hold other useful "who/when?" type info e.g. inception dates and instigators. Can you list the use cases where a solution is unlikely to incorporate a data source for parent info?

Issue 2:
running a term facet on a large string field runs into an OutOfMemoryError (-Xmx50g -Xms50g).

Would be great to have the the field cache access disk or that a facet query does not load all the terms of a field into the cache but only the terms of a query.

The second would allow to run multiple facet term query's within different forms and aggregate at the end.

Opened issue as discussed in irc.
Issue 1:
Not sure on best way to describe this bug, but get llvm::StoreInst::AssertOK() exception compiling. Too new to rust to describe expected behavior other than not llvm exception.

Code example at http://is.gd/dOuQoI

Produces result:

rustc: /build/rust-git/src/rust/src/llvm/lib/IR/Instructions.cpp:1086: void llvm::StoreInst::AssertOK(): Assertion `getOperand(0)->getType() == cast<PointerType>(getOperand(1)->getType())->getElementType() && "Ptr must be a pointer to Val type!"' failed.
Aborted

Code duplicated below

pub trait Color {
fn desc(&self) -> &str;
}

pub struct ColorImpl {
desc: &'static str,
}

impl Color for ColorImpl {
fn desc(&self) -> &str {
return self.desc
}
}

pub static RED: ColorImpl = ColorImpl{desc:"red"};

pub trait Suit {
fn color(&self) -> &Color;
fn desc(&self) -> &str;
}

pub struct SuitImpl {
desc: &'static str,
c: &'static ColorImpl,
}

impl Suit for SuitImpl {
fn desc(&self) -> &str {
return self.desc
}
fn color(&self) -> &Color {
return self.c
}
}

static HEART: SuitImpl = SuitImpl{desc:"heart", c: &RED};

fn main() {
assert_eq!("heart", HEART.desc());
}

Issue 2:
EDIT: this issue has been stalled on disagreements about how to handle a nasty problem found during implementation. See the internals thread where this was detailed and discussed.

This is a tracking issue for RFC 213.

The initial implementation of this feature has landed.

cc @nikomatsakis
Issue 1:
Question

In our application, there are some uses of "select ...... for update", when we use sharding-jdbc, these sqls is routed to the slave datasource, which is set read-only, and thus these sqls cannot be exeucted. We solve the problem by using HintManager and setMasterRouteOnly。

My question is, why sharding-jdbc do not route "select ...... for update" to master datasouce by default?

Issue 2:
When I insert data into a field of text type in the database, I report the following error. It seems that sharding has rewritten this field. How to solve this problem?

java.io.NotSerializableException: java.io.StringReader

at java.io.ObjectOutputStream.writeObject0(ObjectOutputStream.java:1184)

at java.io.ObjectOutputStream.writeObject(ObjectOutputStream.java:348)

at com.mysql.jdbc.PreparedStatement.setSerializableObject(PreparedStatement.java:3824)

at io.shardingsphere.shardingjdbc.jdbc.adapter.invocation.JdbcMethodInvocation.invoke(JdbcMethodInvocation.java:47)

at io.shardingsphere.shardingjdbc.jdbc.adapter.AbstractShardingPreparedStatementAdapter.replaySetParameter(AbstractShardingPreparedStatementAdapter.java:264)

at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.setParametersForStatements(ShardingPreparedStatement.java:194)

at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.initPreparedStatementExecutor(ShardingPreparedStatement.java:189)

at io.shardingsphere.shardingjdbc.jdbc.core.statement.ShardingPreparedStatement.execute(ShardingPreparedStatement.java:136)
Issue 1:
Christian Nelson opened SPR-1274 and commented

If the map key contains nested brackets, the key is not properly extracted from the string by BeanWrapperImpl.getPropertyNameTokens(String propertyName).

For example, consider these 'paths':

"entries[some text[abc]]", key = "some text[abc" (missing ])

"entries['some text[abc]']", key = "'some text[abc" (missing ]')

"entries["some text[abc]"]", key = ""some text[abc" (missing ]")

The first one is kinda a stretch, and I didn't expect it to work. My natural reaction was to try the second and third, thinking that grouping it would do the trick. It didn't though.

This came up in the web application I'm working on. There's a form with let's the user assign IDs to textual names. The name sometimes contain brackets, which triggered this issue.

BeanWrapperImpl.java:610 (1.2.4 source) is the cause. The parser could count braces, and return the key when it's found the first matching pair. In the example above, the first ] would be part of the key, and the second, which completes the initial pair, would complete the key. This solution would work regardless of the single or double quotes. An alternative would be to ignore braces that are in quoted ections of the string. This naturally would only work for scenarios #2 and #3 above.

I will try to update BeanWrapperImpl.java with a sllightly more sophisticated bracket parser and submit a patch with tests. If you think it's a waste of time, or if there's something obvious I'm missing, feel free to point out my error. Regards, Christian

Affects: 1.2.4

Attachments:

MapBindingTests.java (2.04 kB)

spr-1274-patch-1.txt (7.68 kB)

spr-1274-patch-2.txt (8.51 kB)

Issue Links:

#6983 Incorrect string parsing of mapped property names ("is duplicated by")

5 votes, 4 watchers

Issue 2:
Kenny MacLeod opened SPR-6159 and commented

Between 3.0.0 M4 and RC1, the protected parseStrongValue method disappeared from PropertyPlaceholderConfigurer. For custom subclasses, this method was the main entry point into the superclass functionality. Since it had not been deprecated, it seemed like the correct thing to do, but has now been removed, breaking compile-time compatibility between 2.5 and 3.0.

Can the method be reinstated somehow, that perhaps invokes the new methods that do the work? It can then be marked as deprecated.

Affects: 3.0 RC1

Issue Links:

#10981 parseStringValue gone from PropertyPlaceholderConfigurer ("is duplicated by")

2 votes, 2 watchers
Issue 1:
Instead of editor.acceptSuggestionOnEnter. I would like to have something like this

{
"editor.acceptSuggestion" : ["Enter" , "Tab" , "Space" ]
}

or maybe

{
"editor.acceptSuggestion" : { "Enter" : true, "Tab" : false }
}

This can be used to inherit from default

Issue 2:
It would be nice if the files/folders text was colorized within the file tree based on the .gitignore files.

For example:

Blue = File Updated
Green = File Added
Gray = File Ignored

Here is an example that shows added files and ignored files:
Issue 1:
Brian Reindel opened SPR-8402 and commented

For instance:

@Controller
public class MyController {

@RequestMapping(value={"/user/id/{id}/delete", "/user/id/{id}/deleted/{deleted}/delete"}, method=RequestMethod.GET)
public ModelAndView updateUserHandler(@PathVariable String id, @PathVariable String deleted) {

/* Implementation */

}
}

That code above will throw an IllegalStateException. Instead, only the following is allowed if I want access to deleted:

@Controller
public class MyController {

@RequestMapping(value="/user/id/{id}/deleted/{deleted}/delete", method=RequestMethod.GET)
public ModelAndView updateUserHandler(@PathVariable String id, @PathVariable String deleted) {

/* Implementation */

}
}

However, this necessitates always providing a value for the deleted parameter. This should instead be treated like request.getParameter(), in that if you try to access a request parameter (or path variable in the case of Spring) that doesn't exist on the path, the value defaults to null.

Affects: 3.0.5

Issue Links:

#12639 Allow optional @PathVariable ("duplicates")

Issue 2:
Patras Vlad Sebastian opened SPR-7984 and commented

Allow mapping the same method to multiple URL's that differ in respect to what path variables they use.

For example we do not want to transfer the id of the logged in user in the URL for security reasons and simplicity, but there are pages that can either show data for the logged in user or an other user, like a profile page.

I would like to be able to map a method like this:

@RequestMapping(value = {"/profile", "/profile/{userId}"})
public String showProfile(@PathVariable("userId") Integer userId) {
if (userId == null) {
userId = <get id of logged in user from session>;
}
//do stuff
}

The first path of the request mapping to does not have a "userId" path variable, and it would be nice if userId (the method parameter) would be null in this case, rather than throwing IllegalStateException.

Affects: 3.0.5

Issue Links:

#13049 A @PathVariable provided in the method parameter, but not in the @RequestMapping, will throw an IllegalStateException. ("is duplicated by")

1 votes, 4 watchers
Issue 1:
Original ticket http://projects.scipy.org/numpy/ticket/523 on 2007-05-17 by @mdehoon, assigned to unknown.

In numpy/numarray/_capi.c, for a number of platforms fenv.h or fenv.c is #included twice.

Lines 227-232 in current source:

if defined(GLIBC) || defined(APPLE) || defined(CYGWIN) || defined(MINGW32)

if defined(GLIBC) || defined(APPLE) || defined(MINGW32)

include <fenv.h>

elif defined(CYGWIN)

include "numpy/fenv/fenv.c"

endif

and further down in lines 2940-2945:

elif defined(GLIBC) || defined(APPLE) || defined(CYGWIN) || defined(MINGW32)

if defined(GLIBC) || defined(darwin) || defined(MINGW32)

include <fenv.h>

elif defined(CYGWIN)

include "numpy/fenv/fenv.h"

endif

In numpy release 1.0.2, the second #include for CYGWIN actually reads

include "numpy/fenv/fenv.c"

so it includes fenv.c instead of fenv.h twice. This causes the somewhat cryptic error message:

In file included from numpy/numarray/_capi.c:2945:

numpy/core/include/numpy/fenv/fenv.c:32: error: redefinition of '__fe_dfl_env'

numpy/core/include/numpy/fenv/fenv.c:32: error: previous definition of '__fe_dfl

_env' was here

In the latest revision of numpy/numarray/_capi.c, the second #include reads fenv.h instead of fenv.c. This appears to be a lucky typo, which actually allows the compilation to proceed. Nevertheless, the second set of #include's seem to be unnecessary.

Issue 2:
Original ticket http://projects.scipy.org/numpy/ticket/513 on 2007-05-07 by trac user jenisys, assigned to unknown.

VERSION: 1.0.2

PLATFORM: Cygwin 1.5.24-2

PYTHON: 2.5.1

file:numpy/core/include/numpy/fenv/fenv.c seems to be included multiple times in some source files. Compilation fails because symbol "__fe_dfl_env" exists twice in same source/object file.

QUICKFIX: Add header-like multi-include protection to source file.
Issue 1:
It would be nice to have Generator.integers match the functionality of Generator.random by allowing usage of the out parameter.

Use case: Repeatedly generating large arrays of indices, without needing to allocate new memory each time.

Issue 2:
I encountered a curious performance issue in numpy.dot multiplication of an N-dimensional array with a 2-dimensional array. I consistently found it to be a factor 15-20 faster to first reshape arrays to 2-dimensional arrays, do the multiplication on the reshaped arrays, and then reshape back.

I'm including my code at the end of this message. It appears that the same observation has been made by hpaulj and buried in a StackOverflow question: http://stackoverflow.com/questions/33004551/why-is-b-numpy-dota-x-so-much-slower-looping-through-doing-bi-numpy. I would love to have numpy.dot automatically do the reshaping, it's much more user-friendly.

Here is a related post: https://www.huyng.com/posts/faster-numpy-dot-product. I believe it is better to invoke BLAS through reshaping than the solution proposed there.

Thanks!

(tested on: numpy 1.12.1 on anaconda with python 3.6.0, mac on intel)

import numpy as np

n1 = 400
n2 = 50
n3 = 100
n4 = 200

A = np.random.random((n1,n2,n3))
B = np.random.random((n3,n4))

direct = A @ B # result has shape (n1,n2,n4)
indirect = (A.reshape((n1*n2,n3)) @ B).reshape((n1,n2,n4))

np.allclose(direct,indirect) # True

%timeit A @ B
#1 loop, best of 3: 195 ms per loop
%timeit (A.reshape((n1*n2,n3)) @ B).reshape((n1,n2,n4))
#10 loops, best of 3: 27.7 ms per loop
Issue 1:
As an Javascript developer, I tried to implement the dependency injection, by using the tool introduced in rbuckton/ReflectDecorators (https://github.com/rbuckton/ReflectDecorators.git). However, I just found the following code will be compiled into an anonymous class declaration in js file.

@log
class A {
constructor() {
Debug.log('A created');
}

afunc() {}

bfunc() {}

}

The decorator @log is quite simple, it is to print the class name.

// class decorator
function log(target: any) {
console.log(target.name);
....
}

The generated javascript is as follows. I turned "emitDecoratorMetadata" to true in tsconfig.json

let A = class {
constructor() {
Debug_1.Debug.log('A created');
}
afunc() { }
bfunc() { }
};
A = __decorate([
decorators_1.log,
__metadata('design:paramtypes', [])
], A);

I am so frustrated to see that constructor A is actually a class without name - the target in decorator code is an actually anonymous constructor function.

I do not know why. I can not figure out why make it anonymous if one decorator is there. As a result, I have to implement it like the following, which looks really odd and confusing, by using metadata Reflect API:

@logClass('A')
class A {
constructor() {
Debug.log('A created');
}

afunc() {}

bfunc() {}

}

After investigation in sources of Typescript, I found the following lines related to this issue:

in function emitClassLikeDeclarationForES6AndHigher(node), it reads:

...
write("class");
if ((node.name || (node.flags & 1024 && staticProperties.length > 0)) && !thisNodeIsDecorated) {
write(" ");
emitDeclarationName(node);
}

So while compiling class A, thisNodeIsDecorated is true and the name is never emitted. May I ask why? Would it better to just emit class name, like the following? Please let me know, if I missed something. Thanks very much.

let A = class A {
constructor() {
Debug_1.Debug.log('A created');
}
afunc() { }
bfunc() { }
};
A = __decorate([
decorators_1.log,
__metadata('design:paramtypes', [])
], A);

Issue 2:
I have decorator:

export function Document() {
return function(objectConstructor: Function) {
console.log(objectConstructor.name); // when targeting es5 it gives me what I want - the name of my class. When targeting es6 it does not give anything
}
}

Here is decorator usage:

@Document()
export class User {
}

Im using "User" class name to create a document called "User", I need information how class is called. I always used es5, but now when I switched to es6 compile target I dont have information about class name anymore. Is it a bug, or it by design? If second then what is the way to get the class name?
Issue 1:
Challenge Waypoint: Local Scope and Functions has an issue.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/47.0.2526.106 Safari/537.36.

Please describe how to reproduce this issue, and include links to screenshots if possible.

My code:

function myFunction() {
var myVar = "foo";
console.log(myVar);
}
myFunction();

// run and check the console
// myVar is not defined outside of myFunction

// now remove the console.log line to pass the test

Issue 2:
Challenge Waypoint: Local Scope and Functions has an issue.

User Agent is: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_11_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/48.0.2564.48 Safari/537.36.

The test asks you to remove the second console.log() to pass. When you remove the second console.log() it still fails. You have to remove both console.log() calls to pass(including the one inside myFunction().)

Reproducible every time by removing the console.log() outside of myFunction(), as asked by test. I'm assuming this is a bug in the test and not the text as there's no reason to remove the console.log() call within myFunction().
Issue 1:
Original ticket http://projects.scipy.org/scipy/ticket/1237 on 2010-07-17 by trac user cjgohlke, assigned to unknown.

The attached patches enable ndimage to work on Python 3.1. All tests pass on Python for Windows 2,6, 2.7, and 3.1, 32 and 64 bit.

Issue 2:
I'm unable to install scipy using pip3. I only have one version of python installed.

python3 version 3.9.0

pip3 version 20.2.4

I am able to install pandas and numpy but facing some error (link below) while trying to install scipy / seaborn.

https://www.codepile.net/pile/M1a0nVgD
Issue 1:
The specific renderer depends on a global variable named 'camera'. If in any of the three deferred testcases you rename the 'camera' variable to lets say 'my_camera' then the renderer does not work giving the error "Uncaught ReferenceError: camera is not defined"

Issue 2:
If you don't have a global camera named camera, WebGLDeferredRenderer will throw an exception: Uncaught ReferenceError: camera is not defined WebGLDeferredRenderer.js:335

Test case: Search&replace (i.e. change) the name of the variable camera in e.g. webgldeferred_animation.html
Issue 1:
Bug report

Bug summary

When using loglog plot for plotting gain/phase vs. frequency and setting yticks and labels, the ylim([min max]) writes as powers, whereas I try to set the end-points in whole numbers.

import numpy as np
import matplotlib.pyplot as plt

freq = np.linspace(20, 20e3, 1000) # Frequency vector

# Generate gain vector
gain = []
for frequency in freq:
gain.append(27.4)
gain = np.array(gain)

fig = plt.figure(dpi=300)
plt.yscale('log')
plt.xticks([20, 100, 1000, 10000, 20000], ['20', '100', '1k', '10k', '20k'])

plt.loglog(freq, gain, color='red', lw=1.3)

ytickval = []
yticknotate = []
for i in range(20, 31):
ytickval.append(i)
yticknotate.append(str(i))

plt.yticks(ytickval, yticknotate)
plt.xlim(20, 75000)
plt.ylim(20,30)
plt.show()

Actual outcome

**Expected outcome**
The expected outcome is end-points (20dB and 30dB) written as 20 and 30 respectively, instead of 2*10^1 and 3*10^1

**Matplotlib version**
<!--Please specify your platform and versions of the relevant libraries you are using:-->
* Operating system: Windows 10 Education
* Matplotlib version: 3.0.2
* Matplotlib backend (`print(matplotlib.get_backend())`): Qt5Agg
* Python version: 3.6.8 (anaconda)
* Jupyter version (if applicable): 4.4.0
* Other libraries: Numpy

<!--Please tell us how you installed matplotlib and python e.g., from source, pip, conda-->
<!--If you installed from conda, please specify which channel you used if not the default-->
Used the default conda channel.

Issue 2:
Bug report

Bug summary

Setting axis ticks in a small log scale produces duplicate tick labels.

Code for reproduction

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
s = 10
ax.axis([s, 100, 10, 100])
ax.loglog([20, 30], [30, 40])
from matplotlib.ticker import ScalarFormatter
for axis in [ax.xaxis, ax.yaxis]:
axis.set_major_formatter(ScalarFormatter())

ax.set_xticks([20, 55])
ax.set_yticks([20, 55])
plt.show()

Actual outcome

change code a little bit

import matplotlib.pyplot as plt
fig, ax = plt.subplots()
s = 9
ax.axis([s, 100, 10, 100])
ax.loglog([20, 30], [30, 40])
from matplotlib.ticker import ScalarFormatter
for axis in [ax.xaxis, ax.yaxis]:
axis.set_major_formatter(ScalarFormatter())
ax.set_xticks([20, 55])
ax.set_yticks([20, 55])
plt.show()

Expected outcome

Matplotlib version

Operating system: Ubuntu 16.04

Matplotlib version: 2.2.2

Matplotlib backend: Qt5Agg

Python version: 3.6