WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
by aChrisSmith:

It appears that go does not emit DWARF debugging information when building programs
using cgo. (At least not on OS X / Darwin; haven't checked on another other OS.) Ideally
debugging information would be present regardless of using cgo. And, if I could have a
pony too, I'd love the DWARF information for the C-code as well.

I've included two versions of a toy app (fizzbuzz), one which uses cgo and one which
does not. When using `dwarfdump` to inspect the debugging info, the .debug_contents
section of the Mach-O binary appear to be empty.

go version prints "go version go1.3.3 darwin/amd64"

Repro:

# Verify debugging symbols are generated when not using cgo
1. $ go build without_cgo.go
2. $ dwarfdump without_cgo
3. < Look at all the wonderful debugging symbols >

# Verify debugging symbols NOT generated when using cgo
1. $ go build with_cgo.go
2. $dwarfdump with_cgo
3. <Look in dismay at the lack of precious debugging information >

Output:

----------------------------------------------------------------------
File: with_cgo (x86_64)
----------------------------------------------------------------------
.debug_info contents:
< EMPTY >

Attachments:

with_cgo.go (474 bytes)

without_cgo.go (321 bytes)

Issue 2:
by xofyarg:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.
1. start a tls server[1] writing in go with tls pkg
2. connect the server using a client built with openssl
3. send something to server

What is the expected output?
client's data is received or error occured.

What do you see instead?
Server got two read event. The former returns no data or error. The latter gets the data
that client sent before.

Which compiler are you using (5g, 6g, 8g, gccgo)?
6g

Which operating system are you using?
OSX Lion/Linux-2.6.32/Linux-3.0

Which version are you using? (run 'go version')
go1.0.3 and go1.1beta2

Please provide any additional information below.
[1] go server: http://play.golang.org/p/N_d4hjcRft

[2] commands to generate server key pair:
openssl genrsa 1024 > srv.key
openssl req -new -x509 -nodes -sha1 -days 365 -key srv.key > srv.cer

[3] client:
openssl: $ echo -n "hello" | openssl s_client -connect 127.0.0.1:8080 -tls1
python:
import socket
import ssl
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect(('localhost', 8080))
ss = ssl.wrap_socket(s, ssl_version=ssl.PROTOCOL_TLSv1)
ss.write('hello')
ss.close()
Issue 1:
I have an interface that is supposed to have a function signature of:

(param: {prop: boolean}): any

but I forget the parameter name (I'm not sure if this signature is considered valid):

({prop: boolean}): any

When compiling this invalid interface with the --declaration flag, an invalid .d.ts file results:

/* foo.ts */
export interface SomeInterface {
({prop: boolean}): any
}

tsc foo.ts --module commonjs --declaration

/* foo.d.ts */
export interface SomeInterface {
({prop: }: {
prop: any;
}): any;
}

If parameter names are optional, this should produce a valid .d.ts file. If parameter names are required, tsc should throw an error, or at least warn me that there is an issue.

Issue 2:
Destructuing is not handled correctly (either object literal or array binding pattern) in during declaration emit.

Eg.

TypeScript

var { a, b } = { a: "10", b: 10 };

Generates

``` TypeScript```
declare var { a, b }: any;

Expected:

TypeScript

declare var a: string, b: number;
Issue 1:
Simply trying to save a file to D:\ raises the following error:

EPERM: operation not permitted, mkdir 'd:'

Issue 2:
In version 0.10.1 it is no longer possible to write to the root of a drive (which worked up to 0.9.1).

When trying to save to e.g. r:\example.txt, the following error message appears:

EPERM: operation not permitted, mkdir 'r:\'

Tested on Windows 7 Ultimate and Windows 10 Professional, US language, German region settings.
Issue 1:
by hanks_j@ligo-wa.caltech.edu:

What steps will reproduce the problem?
If possible, include a link to a program on play.golang.org.

1. Setup a web-server serving https with a certificate from a local CA

2. Point the program listed at http://play.golang.org/p/iKScTFUQl3 at the server

3. The program is unable to complete the TLS handshake.

What is the expected output?

The program should complete a TLS handshake and exit without errors.

What do you see instead?

Two error conditions:
1. if certificate verification is enabled, it states that the certificate is signed by an unknown authority
2. if certificate verification is disabled, it states that there is a bad record MAC.

I have verified that the certificate chain is complete, that the certificate and key are
the correct pair.

Which compiler are you using (5g, 6g, 8g, gccgo)?

gc

Which operating system are you using?

Ubuntu 10.04 amd 64bit
Debian 6 amd 64bit

Which version are you using? (run 'go version')

Tested on 1.0.2, 1.0.3, tip

Please provide any additional information below.

This could be a problem with my CA setup. However the CA and the test web server
satisfy both gnutls and openssl. Both report the certificate chain as being valid. I
can make the connection with anything else.

I have attached a sample certificate, key, and ca certificate that I tested against. It
is a horribly weak key. However key length does not seem to change the outcome. I have
tested this with 512 bit and 2048 bit rsa keys.

I ran into this issue while attempting to consume a https resource in a program I am
working on.

Attachments:

server1_cert.pem (1018 bytes)

server1_key.pem (493 bytes)

ca-cert.pem (855 bytes)

Issue 2:
What steps will reproduce the problem?

1. go get github.com/josharian/gostripbug
2. cd $GOPATH/src/github.com/josharian/gostripbug
3. make

What is the expected output?

Hello

What do you see instead?

runtime: function symbol table header: 0x0x0 0x0x0
fatal error: invalid function symbol table

runtime stack:

Which compiler are you using (5g, 6g, 8g, gccgo)?

6g, 6l. Also reproduces with 5g, 5l. Haven't tried others.

Which operating system are you using?

OS X, arm/linux.

Which version are you using? (run 'go version')

go version devel +75118231847b Thu Sep 12 00:15:28 2013 +0200 darwin/amd64

Please provide any additional information below.

Does not reproduce with Go 1.1.

I'd love to know for future reference -- if I wanted to write a test case for this in
the Go source tree (so I could reference a CL that others could build on instead of
making a separate GitHub repo), where would it belong?
Issue 1:
The node module util uses Object.create in the inherit-function. But in IE8 and lower Object.create is not defined. Thus util requires a shim to work properly in these browsers.

Not all JavaScript 1.8.5 features available in Object.create can be emulated but for the purpose of inherit I think this one provided by the MDN will do it.

Issue 2:
Do you want to request a feature or report a bug?

I'd say it's a feature.

What is the current behavior?

Currently, all messages (be it warnings, errors, etcetera) are hard-coded, which reduces maintainability.

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

N/A

What is the expected behavior?

N/A

If this is a feature request, what is motivation or use case for changing the behavior?

I suggest we create a messages.json (or of any format for that matter, as long as one can parse it fairly easily) that defines all the different types of messages. This

enhances maintainability

improves readability

reduces the headache of searching through a large code base for the particular message, and then updating it (imagine if the same error message is used in multiple files 😱)

For example,

...
{
expectsAnArray: '... expects an array',
genericWarning: 'Warning: ... generic warning',
unfathomableError: '... look into this immediately!',
...
},

... and in some file

const msgs = require('path/to/messages.json');

fn(...args) {
if(allGood) { ... }
throw new Error(msgs.unfathomableError);
}

Please mention other relevant information such as the browser version, Node.js version, webpack version and Operating System.

N/A
Issue 1:
This is what I had to do to get Raven's Sentry client working with Celery:

Disable the logger to avoid duplicates in Sentry (one would be logged in celery.worker.job with no frames locals, the other one with the root logger with locals).

celery.worker.job:
level: INFO
handlers: [yourhandler]
propagate: no

I also had CELERYD_HIJACK_ROOT_LOGGER to False in my Celery configuration, and had to disable celery logging completely:

@signals.setup_logging.connect
def setup_logging(**kwargs):
"""Setup logging."""
pass

I set up Sentry exactly like in the docs:

from raven import Client
from raven.contrib.celery import register_signal, register_logger_signal

client = Client()

# register a custom filter to filter out duplicate logs
register_logger_signal(client)

# hook into the Celery error handler
register_signal(client)

I use:

celery==3.1.17
kombu==3.0.24
raven==5.1.1

I understand there was already some discussion about this in #1867, not sure if it has evolved.

Issue 2:
Checklist

I have checked the issues list

for similar or identical bug reports.

I have checked the pull requests list

for existing proposed fixes.

I have checked the commit log

to find out if the bug was already fixed in the master branch.

I have included all related issues and possible duplicate issues in this issue

(If there are none, check this box anyway).

Related Issues and Possible Duplicates

Related Issues

None

Possible Duplicates

None

Description

My Django application has lots of periodic tasks defined in different applications.

In the previous version of Celery (v4.x), I used to define the periodic task like

from celery.task import periodic_task

@periodic_task(name='authentication.periodic_task.clear_refresh_token', run_every=timedelta(days=1))
def clear_refresh_token():
pass

After the removal of the periodic_task decorator from v5.x, it is unclear how to define the auto-discoverable periodic tasks.

From the period task documentation https://docs.celeryproject.org/en/4.4.0/userguide/periodic-tasks.html#entries, It requires the app module to define the signal under which the periodic tasks has to be registered.

This is fine when the periodic tasks are defined in the root module (main application module), but what for the other module?

Also previously, it was easy to define the periodic tasks by using the decorator, and thus have the flexibility to define periodic tasks to any method, as per the new update, do I need to create separated shared_task first and then register them as a periodic task under the signal receiver?

Suggestions
Issue 1:
My use case is to better integrate my Electron app into the desktop environment. This includes being able to copy a file to clipboard and paste it to the native OS explorer/finder as well as to drag and drop between the app and the desktop.

As of today the closest I can get is by leveraging Chrome's own support for dragging out files to the desktop (http://www.thecssninja.com/javascript/gmail-dragout). However this support seems limited to the OS explorer/finder and does not work to drag something into another application (eg. Sublime).

Opening this issue to gather some ideas how to support this kind of feature and maybe other developers have found solutions already?

Issue 2:
i want to get image file from clipboard.

when right-click an image on a web page and copy it, i can get the image file from both browser's onpaste event and clipboard module that electron provided.

when it came to files(images) in finder, cmd+c copy it, browser's onpaste event can only give you a preview icon of this file.

like this:

i hope electron can give me more power to access clipboard data. but after i look through the api doc of clipboard and native-image, tryed in devtool of electron, the result still the same, i can only get the preview icon of the image.

how can i access to image data copyed from finder, not from web page?

here is some code, paste those code to devtool of electron, copy an image file in finder, back to devtool, press enter.

var clipboard = require('clipboard');
var img = clipboard.readImage('png');
document.body.innerHTML += '<img src="' +img.toDataUrl()+ '">';
Issue 1:
ISSUE TYPE

Bug Report

COMPONENT NAME

ansible core (ssh login)

ANSIBLE VERSION

ansible 2.3.0.0
config file = ... /ansible/etc/ansible.cfg
configured module search path = Default w/o overrides
python version = 2.6.6 (r266:84292, Aug 18 2016, 08:36:59) [GCC 4.4.7 20120313 (Red Hat 4.4.7-17)]

CONFIGURATION

new install from tar ball

OS / ENVIRONMENT

SUMMARY

When a host file contains the same host under multiple groupings the final ansible_user setting overrides and the ansible_user=xxx is ignored from the actual host entry being used.

STEPS TO REPRODUCE

Create an inventory file

[bobs-machines]
machineA ansible_user=bob
machineB ansible_user=bob

[sallys-machines]
machineA ansible_user=sally
machineC ansible_user=sally

validate the user that ansible is using

ansible -vvv bobs-machine -m ping

EXPECTED RESULTS

I would expect that both machineA and machineB are used with ssh user bob.

ACTUAL RESULTS

ESTABLISH SSH CONNECTION FOR USER: sally
ESTABLISH SSH CONNECTION FOR USER: bob
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=sally -o ConnectTimeout=10 ...
SSH: EXEC ssh -C -o ControlMaster=auto -o ControlPersist=60s -o KbdInteractiveAuthentication=no -o PreferredAuthentications=gssapi-with-mic,gssapi-keyex,hostbased,publickey -o PasswordAuthentication=no -o User=bob -o ConnectTimeout=10 ...

`

If the command was run with ALL to run against all hosts, I'm not sure what I would expect the correct bahavior to be. There are two possbility of either running against each host once using one or the other ansible_user settings or treating differnt users as different hosts and running against each of them. The current behavior is to run against each host exaclty 1 time regardelss of ansbile_user settings and use the last ansbile_user specificed.

In this example since the example command above is not running agianst Sally's host, the values for Sally's host should have no impact to Bob's hosts.

Issue 2:
Issue Type:

Feature Idea

Ansible Version:

1.8

Environment:

Any

Summary:

I think it would be really nice to have some role_name available as variable in the tasks in same way as done for role_path 7051cde recently

For now we have few options to let tasks know about current role name

set variable on role definition (playbook level)

example

roles:
- { role: webserver, role_name: "webserver" }

extract role folder name from role_path with regex_replace filter (task level)

example

- hipchat: msg='{{ role_path | regex_replace('^.*/(.*)$', '\\1') }} | tasks finished'
token="{{ hipchat_token }}"
room="{{ hipchat_room }}"
color="{{ hipchat_color }}"

Please let me know if we already have way to get role name in tasks

Thanks in advance
Issue 1:
The Assert\Valid is not taken into account and the form is just considered valid, even if the constraints are not met. The issue can be reproduced by taking the example over here :

http://symfony.com/doc/current/book/forms.html#embedding-a-single-object

Add any constraint to Entity\Category with: groups={"validationgroup"}

Change @Assert\Type(...) in Entity\Task to @Assert\Valid

Add 'validation_groups' => array('validationgroup') to Form\Type\CategoryType in $resolver->setDefaults

Remove 'cascade_validation' => true, from Form/Type/TaskType. As we use Assert\Valid, this should not be necessary, or am I wrong?

Create a controller:

class TestController extends Controller
{
public function indexAction()
{
$form = $this->createForm(new TaskType(), new Task());
$form->add('save', 'submit');

$form->handleRequest($this->getRequest());

if($form->isValid()){
echo '<p>the form is valid...</p>';
}

return $this->render('AcmeDemoBundle:Test:taskform.html.twig', array(
'form' => $form->createView()
));
}
}

and twig template :

<h3>Add task</h3>
{{ form(form) }}

I can provide you this bundle, zipped, if you want. I have also found that (by placing a debug closure in validation_groups) the validation_groups is read by the validator but it doesn't seem to be used.

Tested with version 2.3.7

Issue 2:
I have an entity where I'm using the following validators:

/**
* @Assert\Callback(methods={"isValid"}, groups={"group1", "group2"})
*/
class UserProduct
{
/**
* @var string $title
* @Assert\NotBlank(message="title.blank", groups={"group1", "group2"});
*/
private $title;

/**
* @var Project\AuthenticationBundle\Entity\User
* @Assert\Valid(groups={"group2"});
*/
private $user;

Calling $this->get('validator')->validate($userProduct, array('group1')) asserts the class constraint (@Assert\Callback) and the $title property but also the $user one too, even though it's not included in the validation group. The same happens if no groups are passed to the Valid constraint.

Removing the @Assert\Valid() constraint and running the same validation again for group1 does not assert the $user property, as expected.

The MemberMetadata class appears to always force the cascading of the Valid constraint, although I'm unsure if this is exactly related to the issue I'm experiencing.

// Symfony\Component\Validator\Mapping\MemberMetadata.php
if ($constraint instanceof Valid) {
$this->cascaded = true;
$this->collectionCascaded = $constraint->traverse;
} else {
parent::addConstraint($constraint);
}

Running on Symfony2 master.
Issue 1:
I'm working on an extension and have a CompletionItemProvider. It works good when writing code. But it's annoying when it pops up suggestions inside of strings and comments.

I don't want the suggestions to appear in that cases.

I had a look at other extensions on how they solve this problem. The TypeScript plugin has got these lines:

function TypeScriptCompletionItemProvider(client) {
this.triggerCharacters = ['.'];
this.excludeTokens = ['string', 'comment', 'numeric'];
this.sortBy = [{ type: 'reference', partSeparator: '/' }];
this.client = client;
this.config = configuration_1.defaultConfiguration;
}

I tried to define the excludeTokens in the same way but it doesn't work. How can I prevent the CompletionItemProvider from being executed in strings and comments?

Issue 2:
I'm trying to fix microsoft/vscode-go#103, but as far as I can tell this isn't possible currently without tokenizing the whole file again in my extension and manually checking whether I'm in a comment to suprress providing results.

It would be nice if the CompletionItemProvider provided a setting to suppress it's results when in certain tokens/scopes.

The implementation of the TypeScript completion provider has an excludeTokens which seems to play this role but I can't get that to work in my own extension.
Issue 1:
We seem to be having an issue with the validator service when using collections and the validator to check for unique entities.

The validator will correctly find any issues before persisting the entity to the doctrine manager.

The validator seems to check the data in the current database but doesn't check the data that is going to be saved.

For instance if title is a unique entity and in my collection I am adding two new collections to the database both with the title abc it will not throw an error with the validator but will try to add them both causing an internal server error.

We are adding clientside checks but wasn't sure if this was a bug in the validator service.

Issue 2:
Q
A

Bug report?
no

Feature request?
yes

BC Break report?
no

RFC?
yes

Symfony version
3.x (maybe 2.x and 4.x also?)

I am debugging a custom CMS made with Symfony (3.x) using Blackfire, in order to improve the performance as much as possible (and learn!). I already removed all heavy constructor services (Doctrine, Twig/Templating) from event listeners/subscribers, but there is one which I can't (or maybe shouldn't) remove, since it's in core. I am talking about Symfony\Component\HttpKernel\EventListener\TranslatorListener, which has "translator" service as dependency, and that service has a heavy constructor. It takes ~10% of the time in my current best case scenario.

I was looking for some issue similar to this, to no create a duplicate, I found some others about improve it (i.e. limiting some loaders/dumpers), but I didn't find any issue about lazy-loading that service (or its heavy logic) to avoid its construction at all unless required.
Issue 1:
The same question as #18345, which was sadly closed by its author. Before I go to public forums with this, just a simple question:

I have a SliverAppBar with a flexibleSpace that holds information that will change in height. I simply want my AppBar to determine it's height at runtime rather than the static expandedHeight option. Do I really need to calculate the height of this widget before I pass it to the flexibleSpace? Or is there a built in method to allow the SliverAppBar to determine that on it's own?

Can it be done somehow by using Flutter's existing components?

Issue 2:
I have a SliverAppBar with a flexibleSpace that holds information that will change in height. I simply want my AppBar to determine it's height at runtime rather than the static expandedHeight option. Do I really need to calculate the height of this widget before I pass it to the flexibleSpace? Or is there a built in method to allow the SliverAppBar to determine that on it's own?