WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
The following combination of include_role and when condition in one of my roles results in the error message posted below.

myrole/tasks/main.yml:

---
- include_role: name=mydebug
when: project == "some-project"

Error:

fatal: [localhost]: FAILED! => {"failed": true, "msg": "The conditional check 'p' failed. The error was: error while evaluating conditional (p): 'p' is undefined\n\nThe error appears to have been in '/opt/ansible/roles/proj-conf/tasks/main.yml': line 2, column 3, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n---\n- include_role: name=mydebug\n ^ here\n"}

Without the condition, the role runs fine. Any clue what's causing this behavior?

For information:

ansible 2.2.0.0

The mydebug role is a simple wrapper around the predefined debug role.

mydebug/tasks/main.yml:

---
- debug:
msg: "test"

My playbook:

---
- hosts: '{{ target }}'
roles:
- { role: myrole, project: '{{ project }}'}

Issue 2:
ISSUE TYPE

Bug Report

COMPONENT NAME

include_role:

ANSIBLE VERSION

ansible 2.2.0.0
config file =
configured module search path = Default w/o overrides

CONFIGURATION

OS / ENVIRONMENT

N/A

SUMMARY

include_role: inside a block: does not work with when: crashes when starting to execute the included role.

If I remove the external when: clause, everything works fine.

