WhereIsAI/github-issue-similarity huggingface dataset:
Issue 1:
julia> parse(Complex128, "1.0+1.0im")
ERROR: MethodError: no method matching parse(::Type{Complex{Float64}}, ::String)

However, I can do:

julia> eval(parse("1.0+1.0im"))
1.0 + 1.0im
julia> typeof(ans)
Complex{Float64}

But, a bit awkward and will not give me immediate control of the resulting type.

Another - not related - strange thing which I've noticed with Complex is:

julia> one(im)
Complex(true,false)
julia> one(0+1im)
1 + 0im

julia> versioninfo()
Julia Version 0.6.1
Commit 0d7248e (2017-10-24 22:15 UTC)
Platform Info:
OS: Linux (x86_64-linux-gnu)
CPU: Intel(R) Xeon(R) CPU E5-2680 v4@ 2.40GHz
WORD_SIZE: 64
BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
LAPACK: libopenblas64_
LIBM: libopenlibm
LLVM: libLLVM-3.9.1 (ORCJIT, broadwell)

Issue 2:
As @ChrisRackauckas points out on discourse, this shouldn't really be done in a package because Base.parse and all of the argument types are "owned" by Base.

Would also be nice not to have to use horribly inefficient techniques involving eval; see also #21935.

Should be straightforward to implement. The main question in my mind is how permissive it should be:

Should it allow arbitrary whitespace between the real and imaginary parts? e.g. "3+4im" and 3 + 4im both allowed?

Should it require im, or accept the common variants im, i, j, and I?

Should it require 3+4im, or also allow 3+4*im?

