WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
What version of Go are you using (go version)?

go version go1.6 linux/amd64

and

go version devel +ea4b785 Tue Mar 15 08:43:34 2016 +0000 linux/amd64

What operating system and processor architecture are you using (go env)?

GOARCH="amd64"
GOBIN=""
GOEXE=""
GOHOSTARCH="amd64"
GOHOSTOS="linux"
GOOS="linux"
GOPATH="/home/justinn/Workspace/go"
GORACE=""
GOROOT="/usr/lib/go"
GOTOOLDIR="/usr/lib/go/pkg/tool/linux_amd64"
GO15VENDOREXPERIMENT="1"
CC="gcc"
GOGCCFLAGS="-fPIC -m64 -pthread -fmessage-length=0"
CXX="g++"
CGO_ENABLED="1"

What did you do?

Benchmarked (a function that calls) strings.Join and looked at the memory allocations with pprof. (With go test -bench Join -benchmem -memprofile mem.pprof -memprofilerate 1 -run ^$)

Benchmarks for strings.Join: http://play.golang.org/p/R7snLsnFmg

Benchmark results:

BenchmarkJoin0-8 500000000 3.21 ns/op 0 B/op 0 allocs/op
BenchmarkJoin1-8 500000000 3.66 ns/op 0 B/op 0 allocs/op
BenchmarkJoin2-8 20000000 80.8 ns/op 6 B/op 2 allocs/op

Memory profile for strings.Join (go tool pprof --alloc_objects <binary> mem.pprof):

1204055 1204055 (flat, cum) 100% of Total
. . 358: n := len(sep) * (len(a) - 1)
. . 359: for i := 0; i < len(a); i++ {
. . 360: n += len(a[i])
. . 361: }
. . 362:
602028 602028 363: b := make([]byte, n)
. . 364: bp := copy(b, a[0])
. . 365: for _, s := range a[1:] {
. . 366: bp += copy(b[bp:], sep)
. . 367: bp += copy(b[bp:], s)
. . 368: }
602027 602027 369: return string(b)
. . 370:}

What did you expect to see?

The compiler reusing the memory of b for the return value.

What did you see instead?

The []byte->string conversion in strings.Join (on line 369) allocates a new string, although the []byte could be reused as there can never be a reference to the []byte after the function returns and the []byte is already on the heap¹.

¹ Calling 'go build -gcflags="-m" in the strings package confirms this:

./strings.go:363: make([]byte, n) escapes to heap
./strings.go:369: string(b) escapes to heap

(Line numbers are from tip)

Issue 2:
In this function,

func hi() string {
b := make([]byte, 0, 100) // 1st alloc
b = append(b, "Hello, "...)
b = append(b, "world.\n"...)
return string(b) // 2nd alloc, but could be removed.
}

The final line currently generates a call to runtime.slicebytetostring, causing a copy
of b to be allocated.

But the compiler already knows that b doesn't escape. It could instead return a string
header re-using the []byte memory.
Issue 1:
1) make a foo_amd64.s with only "# hi" in it (no trailing newline)

2) make a foo.go file, package foo

2) go build .

Output is unhelpfully:

$ go build .
# foo
eof in comment

It should say which file at least.

Issue 2:
old6a etc will stay in the release candidates for checking against cmd/asm during testing,

but for the final release they will be deleted and cmd/asm will be the only assembler.
Issue 1:
If you use setSource on a SearchRequestBuilder and then call to string the SearchRequest will appear to be cleared.

SearchRequestBuilder srb = client().prepareSearch().setSource("{\"query\":\"match\":{\"foo\":\"bar\"}}");
srb.execute().get();

Will execute the correct search, however

SearchRequestBuilder srb = client().prepareSearch().setSource("{\"query\":\"match\":{\"foo\":\"bar\"}}");
logger.debug("About to execute [{}]",srb.toString());
srb.execute().get();

Will execute an empty search.