(this is a re-submition of #19085 which was incorrectly closed)

STEPS TO REPRODUCE

calling script:

- block:
- include_role:
name: "ansible-lib--infra/v1/ez123--moodle-moosh"
static: no
private: yes
when: (zzz_moodle__skip__moosh is not defined) or (not (zzz_moodle__skip__moosh |bool))

on the included role, under tasks/main.yml

- name: "check if moosh is already installed (1)"
command: "./moosh --help"
args:
chdir: "{{ ez123_moosh__bin_dir }}"
register: _X_moosh_ver_0
changed_when: false
failed_when: false

EXPECTED RESULTS

There should be no error/crash.

ACTUAL RESULTS

TASK [ansible-lib--infra/v1/ez123--moodle-moosh : check if moosh is already installed (1)] ***
task path: /etc/ansible/roles.glx/ansible-lib--infra/v1/ez123--moodle-moosh/tasks/main.yml:4
fatal: [host000000]: FAILED! => {
"failed": true,
"msg": "The conditional check '{' failed. The error was: template error while templating string: unexpected '%'. String: {% if ( %} True {% else %} False {% endif %}\n\nThe error appears to have been in '/opt/src/ansible/dom/roles/dom-roles/func/tasks/main.yml': line 4, column 7, but may\nbe elsewhere in the file depending on the exact syntax problem.\n\nThe offending line appears to be:\n\n- block:\n - include_role:\n ^ here\n"
}```
Issue 1:
Hi, I was wondering if there is any planned support for "reflecting a vector" in Three.js's vector2.js or vector3.js files? An example would be knowing both an incoming vector and a normal to a plane or surface, then calculating the outgoing vector after the vector intersects that plane.

Here is an older GameDev page devoted to the mathematical implementation: http://www.gamedev.net/topic/360411-reflection-off-a-line/

Should be easy to add to your vector.js library (maybe 2 or 3 lines of code max).

Concrete example: Incoming ball strikes a non-axis-aligned wall, and we need to know the outgoing ball direction. Maybe the final code that the Three.js user could type would be something like: vector.Reflect(plane Normal).

Would be a simple but very helpful function, especially if you are not wanting to add a hefty physics collision response engine to your project, and are just looking for a simple but effective solution that looks correct.

Thanks!

Issue 2:
I'm testing the Blender glTF 2.0 Exporter, to export 3D models from Blender to be imported by Three.js r87 GLTFLoader used in Freeciv WebGL. Previously, I used the Three.js BinaryLoader to import the Three.js binary format files into Freeciv WebGL. However, when I try to upgrade to using glTF 2.0 (binary .glb) format instead, I currently have these issues:

The alpha transparency of materials is not shown in the glTG 2.0 version. This can be seen on the Settlers unit. Does the GLTFLoader support transparency?

The material looks much smooter in the old BinaryLoader version, than in the glTF 2.0 GLTFLoader version.

The glTF 2.0 file is 725 kb, while the Three.js binary format file is 612 kb. (This is not a bug, but it is interesting to note!)

The code I use to load the glTF 2.0 file is identical to the webgl_loader_gltf.html example.

Are these known limitiations of the glTF 2.0 GLTFLoader, or limitations of the Blender glTF 2.0 Exporter, or perhaps in my implementation ?

I have attached the Blender file and the exported .glb 2.0 file here also.

settlers.zip
Issue 1:
Like using [NSScreen mainScreen], main screen being the screen that contains the active window.

A very common use-case is to start an app on the main screen centered, instead of on primary screen.

Also, it would be awesome if you can add an option to start app on an external screen centered, instead of hard-coding x and y as I see in this example:

app.on('ready', () => {
let displays = electron.screen.getAllDisplays()
let externalDisplay = displays.find((display) => {
return display.bounds.x !== 0 || display.bounds.y !== 0
})

if (externalDisplay) {
win = new BrowserWindow({
x: externalDisplay.bounds.x + 50,
y: externalDisplay.bounds.y + 50
})
win.loadURL('https://github.com')
}
})

Issue 2:
In case of multiple monitors it would be great if it would be possible to target a dedicated monitor a BrowserWindow shall be displayed on.

The current API provides the same limited possibilities a browser does. Fullscreen works only on the primary monitor and placing windows on different monitors requires knowledge about the user's actual setup to do this by coordinates only.

Would it be possible to add an additional option for BrowserWindows that allows specifying the target monitor?
Issue 1:
TypeScript Version:

1.8.10

Code

This snippet will throw the error "neither type is assignable to each other, property is missing"

interface IMyInterface {
func(num: number): void;
property: boolean;
}

let myObj: IMyInterface;

let otherObj = {
func(): void {}
};

myObj = <IMyInterface>otherObj;

but when adding a parameter to our method the error will dissapear

interface IMyInterface {
func(num: number): void;
property: boolean;
}

let myObj: IMyInterface;

let otherObj = {
func(num): void {}
};

myObj = <IMyInterface>otherObj;

also fixing what the error complains about will remove the error, but I shouldn't need to add property when already asserting the type:

interface IMyInterface {
func(num: number): void;
property: boolean;
}

let myObj: IMyInterface;

let otherObj = {
func(): void {},
property: false
};

myObj = <IMyInterface>otherObj;

Expected behavior:

No error message

Actual behavior:

An error message is thrown

Issue 2:
I would like to know if there are any plans to refactor lib.d.ts (and subsequent definitions) to declare interfaces for static implementations, thus allowing custom static bindings for existing Objects.

i.e.

interface _Object {
is(value1: any, value2: any): boolean;
}

declare var Object: _Object;

instead of

declare var Object: {
is(value1: any, value2: any): boolean;
}

Full problem here: http://stackoverflow.com/questions/27144550/typescript-static-interface-binding
Issue 1:
Original ticket http://projects.scipy.org/numpy/ticket/1226 on 2009-09-18 by trac user jloper, assigned to unknown.

array(2**32,int32)

OverflowError

array(2*_30,int32)_4

0

oh it would just make me so happy if these two commands COULD have the same output. just a little flag somewhere. a little "i love overflow errors" flag. Just for me.

Issue 2:
Simple demo:

In [1]: np.uint8(0) - np.uint8(1)
RuntimeWarning: overflow encountered in ubyte_scalars
Out[1]: 255

In [2]: np.uint8(0)[...] - np.uint8(1)[...]
Out[2]: 255

Should we even warn at all for unsigned integers?
Issue 1:
Describe the bug

Hello everyone,

I am using SQLAlchemy 1.4 with Postgresql. I am trying to populate some tables with a large number of records, with some not conforming to expectations. I have been using the following syntax: db.execute(insert(Table).values(records).on_conflict_do_nothing()) to resolve issues with duplicates.

However, as expected some of the records have issues of another nature and I want to skip them and retrieve them. I decided to use SAVEPOINTs (begin_nested()) and rollback(). This led to an error I am not able to resolve mentioned in the title: "Can't reconnect until invalid savepoint transaction is rolled back".

In the code you will notice I am using a context manager for the save points, I would like to point out that I get the same error when using explicit rollbacks without a context manager.

Thank you for your time!

To Reproduce

engine = _sql.create_engine(DATABASE_URL)
SessionLocal = _orm.sessionmaker(autocommit=False, autoflush=False, bind=engine)
Base = _declarative.declarative_base()
def get_session():
session = SessionLocal()
try:
yield session
finally:
db.close()

def _bulk_insert(records: list, table, session):
failed_records = []
try:
with session.begin_nested() as transaction:
transaction.session.execute(insert(table).values(records).on_conflict_do_nothing())
print(‘Bulk insert successful without any errors’)
return failed_records
except Exception:
print(‘Failed to do general bulk insert, starting chunks...’)
for chunk in np.array_split(records, 10):
try:
with session.begin_nested() as transaction:
transaction.session.execute(insert(table).values(chunk.tolist()).on_conflict_do_nothing())
except Exception:
failed_items.extend(chunk)
if len(items) != len(failed_records) and len(failed_records)>0:
return _bulk_insert(failed_records, table, db)
return failed_items

Error

Can't reconnect until invalid savepoint transaction is rolled back. (Background on this error at: http://sqlalche.me/e/14/8s2b)

Versions

OS: MacOS 12.4

Python: 3.9.1

SQLAlchemy: 1.4

Database: PostgreSQL

DBAPI (eg: psycopg, cx_oracle, mysqlclient): psycopg

Additional context

No response

Issue 2:
Describe the use case

Allow the UPDATE-FROM syntax with sqlite instead of raising NotImplementedError.

Databases / Backends / Drivers targeted

SQLite version >= 3.33.0

This is available in the standard library sqlite3 in Python 3.8.7, 3.9.1, and 3.10, or in the pysqlite3 package.

Example Use

UPDATE inventory
SET quantity = quantity - daily.amt
FROM (SELECT sum(quantity) AS amt, itemId FROM sales GROUP BY 2) AS daily
WHERE inventory.itemId = daily.itemId;

Additional context

The SQLite UPDATE-FROM syntax is supposed to be compatible with PostgreSQL.

https://sqlite.org/lang_update.html

I found that copying update_from_clause from sqlalchemy.dialects.postgresql.base to sqlalchemy.dialects.sqlite.base makes this work.
Issue 1:
Working on a relatively small TS web app project (roughly 10 source files), and got the following error after creating a file and typing some code:

Unable to send result to client.
Unable to get completion info from TypeScript: Error: Debug Failure. False expression.
at getCompletionEntryCodeActionsAndSourceDisplay (deno:cli/tsc/00_typescript.js:133230:22)
at Object.getCompletionEntryDetails (deno:cli/tsc/00_typescript.js:133168:30)
at Object.getCompletionEntryDetails (deno:cli/tsc/00_typescript.js:165282:35)
at serverRequest (deno:cli/tsc/99_main_compiler.js:717:27)
at [deno:cli\lsp\tsc.rs:3300:27]:1:12
[Error - 10:53:17 PM] Request completionItem/resolve failed.
Message: Internal error
Code: -32603

============================================================
Deno has panicked. This is a bug in Deno. Please report this
at https://github.com/denoland/deno/issues/new.
If you can reliably reproduce this panic, include the
reproduction steps and re-run with the RUST_BACKTRACE=1 env
var set and include the backtrace in your report.

Platform: windows x86_64
Version: 1.23.4
Args: ["C:\\ProgramData\\chocolatey\\lib\\deno\\deno.exe", "lsp"]

thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: Error("invalid value: 3, expected one of: 0, 1, 2, 4, 8, 16, 32", line: 0, column: 0)', cli\lsp\tsc.rs:153:54
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
[Error - 10:53:27 PM] The Deno Language Server server crashed 5 times in the last 3 minutes. The server will not be restarted. See the output for more information.

My .vscode/settings.json file just has the bare "deno.enable" set to true.

My Deno extension version is v3.13.1

Let me know if there's any more info you'd like me to provide.

Issue 2:
HMR

A thing missing with Deno, is the possibility to implement hot module reloading. HMR is widely use in JS development but right now is not really possible to implement it properly with Deno. Would be great to have something like:

Deno.hotModuleReload('./your_module.ts')

or something to clear the module cache Deno.clearCacheImport('./your_module.ts')

I started to try to implement the second solution, because it sound easier to me, but since I never develop with Rust before this weekend, it is not easy :p https://github.com/apiel/deno/pull/1/files This still work in progress, I need to find a way to access the modules from ops op_clear_cache_import. (and of course need to unit test and clean up the code) By the way, I am scared that this proposal do not get accepted by the Deno team, anyhow I will still give a try.

Another option, would be to give us the possibility to provide our own module loader, but this would be much more complicated. Also I think your module loader is really great and much more efficient as it is written in Rust.

Mock

Something amazing would be to include a way to mock module in Deno. Since there is nothing like Jest in Deno, it's very hard to mock our code unless we use DI, but not everybody is using this pattern. Would be great to have:

Deno.mock('./your_module.ts', { here: () => the_mock })

Deno.mockRestore('./your_module.ts')
Issue 1:
Challenge Waypoint: Target Elements by Class Using jQuery has an issue.

User Agent is: Mozilla/5.0 (Windows NT 6.3; WOW64; rv:42.0) Gecko/20100101 Firefox/42.0.

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

My code:

<script>
$(document).ready(function() {
$("button").addClass("animated bounce");
$(".text-primary").addClass("animated shake");
});
</script>

<!-- Only change code above this line. -->

<div class="container-fluid">
<h3 class="text-primary text-center">jQuery Playground</h3>
<div class="row">
<div class="col-xs-6">
<h4>#left-well</h4>
<div class="well" id="left-well">
<button class="btn btn-default target" id="target1">#target1</button>
<button class="btn btn-default target" id="target2">#target2</button>
<button class="btn btn-default target" id="target3">#target3</button>
</div>
</div>
<div class="col-xs-6">
<h4>#right-well</h4>
<div class="well" id="right-well">
<button class="btn btn-default target" id="target4">#target4</button>
<button class="btn btn-default target" id="target5">#target5</button>
<button class="btn btn-default target" id="target6">#target6</button>
</div>
</div>
</div>
</div>

Issue 2:
Hi,

I have correct code in the first five jQuery waypoints. If I press control+enter, it still has multiple red Xs. However, if I press control+enter multiple times, it eventually detects the correct code and passes.
Issue 1:
Deno strives to be browser compatible where possible; that means we use quite a few Web APIs.

There is not much docs for supported Web APIs at the moment and before 1.0 is released that situation must change. Some of APIs and not fully aligned to spec, while others are not fully implemented (#3557). All that knowledge should be written down and presented to end users to avoid multiple questions/bug reports about purposeful incompatibilities and/or missing implementations.

Issue 2:
I'm not sure if this is intentional, but much of the deno doc output is missing when using the default output format (not json).

For example, only the names of interfaces are displayed and not their functions:

Deno version: 1.2.0, Windows 10
Issue 1:
Atom should not open an "untitled" editor at startup.

It should either start with no open editors, or else start with the last open editor (especially where the last open editor was a folder).

Otherwise, if it starts with an "untitled" editor, one needs to first press CMD+Shift+W and then CMD+O to get where one wants.

Issue 2:
When Atom is opened, an "untitled" buffer is created. This makes sense.

However, most of the time, after opening Atom, I then proceed to opening the files I want to edit. At this point, the "untitled" tab remains open even if I haven't changed anything in it.

This is slightly annoying, because it means I have to close a tab that I never wanted in the beginning.
Issue 1:
TypeScript Version:

nightly (1.9.0-dev.20160429)

Code

interface Factory<T> {
(): T;
mixin<U>(mixin: U): T & U;
}

function compose<T>(base: T): Factory<T> {
return;
}

const factory = compose({
foo() {
return this;
},
bar() {
this.foo(); // <-- properly contextual and literal union type
return () => {
return this; // <-- type `any`, but should be same as outside the lambda
};
}
});

const foobar = {
foo() {
return this;
},
bar() {
return () => {
return this; // <-- correct object literal type
};
}
};

Expected behavior:

That both references to this are typed the same.

Actual behavior:

I am pretty sure this is related to #8356.

Outside of the lambda function in the first object literal, this is an intersection type of the object literal and the contextual type (which happen to be the same). In the second example, this is properly the object literal type including within the scope of the lambda function.

Issue 2:
On the docket

#6784 - Destructuring a property of an optional property should be an error

#6723 - Allow separate outDir for declaration files

#6678 - Use const initializer to resolve tuple type indexing

#6649 - Do not suggest caller in strict mode

#6585 - Making typings in package.json an array

#6480 - Allow static index signatures in classes

#6395 - Provide a way of specifying type parameters in JSX tags

#5916 - Disallow return; statements when a return type annotation exists

#5352 - Disallow empty binding patterns

#6482 - Support a declarationPath option

#6544 - Allow narrowing to a constituent of an intersection type

#6344 - Allow elided type arguments at call sites

#6606 - Apply typeof to arbitrary expressions

Stretch goals

#6041 - Resolve the indexer mess

#6613 - Better typing for React.setState
Issue 1:
Challenge Waypoint: Override Styles in Subsequent CSS has an issue.

User Agent is: Mozilla/5.0 (Linux; Android 4.4.2; Lenovo B6000-H Build/KOT49H) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/46.0.2490.76 Safari/537.36.

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

My code:

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>
<h1 class="pink-text blue-text">Hello World!</h1>

Issue 2:
Challenge Waypoint: Override Class Declarations with Inline Styles has an issue.

User Agent is: Mozilla/5.0 (Windows NT 6.1; rv:42.0) Gecko/20100101 Firefox/42.0.

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

My code:

<style>
body {
background-color: black;
font-family: Monospace;
color: green;
}
#orange-text {
color: orange;
}
.pink-text {
color: pink;
}
.blue-text {
color: blue;
}
</style>
<h1 id="orange-text"
class="pink-text blue-text"
style="color: white">Hello World!</h1>
Issue 1:
When using ngHttp.HTTP_BINDINGS in angular's 2.0.0_alpha.35 sfx.dev build it's throwing the following error:

InvalidBindingError {message: "Invalid binding - only instances of Binding and Type are allowed, got: [object Object]", _originalException: undefined, _originalStack: undefined, _context: undefined, stack: "Error↵ at InvalidBindingError.BaseException (ht….org/2.0.0-alpha.35/angular2.sfx.dev.js:20107:38)"}

Error
at InvalidBindingError.BaseException (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:11539:25)
at new InvalidBindingError (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:12886:65)
at _resolveBindings (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:32901:15)
at _resolveBindings (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:32897:20)
at Function.System.register.execute.Injector.resolve (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:33554:36)
at Injector.System.register.execute.Injector.resolveAndCreateChild (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:33325:45)
at _createAppInjector (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:36509:26)
at https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:36475:27
at Zone.run (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:136:17)
at Zone.System.register.execute.NgZone._createInnerZone.zone.fork.fork.$run [as run] (https://code.angularjs.org/2.0.0-alpha.35/angular2.sfx.dev.js:20107:38)

Here you have a plunkr to reproduce the issue:

http://plnkr.co/edit/XIW0EgIZvs3dtNcYN1dJ?p=preview

If you change ngHttp.HTTP_BINDINGS for the following code, then everything works:

[
ng.bind(ngHttp.ConnectionBackend).toClass(ngHttp.XHRBackend),
ngHttp.BrowserXhr,
ng.bind(ngHttp.RequestOptions).toClass(ngHttp.BaseRequestOptions),
ng.bind(ngHttp.ResponseOptions).toClass(ngHttp.BaseResponseOptions),
ngHttp.Http
]

Looks like ngHttp module is using a somehow incompatible binding mechanism to generate HTTP_BINDINGS.

If I'm making something wrong any advice is welcome. Also if you think I can give you a hand to resolve this give me some tips and I'll PR with a solution.

Thank you!

Issue 2:
Issue 1:
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 2:
Taras Tielkes opened SPR-3581 and commented

Section "6.3.2. Declaring a pointcut" states:

A pointcut can be declared inside an aspect, in which case it is visible only within that aspect. A pointcut can also be declared directly inside an aop:config element, enabling the pointcut definition to be shared across several aspects and advisors.

In practice such "visibility" rules don't exist. The aop:config parser will happily register any found pointcut, and doesn't contain any visibility logic.

Using <pointcut> elements with the same "id", but contained by different aop:aspect elements does not "make it visible only within that aspect". Instead, it makes the XML parser throw an exception at runtime (because of duplicate xsd:ID values).

I don't think special visibility logic is needed: no same person will use the schema-based AOP style do declare 100s of pointcuts. Instead I suggest to simply correct the documentation.

Affects: 2.0.5, 2.1 M1, 2.1 M2