Should it support the Fortran style (real,imag)? (Probably not, since we don't support Fortran-style real literals 1.0D+00 either.)
Issue 1:
I think the following should result in an error, but it passes the type checker:

function foo<T>(getT: () => T, setT: (t: T) => void) { }

function getString() {
return 'a';
}

function setNum(n: number) { }

foo(getString, setNum);

Hovering over the call to foo in VS or the Playground shows that T has been inferred to be of type {}, but since {} isn't of type number, doesn't that make setNum an invalid argument to be passing in?

Issue 2:
Motivating example (one of many):

function compare<T>(lhs: T, rhs: T): boolean {
return lhs === rhs;
}

if(compare('1', 1)) { // Expected: Error -- I made 'compare' generic for a reason!
/* ... */
}

Proposal

When generic type inference performs its Best Common Type operation (4.12.2), it should be an error if this returns {} when {} was not one of the input types.

This is entirely consistent with other behavior already in the compiler:

var foo = bar ? '1' : 1; // Error, no BCT between '1' and 1
function fn() { // Error, no BCT between '1' and 1
if(foo) {
return '1';
} else {
return 1;
}
}

Open Questions

From @KamyarNazeri -- should this apply when there are zero input types? e.g.:

class List<T> {
items: T[];
}

var x = new List(); // Probably want an error here

That seems desirable, but has some collateral damage:

function foo<T>(x: number, a?: T, b?: T) { }
foo(0); // Error, zero input types provided for inference

This would come up slightly more often than naively expected because many .d.ts authors (mistakenly) create generic types which don't actually consume their type parameters. Perhaps this warning would effectively discourage them from doing so?
Issue 1:
Please:

Check for duplicate issues.

Provide a complete example of how to reproduce the bug, wrapped in triple backticks like this:

I wanted to define a custom_vjp for a function that takes a string to indicate what operations are to be conducted. Since str is not a validate type for JAX whereas any objects that can be flatten and unflatten as a pytree is, I thought of this hacky way to define my own string object:

import jax
import jax.numpy as jnp
from functools import partial

OP_TO_IDX, IDX_TO_OP = {"add": 0, "mul": 1}, {0: "add", 1: "mul"}

@jax.tree_util.register_pytree_node_class
class OpStr(object):
def __init__(self, op):
assert op in OP_TO_IDX, "can only be one of the ops"
self.op = op

def __eq__(self, other):
return self.op == other

def __hash__(self):
return hash(self.op)

def tree_flatten(self):
return ([OP_TO_IDX[self.op]]), None

@classmethod
def tree_unflatten(cls, aux_data, children):
idx = int(children[0])
return cls(op=IDX_TO_OP[idx])

@partial(jax.custom_vjp, nondiff_argnums=(2,))
def op(x, y, op):
if op == "add": z = x + y
if op == "mul": z = x * y
return z

def op_fwd(x, y, op):
cache = (x, y, op)
if op == "add": z = x + y
if op == "mul": z = x * y
return z, cache

def op_bwd(cache, dz):
x, y, op = cache
if op == "add": dz_dx = dz_dy = 1.0
if op == "mul": dz_dx, dz_dy = y, x
return dz_dx, dz_dy

op.defvjp(op_fwd, op_bwd)
grad_op = jax.grad(op)
grad_op(1.0, 1.0, OpStr("add"))

If applicable, include full error messages/tracebacks.

But this gives me

Traceback (most recent call last):
File "/Users/wangy1/Documents/GitHub/dgl/tests/jax/test_op_str.py", line 47, in <module>
grad_op(1.0, 1.0, OpStr("add"))
File "/Users/wangy1/Documents/GitHub/dgl/tests/jax/test_op_str.py", line 24, in tree_unflatten
idx = int(children[0])
TypeError: int() argument must be a string, a bytes-like object or a real number, not 'NoneType'

Which is not expected since the flattened tree shouldn't be None.

Issue 2:
Please:

Check for duplicate issues.

Provide a complete example of how to reproduce the bug, wrapped in triple backticks like this:

jnp.take(
jnp.arange(5),
jnp.arange(5 * 3),
axis=0
)
# DeviceArray([0, 1, 2, 3, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4, 4], dtype=int32)

jnp.take(
jnp.arange(5),
jnp.arange(5 * 3),
axis=0,
mode="raise",
)
# NotImplementedError

According to the documentation, the default out-of-bound behavior is "raise". However, this is not the case in practice
Issue 1:
With Atom 0.120.0, on OSX (with case insensitive filesystem).

What I did:

First i left-click the file "test.php" in the Atom editor tree view to open it.

Next I right-click the same file and select "Rename".

What happens:

When i rename "test.php" to "Test.php", the opened file tab label does not update, and still says "test.php".

If I now click this file (to open it, it was already open in a tab) - i end up with two tabs, one "test.php", one "Test.php". Due to the case insensitivity of the file system I use, they happen to point to the same file.

What I expected to happen:

The opened file tab label to change to "Test.php" when i renamed the file.

Issue 2:
Moving a file in the tree view causes an autosave.

Refs atom/tree-view#123
Issue 1:
Hello,

I'm dealing with an issue specific to TypeScript on a Backbone project, but this seems more generic to any project using underscore/lodash and the return of the _.result method:

// With _.result you can work with an object property or function...
return _.isFunction(value) ? value.call(object) : value;

Is it possible to have a TypeScript interface definition that includes an instance property that can optionally be overridden with an instance method? Example from Backbone's .d.ts file to include both:

url: any
url(): any

Currently this produces an error for a duplicate identifier.

Thanks!

-Eric

Issue 2:
Wondering if something like the "_ViewStart" for MVC could be added to TS...

If a directory has 5 files and each of them share a common set of ES6 import...from statements then creating a file (preferably not called _ViewStart) could be created at the parent directory and this will ensure each class has all of those scopes included for intellisense and they can be injected during compilation.

nice to have would be to be able to nest these so that following a directory structure will result in all of the usings at the deepest level flattened out from parent "viewStart" using listings.
Issue 1:
In integration wiki it is explicitly stated that glide is using volley 1.0.8 and my project is already using volley 1.0.19. Is there a workaround for it?

Issue 2:
Glide Version: 3.7.0

Integration libraries: no

Device/Android Version:

Android Virtual Device and Samsung S7 edge 6.0

Issue details / Repro steps / Use case background:

I have a view where the app shows the user image to preview, then there is a button in the preview screen. User can click the button to save that image in the device. Images are loaded from URLs.

I know there are already many topics regarding this being discussed but I still cannot get it. #459 #509 #828 ..etc

Based on some solutions from those topics, I came up with these code but I am not sure if I am doing it correctly. The main point is to load the original size of the image to preview therefore no longer requires user to download again.

This is the code to show the preview image.

Glide.with(MyFragment.this).load(mImgUrl).diskCacheStrategy(DiskCacheStrategy.ALL).into(mPrviewImageView);

This is the code to save the image.

new AsyncTask<Void, Void, Exception>() {
@Override
protected Exception doInBackground(Void... params) {
try {
File file = Glide.with(MyFragment.this)
.using(new NetworkDisablingLoader<String>())
.load(mImgUrl)
.downloadOnly(Target.SIZE_ORIGINAL, Target.SIZE_ORIGINAL)
.get();
FileUtils.copyFile(file, new File(AppConfig.APP_DIR_IMG_BG + "/" + SystemClock.currentThreadTimeMillis()));
} catch (InterruptedException | ExecutionException | IOException e) {
Log.e(TAG, "save image file error. url: " + mImgUrl, e);
return e;
}
return null;
}

@Override
protected void onPostExecute(Exception e) {
if (e == null)
Toast.makeText(getActivity(), "Saved", Toast.LENGTH_SHORT).show();
else
Toast.makeText(getActivity(), "Error occurred", Toast.LENGTH_SHORT).show();
}
}.execute();

My question is: Does Glide actually returns the cache file with downloadOnly method? I was trying to fine some callback methods to validate if the image is from cache but I was not able to.
Issue 1:
I'm currently trying to improve the overall scheduling throughput. It seems we can achieve significant gains from different kind of parallelization.

However, I would like to avoid parallizing individual predicate/priority function and support parallelization at the framework level.

For predicate function, it is easy to parallelize computations of them between nodes, since they are independent.

However, it's not the case for priorities - the interface of priority function is that it computes priorities for all nodes at the same time.

It would be much easier to parallelize everything, when priority function would also take a node as an argument and would compute priority wrt to current priority function just for this particular node.

However, there are two problematic functions for now (maybe more in the future):

SelectorSpreading

NodeAffinity

Both of them have the same main problem - they are computing some partial scores for nodes independently, but then to compute the final score for the node, they rely on the maximum of those partial scores from all nodes.

Proposal

I'm proposing to change the interface of priority functions to take a node for which they are supposed to compute priority.

We also extend the HostPriority type to include "priorityFunctionName" string

We will split priority functions into two phases:

per-node computations (which are generally cpu-intensive and would benefit from parallelization)

aggregation (which is generally much cheaper) and we can afford not parallelizing it

Thoughts?

@davidopp @kubernetes/sig-scheduling @kubernetes/sig-scalability

Issue 2:
e2e failure: SchedulerPredicates [Serial] validates resource limits of pods that are allowed to run [Conformance]

/go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/test/e2e/scheduler_predicates.go:355 Expected : 21 to equal : 22

http://kubekins.dls.corp.google.com/view/Critical%20Builds/job/kubernetes-e2e-gce/10440/

@saad-ali @hongchaodeng Recent issues/PRs mentioning the same test

#19487

#19495
Issue 1:
What is the easiest way to, for example, use the node.js "debug" module in a browser-only application that's currently organized with Internal Modules?

I've been using Typescript for over 6 months now, and I still have this question that I've had since day 1:

Do you guys recommend using a preprocessor like browserify or webpack as part of the build process for applications meant to run in the browser? That would surprise me, since the Handbook section on External Modules makes it sound like the TS compiler can do at least the basics of what they do (and the basics are all I need).

However, the Handbook says "Applications not using node.js or require.js do not need to use external modules and can best be organized using the internal module concept outlined above."

Perhaps I've misinterpreted what is meant by "using node.js". My code doesn't use the node interpreter. So far that Handbook blurb has made me steer clear of using other people's nodejs modules, or even in one case converting someone's library, that seemed to unnecessarily be packaged as a nodejs module, to plain js (note: I am obviously still fairly new to web development, but I do have a PhD in CS). Other than not being able to use nodejs modules, I've been completely satisfied with Internal Modules.

I would be very grateful to get a response on this.

Issue 2:
From @matthiasg on July 17, 2015 12:16

Since any valid JS file is supposed to be a valid TS file too it should be possible to use a standard babelified webapp project and just switch it to use TS (e.g using tsify). Sadly that is not possible right now since there are some issues on requiring/importing dependencies and actually getting TS to emit anything (in a DI reliant project at least).

I think it would be helpful if the TS team would devote some time to setup official documentation similar or even extended to what the opensource babeljs team has done (https://babeljs.io/docs/setup/) with enough starters how to migrate their existing projects to TS. An official browserify plugin might also be helpful.

Specifically just exchanging babelify to tsify doesnt work right now even though both implement the ES6 features used (of course if one doesnt implement a specific feature proposed that wouldnt work).

Copied from original issue: microsoft/TypeScript#3909
Issue 1:
TypeScript Version:

1.8.2

Background:

I have been working on trying to get https://github.com/eslint/typescript-eslint-parser, a TypeScript parser plugin for ESLint, off the ground, and the current job is adding JSX support.

ESLint uses espree and so the aim of the project is to convert the output of the tsc to an AST which espree expects. We already have a solid suite of JSX tests to develop against (taken from the espree project itself).

We do make use of some helper TypeScript helper methods when converting the AST, such as ts.findNextToken() and I believe I may have found an issue with the way it handles JsxText

Given this JSX code:

<div>@test content</div>;

...the TSC produces the AST we expect - with @test content represented as a single JsxText node:

However, when iterating through the AST using ts.findNextToken(), rather than a single JsxText node, we get a node for @, test and content separately.

Upon quick inspection of the source I noticed that the related function, ts.findPrecedingToken(), was doing an early check for a JsxText node type, whereas ts.findNextToken() wasn't.

(See https://github.com/Microsoft/TypeScript/blob/master/src/services/utilities.ts#L338 vs https://github.com/Microsoft/TypeScript/blob/master/src/services/utilities.ts#L364)

Sure enough when I monkey patched the relevant bit of typescript.js to exit early if n.kind was JsxText, a single JsxText token was recognised for @test content, and my test passed.

If you agree that this is a bug, then I would be very happy submit a PR, otherwise any tips on how I might have arrived at this false positive would be very much appreciated!

Issue 2:
TypeScript Version:

1.9.0-dev.20160502

Code

declare namespace Windows.Foundation {
interface IPromise<TResult> {
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>;
then<U>(success?: (value: TResult) => IPromise<U>, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>;
then<U>(success?: (value: TResult) => U, error?: (error: any) => IPromise<U>, progress?: (progress: any) => void): IPromise<U>;
then<U>(success?: (value: TResult) => U, error?: (error: any) => U, progress?: (progress: any) => void): IPromise<U>;
done<U>(success?: (value: TResult) => any, error?: (error: any) => any, progress?: (progress: any) => void): void;

cancel(): void;
}
}

async function sample(promise: Windows.Foundation.IPromise<number>) {
var number = await promise;
}

Expected behavior:

No error, as this is an await-compatible Promise definition; more concretely, those are definitions for UWP APIs and they worked well with a stable TypeScript.

Actual behavior:

Compiler emits an error Operand for 'await' does not have a valid callable 'then' member..
Issue 1:
Hi, I am trying to use addprocs to connect to remote workers on Windows. SSH connection is successful, but Julia cannot excecute commands.

I think it is not the problem of Julia on remote machines, because I got the same error even remote Julia is uninstalled. SSH is good, because it can work on cmd.exe.

Here are the errors:

root@192.168.1.106's password: [Here I input password]
From failed worker startup: Unable to execute command or shell on remote system: Failed to Execute process.
ERROR: Unable to read host:port string from worker. Launch command exited with error?
error(::String) at .\error.jl:33
read_worker_host_port(::Pipe) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\cluster.jl:273
connect(::Distributed.SSHManager, ::Int64, ::WorkerConfig) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\managers.jl:397
create_worker(::Distributed.SSHManager, ::WorkerConfig) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\cluster.jl:505
setup_launched_worker(::Distributed.SSHManager, ::WorkerConfig, ::Array{Int64,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\cluster.jl:451
(::getfield(Distributed, Symbol("##47#50")){Distributed.SSHManager,WorkerConfig})() at .\task.jl:259
Stacktrace:
[1] sync_end(::Array{Any,1}) at .\task.jl:226
[2] #addprocs_locked#44(::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:tunnel, :sshflags, :max_parallel),Tuple{Bool,Cmd,Int64}}}, ::Function, ::Distributed.SSHManager) at .\task.jl:266
[3] #addprocs_locked at .\none:0 [inlined]
[4] #addprocs#43(::Base.Iterators.Pairs{Symbol,Any,Tuple{Symbol,Symbol,Symbol},NamedTuple{(:tunnel, :sshflags, :max_parallel),Tuple{Bool,Cmd,Int64}}}, ::Function, ::Distributed.SSHManager) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\cluster.jl:369
[5] #addprocs at .\none:0 [inlined]
[6] #addprocs#251(::Bool, ::Cmd, ::Int64, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::Function, ::Array{String,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\managers.jl:118
[7] addprocs(::Array{String,1}) at C:\cygwin\home\Administrator\buildbot\worker\package_win64\build\usr\share\julia\stdlib\v1.0\Distributed\src\managers.jl:117
[8] top-level scope at none:0

Issue 2:
Windows 10 now has facilities for native ssh handling, but that uses the native shell and not sh which we currently assume to be available on the remote host.

See https://discourse.julialang.org/t/cant-add-windows-workers-due-to-a-missing-sh-shell/15055?u=vchuravy for where this came up.
Issue 1:
If I close Atom with some files and folders open, and then reopen Atom, nothing is remembered. The only thing that is open is a new blank file.

I feel like this worked at some point in the past for me, but I wasn't able to find a version that worked when I tried the specific zip files. I am currently using 0.209.0. I also tried this with --safe and the same thing happens.

I can see that the editor-giberish files are being created in the storage folder, but I never see Atom try to read those files when I launch Atom. I used Procmon to check for this access.

Issue 2:
Atom 0.209.0 doesn't save open files and folders on exit (0.208.0 made this). After restart, there is only empty "untitled" file.

Here's my config:

"*":
"exception-reporting":
userId: "480b20de-e736-263e-a240-4205e8c90e87"
welcome:
showOnStartup: false
core:
themes: [
"one-dark-ui"
"solarized-dark-syntax"
]
editor:
fontFamily: "'M+ 1mn regular'"
invisibles: {}
minimap:
plugins:
"git-diff": true
bookmarks: true
selection: true
"color-highlight": true
"find-and-replace": true
"atom-beautify":
_analyticsUserId: "13adc827-7ceb-4c02-bdb7-7a6d1b173567"
c_configPath: "/usr/share/uncrustify/defaults.cfg"
cpp_configPath: "/usr/share/uncrustify/defaults.cfg"
cs_configPath: "/usr/share/uncrustify/defaults.cfg"
objectivec_configPath: "/usr/share/uncrustify/defaults.cfg"
java_configPath: "/usr/share/uncrustify/defaults.cfg"
tabs:
usePreviewTabs: true
linter: {}
"git-plus":
wordDiff: false
"merge-conflicts": {}
"linter-clang":
clangDefaultCFlags: "-Wall -Wextra -std=c99"
clangDefaultCppFlags: "-Wall -Wextra -std=c++11"
"atom-color-highlight": {}
"autocomplete-clang": {}
"open-recent": {}

0.209.0 built from sources.
Issue 1:
Problem: Role Based Access Control is not enabling users to view Dashboards correctly.

Feature flag enabled: RBAC

Browser: Firefox

Superset Version 1.4

Background: I have assigned a user a role AlphaDG (essentially Gamma) and have assigned this role to a dashboard.

Expected outcome: Even though the user has not been assigned access to the underlying dataset(s), this user should be able to see the dashboard.

Actual outcome: The user is not able to see the dashboard (whether published or not)

Issue 2:
Exporting a dashboard and importing it into another instance/landscape of Superset (where the dashboard was previously imported and created) prompts to overwrite and on confirmation imports. The dashboard changes (title etc) are imported but the certification data entered for a dashboard is not imported. Also any chart changes are not imported.

How to reproduce the bug

Create a dashboard and add a chart. Export and Import it to another instance where the dashboard does not exist. Import is successful but the Dashboard Certification and Certified By details are not imported.

Now make some change in the Dashboard like changing title and also changes in the include chart in the original instance like changing title or making changes to the chart itself. Export the dashboard and import it to the second system. The dashboard changes are imported but the Chart changes are NOT imported.

For testing I exported only the chart and imported the chart and it works. Looks like the overwrite of dashboard works but overwrite of chart is missing.

Expected results

Chart changes are also imported

Actual results

Chart changes are NOT imported

Screenshots

If applicable, add screenshots to help explain your problem.

Environment

(please complete the following information):

browser type and version: Chrome latest

superset version: 1.5.0

python version: 3.8.12

node.js version: N/A

any feature flags active: DASHBOARD_RBAC, VERSIONED_EXPORT, ENABLE_TEMPLATE_PROCESSING and DASHBOARD_CROSS_FILTERS

Checklist

Make sure to follow these steps before submitting your issue - thank you!

I have checked the superset logs for python stacktraces and included it here as text if there are any.

I have reproduced the issue with at least the latest released version of superset.

I have checked the issue tracker for the same issue and I haven't found one similar.

Additional context

Add any other context about the problem here.