The problem is that toString() calls internalBuilder() which calls sourceBuilder()

private SearchSourceBuilder sourceBuilder() {
if (sourceBuilder == null) {
sourceBuilder = new SearchSourceBuilder();
}
return sourceBuilder;
}

Then when the SearchRequestBuilder.execute is called the request that was constructed via setSource is replaced by an empty sourceBuilder.

@Override
protected void doExecute(ActionListener<SearchResponse> listener) {
if (sourceBuilder != null) {
request.source(sourceBuilder());
}
client.search(request, listener);
}

Issue 2:
Using the Java API, If one sets the content of a search request through SearchRequestBuilder#setSource methods and then calls toString to see the result, not only the content of the request is not returned as it wasn't set through sourceBuilder(), the content of the request gets also reset due to the internalBuilder() call in toString.

Here is a small failing test that demontrates it:

SearchRequestBuilder searchRequestBuilder = new SearchRequestBuilder(client()).setSource("{\n" +
" \"query\" : {\n" +
" \"match\" : {\n" +
" \"field\" : {\n" +
" \"query\" : \"value\"" +
" }\n" +
" }\n" +
" }\n" +
" }");
String preToString = searchRequestBuilder.request().source().toUtf8();
searchRequestBuilder.toString();
String postToString = searchRequestBuilder.request().source().toUtf8();
assertThat(preToString, equalTo(postToString));
Issue 1:
% deno
Deno 1.18.0
exit using ctrl+d or close()
> "😂"[0]
Uncaught "Unterminated string literal"

I suggest printing the escaped value, "\uD83D", like Chromium.

Issue 2:
At the moment Deno.args is string[], but doesn't work like an array:

> Deno.args.pop()
Uncaught TypeError: Cannot assign to read only property 'length' of object '[object Array]'
at Array.pop (<anonymous>)
at <anonymous>:2:11
> Deno.args[0] = 'x'
Uncaught TypeError: Cannot add property 0, object is not extensible
at <anonymous>:2:14
Issue 1:
We need something like ReplicationController that runs RestartOnFailure and RestartNever pods "to completion", collects results, etc

Issue 2:
Is this a request for help? (If yes, you should use our troubleshooting guide and community support channels, see http://kubernetes.io/docs/troubleshooting/.): No

What keywords did you search in Kubernetes issues before filing this one? (If you have found any duplicates, you should instead reply there.):

delete patch type with no merge key defined

cannot apply deleted mountpath kubernetes

Is this a BUG REPORT or FEATURE REQUEST? (choose one): BUG REPORT

Kubernetes version (use kubectl version):

Client Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.1", GitCommit:"33cf7b9acbb2cb7c9c72a10d6636321fb180b159", GitTreeState:"clean", BuildDate:"2016-10-10T18:19:49Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}
Server Version: version.Info{Major:"1", Minor:"4", GitVersion:"v1.4.4", GitCommit:"3b417cc4ccd1b8f38ff9ec96bb50a81ca0ea9d56", GitTreeState:"clean", BuildDate:"2016-10-21T02:42:39Z", GoVersion:"go1.6.3", Compiler:"gc", Platform:"linux/amd64"}

Environment:

Cloud provider or hardware configuration: AWS

OS (e.g. from /etc/os-release): Arch Linux

Kernel (e.g. uname -a): Linux niagara 4.8.4-1-ARCH #1 SMP PREEMPT Sat Oct 22 18:26:57 CEST 2016 x86_64 GNU/Linux

Install tools: ?

Others: ?

What happened: After removing one of the pod container's volumeMounts from a deployment spec file and attempted to apply it using kubectl apply -f test-deploy.yaml, I got the following error message:

"test-deploy.yaml": delete patch type with no merge key defined

What you expected to happen: changes to take effect successfully

How to reproduce it (as minimally and precisely as possible):

Create a deployment below:

apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: rm-mount-test
spec:
replicas: 1
template:
metadata:
labels:
uid: abcdefght
spec:
containers:
- name: debian
image: debian
args:
- sleep
- "100000"
volumeMounts:
- mountPath: /empty
name: empty
- mountPath: /empty2
name: empty2
volumes:
- name: empty
emptyDir:
- name: empty2
emptyDir:

Once successfully up, remove the lines below and use kubectl apply to update it:

- mountPath: /empty2
name: empty2

Anything else do we need to know:
Issue 1:
Is this a bug (note the different dtypes of the output)?

In [1]: np.array([1, 2, 3], dtype=str)
Out[1]:
array(['1', '2', '3'],
dtype='|S1')

In [2]: np.array([1, 2, 3]).astype(str)
Out[2]:
array(['1', '2', '3'],
dtype='|S24')

This behavior is new to numpy 1.7.0 (and breaks some unit tests in one of my packages).

Issue 2:
I came across something that might be a bug in the numpy unique function. Here is an example.

In my case, a is a numpy array holding indices referring to pairwise equal elements in two other vectors (not shown). It could for instance be:

a=np.array([[1,2],[3,4],[1,2],[5,6,7]])

In this case, element 1 and 2 are pairwise equal in the two arrays not show. The same goes for element 3 and 4, and elements 5,6,7.

Since the [1,2] pair is occuring twice, I want to remove the duplicate entry. I use

In [18]: np.unique(a)

Out[18]: array([[1, 2], [3, 4], [5, 6, 7]], dtype=object)

However, what causes me trouble, is when there are only two pairwise identical elements:

In [19]: a=np.array([[1,2],[3,4],[1,2],[5,6]])

In [20]: np.unique(a)

Out[20]: array([1, 2, 3, 4, 5, 6])

Now, the output has a completely different meaning for my purpose.

Is the unique function supposed to work this way?
Issue 1:
Barry Lagerweij opened SPR-323 and commented

EJB's that depend on other beans cannot use Dependency Injection. Instead, they must use code like

ProductDAO dao = super.getBeanFactory().getBean("ProductDAO");

It would be a huge improvement if EJB's could have something like:

ProductDAO getProductDAO () { return this.productDAO; }

void setProductDAO ( ProductDAO dao) { this.productDAO = dao; }

For this to work, it would be nice if Spring would support a marker interface (like BeanNameAware), so that Spring could determine a EJB's name, and inject dependant objects.

Spring already provides an AbstractStatelessSessionBean base-class. This class needs to be improved.

For example:

AbstractStatelessSessionBean

{

void ejbCreate()

{

if (this instanceof BeanNameAware)

{

String name = ((BeanNameAware)this).getName();

XXXUtils.injectDependencies(getBeanFactory(),name,this);

}

}

}

Affects: 1.1 final

Issue Links:

#6115 Allow declarative dependency injection for EJB components ("is duplicated by")

3 votes, 2 watchers

Issue 2:
Bubba Puryear opened SPR-1432 and commented

The FreeMarkerConfigurer class cleverly adds a ClassTemplateLoader in it's postProcessConfiguration() callback. While it is certainly possible for developers to subclass this class and "do the same trick" to add their own ClassTemplateLoaders, this seems like overkill. Just having an option property on the class of TemplateLoader[] that gets added to the MultiTemplateLoader puts it all in configuration. I'll attach a small patch after I get this issue openned.

Our local need arises out of having several project that use Spring w/ FreeMarker and we'd like to share some common FreeMarker macros. Putting the ftl in a common jar seems like a reasonably way to distribute these macros, so we'd like an easy way to tell Spring to tell FreeMarker to look in a couple of places to find macro files.

Affects: 1.2.5

Attachments:

freemarker.configurer.patch (1.83 kB)

Issue Links:

#6060 Make it possible to wire multiple template loaders with FreemarkerConfigurer ("duplicates")
Issue 1:
Carl Harris opened SPR-7911 and commented

Some REST web services return 204 No Content as the result for a GET in certain circumstances. With this status, the response has no entity body and thus no Content-Type header.

RestTemplate.getForEntity throws an exception when receiving such a response:

org.springframework.web.client.RestClientException: Cannot extract response: no Content-Type found

An improvement for RestTemplate.getForEntity would be to return a ResponseEntity instance with the statusCode property set as appropriate for 204 No Content, and null values for the body and contentType properties.

I considered trying to extend RestTemplate to make it behave in this manner. Unfortunately, the extensive use of private static classes in the implementation makes it difficult to override the behavior of getForEntity -- can't just replace the ResponseEntityResponseExtractor implementation without also replacing other unrelated collaborators (e.g. AcceptHeaderRequestCallback). It's possible to do it, it would just require a lot more code duplication than really seems warranted.

If you don't wish to change the behavior of RestTemplate.getForEntity, perhaps you might consider relaxing the access modifiers on these collaborator classes so that a subclass could make use of them?

Affects: 3.1 M1

Issue Links:

#12671 RestTemplate - support response mapping to entity with potentially empty response body. ("is duplicated by")

Referenced from: commits c42671a, 9887025

1 votes, 1 watchers

Issue 2:
Stepan Koltsov opened SPR-7979 and commented

Have simple configuration:

public abstract class Aaaaa { }

public class Bbbbb extends Aaaaa { }

@Configuration

@ComponentScan(

basePackages="com.mycompany",

useDefaultFilters=false,

includeFilters={

@ComponentScan.Filter(type=FilterType.ASSIGNABLE_TYPE, value=Aaaaa.class)

}

)public class Conf {

@Autowired
private Bbbbb bbbbb;

}

when loaded with

new AnnotationConfigApplicationContext(Conf.class)

works fine, however, when loaded with XML config that references Conf.class:

<beans>

<bean class="com.mycompany.Conf"/>

</beans>

new ClassPathXmlApplicationContext("classpath:com/mycompany/conf.xml");

it fails with exception: cannot autowire Conf.bbbbb field. Full stack trace: https://gist.github.com/835493 .

Affects: 3.1 M1

Attachments:

mylyn-context.zip (236.68 kB)

Issue Links:

#13361 @ComponentScan(includeFilters=@Filter(...)) fails when @Import'ed ("duplicates")

#13670 @ComponentScan with includeFilters on @Import-ed context does not work

#13738 ClassPathBeanDefinitionScanner vs ClassPathBeanDefinitionScanner: difference in behavior when dealing with @ComponentScan excludeFilters

Referenced from: commits d9f7fdd

1 votes, 0 watchers
Issue 1:
In other IDEs I used to simple copy a line break and paste it to the find text box. Then I could replace it with some other string.

I tried to do it with regex find using "\n" or "\r" and I had no luck either.

This is very helpful when creating db queries or csv files on the fly by replacing line breaks with strings like: '");' or whenever you detect some char (like >) you can replace it with a breakline.

Thanks a lot!

Issue 2:
The Find dialog (Ctrl+F) does not allow multi-line finds using the \n character as it currently considers each line individually. See TextModel._doFindMatches

Created out of a discussion in #278
Issue 1:
Migrated issue, originally created by Patrick Rusk

(This problem was noted in comments in zzzeek/sqlalchemy@3fa38a1 but not followed up on.)

The sqlalchemy.orm.Query() class takes an entities parameter defined to be "a sequence of entities and/or SQL expressions", but it used to actual accept a single SQL expression as well. Now, some such expressions cause a "TypeError: Boolean value of this clause is not defined" exception to be raised.

The offending line is https://github.com/zzzeek/sqlalchemy/blob/master/lib/sqlalchemy/orm/query.py#L150

As noted in the comments, changing it to if entities is not None: would probably fix the issue.

Test case:

from sqlalchemy.ext.declarative import declarative_base
from sqlalchemy import Column, Integer
import sqlalchemy.sql

class User(declarative_base()):
__tablename__ = 'users'
id = sqlalchemy.Column(sqlalchemy.Integer, primary_key=True)

select = sqlalchemy.sql.func.max(User.id).label('max')
query = sqlalchemy.orm.Query(select)

...works under 1.2.7, but generates this stack trace under 1.2.8...

---------------------------------------------------------------------------
TypeError Traceback (most recent call last)
<ipython-input-1-cf50a8343d19> in <module>()
8
9 select = sqlalchemy.sql.func.max(User.id).label('max')
---> 10 query = sqlalchemy.orm.Query(select)

/Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/orm/query.pyc in __init__(self, entities, session)
140 self.session = session
141 self._polymorphic_adapters = {}
--> 142 self._set_entities(entities)
143
144 def _set_entities(self, entities, entity_wrapper=None):

/Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/orm/query.pyc in _set_entities(self, entities, entity_wrapper)
148 self._primary_entity = None
149 self._has_mapper_entities = False
--> 150 if entities:
151 for ent in util.to_list(entities):
152 entity_wrapper(self, ent)

/Users/patrick/.virtualenvs/shackleton/lib/python2.7/site-packages/sqlalchemy/sql/elements.pyc in __bool__(self)
485
486 def __bool__(self):
--> 487 raise TypeError("Boolean value of this clause is not defined")
488
489 __nonzero__ = __bool__

TypeError: Boolean value of this clause is not defined

Anyone experiencing this can easily fix their issue by throwing [] around their expression, but it is a breaking change (of an undocumented feature).

(Please forgive the nonsensical test case above. I've never used SQLAlchemy. Just diagnosing a bug in someone else's code.)

Issue 2:
Migrated issue, originally created by Charles-Axel Dein (@charlax)

I'm upgrading a codebase to sqlalchemy 1.0.0beta5 from 0.9.9.

It seems that version 1 removed the ability to be forgiving about mentioning a join twice:

session.query(Toaster).join(Toast).join(Toast).all()

This will raise with postgres: ProgrammingError: (psycopg2.ProgrammingError) table name "toasts" specified more than once

The same query run with sqla 0.9.9 runs fine, because I guess it removes the duplicate join.

I'm not sure that can be considered a regression given that joins should not be mentioned more than once, but it's definitely a different behavior from 0.9.9
Issue 1:
VSCode Version: 0.10.11

OS Version: Windows 10

How can I setting open file in new tab when I select it from folder/file tree just like sublime text?(not replaced opened tab.)

I can't find where to config this.

Could anybody help me please?

Thx!

Issue 2:
I really miss proper tabs for open files (like VS proper), and the ability to rip a tab out into its own window.
Issue 1:
We are currently using Jest for running playwright test cases. So this code is working perfectly fine for us:

import { runCLI } from "jest";
const { results } = await runCLI(
{
$0: "",
config: jestConfigPath,
...options,
_: testNamePatterns,
},
[integrationTestsPackagePath]
);

We are getting test results and we can decide the next steps for test run.

We would like to switch to playwright-test-runner.

We would like to create playwright.config.ts on runtime and then run playwright tests cases using similar command above for playwright test runner.

What we want is to somehow expose this line of code (#154):

const result = await runner.run(!!opts.list, filePatternFilters, opts.project || undefined);

playwright/src/test/cli.ts

Line 154
in
eafba43

async function runTests(args: string[], opts: { [key: string]: any }) {

This function should be exposed so that we can consume it in our Typescript code to run playwright test cases using playwright test runner.

Issue 2:
We're currently using jest as a test runner for testing angular applications using playwright. In the angular ecosystem tools usually integrate with the @angular/cli by providing a builder, so our @ngx-playwright/jest package is actually what powers the ng e2e command in our repositories.

It would be great if we could write such an integration for the @playwright/test runner as well, but that'd require access to the runner APIs.

While it would be possible to execute the playwright CLI in a new process, this would make certain integrations harder or hacky. For instance passing configuration from the angular.json into the test runner would require turning those into CLI arguments and passing the base URL the angular app is hosted at into the runner would require a workaround using the child process's environment to pass this along.
Issue 1:
matthew inger opened SPR-834 and commented

The LocalSessionFactory bean currently has no way to set listeners on the SessionFactory (via the Configuration.setListener) method. This should as simple as accepting a map as a property of the LocalSessionFactoryBean, and when building the Configuration object, iterating through it, and calling Configuration.setListener on each iteration.

Affects: 1.2 RC1

Attachments:

LocalSessionFactoryBean.patch (2.93 kB)

Issue Links:

#5519 Support For Event Listeners ("is duplicated by")

Issue 2:
Chris Beams opened SPR-8114 and commented

When using Spring's FactoryBean types such as LocalSessionFactoryBean destruction of the actual bean (the Hibernate Session in the case of LSFB) is usually handled automatically by the FactoryBean.

However, when using Spring's new *Builder APIs within @Bean methods, no FactoryBean-like object is registered with the container. This means that it is up to the user to remember to configure the destroy-method attribute of the @Bean annotation, which is likely to be forgotten.

To remedy this situation, Spring should automatically detect common close/destruction method names and signatures and automatically invoke them at container shutdown time.

Obviously, Spring's DisposableBean is already supported in this way, as are methods annotated with @PreDestroy. When dealing with third-party types, however, the user is not at liberty to add these interfaces/annotations. In the case of Hibernate's Session interface, the method to be called is

public Connection close() throws HibernateException;

As this method is not annotated in any way nor does it implement any standard interface with destruction semantics, we can only assume based on it's name that it is to be invoked.

Attachments:

mylyn-context.zip (4.40 kB)

mylyn-context.zip (4.40 kB)

Issue Links:

#12076 Provide alternatives to using FactoryBean types within @Bean methods

Referenced from: commits 5c27a04, 1a8531b
Issue 1:
Environment

Windows build number: 19041.329
PowerToys version: v0.18.2
PowerToy module for which you are reporting the bug (if applicable): PowerToys Run

Steps to reproduce

Open PowerToys.

Make sure PowerToys Run is enabled.

Restart PowerToys.

Look carefully at the screen. A glitch (probably the foreground of the search bar) will appear that will last less than half a second. You can see better on a white background.

Or,

Open PowerToys.

Disable PowerToys Run.

Enable PowerToys Run.

Wait for the glitch.

Expected behavior

There shouldn't be any glitch when opening PowerToys. It might be annoying, and distracting, especially if you set PowerToys to launch at startup.

Actual behavior

When PowerToys is launched, or PowerToys Run is enabled, a glitch that contains the parts of the search bar, appears, and then disappears in a fraction of a second. This gives an unpleasant user experience.

Screenshots

Issue 2:
📝 Provide a description of the new feature

I´m using a set of monitors physically at work(2x 35''), and a different setup of monitors at home (2x27").

I have different fanzyzones layout for the two, but when moving from one location to the other, I must rearrange all apps to the zones. Fanyzones will not automatically place the programs inside the zones, even though it loads the correct monitor setup.

Can FancyZones do this for me automatically? or have a option to force apps to move to their assigned zone.

If you'd like to see this feature implemented, add a 👍 reaction to this post.
Issue 1:
There is

Try looking at the lastLetterOfLastName variable declaration if you get stuck.

but should be

Try looking at the lastLetterOfFirstName variable declaration if you get stuck.

Issue 2:
Challenge http://www.freecodecamp.com/challenges/waypoint-use-bracket-notation-to-find-the-last-character-in-a-string has an issue. Please describe how to reproduce it, and include links to screenshots if possible.

Try looking at the lastLetterOfLastName variable declaration if you get stuck.

should bt

Try looking at the lastLetterOfFirstName variable declaration if you get stuck.