I’m trying to make some highly async code interrupt-friendly with try-catches, and most of the time it works, but every so often I hit this. Is there any way to figure out what it was doing in julia code at the time?
^Cfatal: error thrown and no exception handler available.
InterruptException()
jl_mutex_unlock at /Users/ian/Documents/GitHub/julia/src/./locks.h:139 [inlined]
jl_task_get_next at /Users/ian/Documents/GitHub/julia/src/partr.c:475
poptask at ./task.jl:744
wait at ./task.jl:752 [inlined]
task_done_hook at ./task.jl:478
_jl_invoke at /Users/ian/Documents/GitHub/julia/src/gf.c:0 [inlined]
jl_apply_generic at /Users/ian/Documents/GitHub/julia/src/gf.c:2373
jl_apply at /Users/ian/Documents/GitHub/julia/src/./julia.h:1690 [inlined]
jl_finish_task at /Users/ian/Documents/GitHub/julia/src/task.c:208
start_task at /Users/ian/Documents/GitHub/julia/src/task.c:832
(though it's a rather big `if` about whether that's actually something we want to support)
There's a lot of things where people design `AbstractArray` functions to support arbitrary offsets, but for the most part assume unit spacing. If we wanted better irregularly spaced array support, we'd likely need functions like `first(::AbstractArray, ::Int)`
I don't see how that'd be a concern. Shouldn't it just return the same type as `getindex` on a slice would?
What's the situation where the output type of `first(x,3)` differs from the input type?
View Thread
Perhaps a combination of `[1:3]` already exists, and some questions about what the output type should be, considering the myriad of array types.
With `Array`s, you can just do `arr[begin:begin+3]`, but it would be nice to have a `first` method like for strings.
No, not really. The reason it exists for `AbstractString` is that indexing them is a bad idea when unicode is involved:
julia> first("∀ϵ≠0: ϵ²>0", 3)
"∀ϵ≠"
julia> "∀ϵ≠0: ϵ²>0"[1:3]
ERROR: StringIndexError("∀ϵ≠0: ϵ²>0", 3)
Stacktrace:
[1] string_index_err(::String, ::Int64) at ./strings/string.jl:12
[2] getindex(::String, ::UnitRange{Int64}) at ./strings/string.jl:250
[3] top-level scope at REPL[3]:1
Is there some fundamental reason why this method doesn't/shouldn't exist?
> first([1,2,3], 3)
ERROR: MethodError: no method matching first(::Array{Int64,1}, ::Int64)
i have a small widget with sliders in pluto.jl, i've been trying to add a "reset" button to make them go back to default values. anyone can help with this?
Is there a known way to "reparametrize" a struct in a generic way? That is given an object of type `A{T}` I would like to be able to return a new object of type `A{S}` (taking care of the conversion from `T` to `S` manually). If I have a single type it's easy enough, I can define
reparametrize(a::A{T}) where T = A{S}( #convert internal params to S here# )
But if I want `A` not to be more generic i.e. `A <: SuperType` I can't get my head around how do it to get a function with the following signature
reparametrize(a::A) where {T, A <: SupertType{T})
View Thread
Is there any way to limit the stacktrace from ~20 levels of depth to just the top 5 levels or something like that? The stacktrace often takes up my entire screen
View Thread
Note that `Gray` will be expecting numbers scaled from 0 (black) to 1 (white)
View Thread
Or view right in your terminal with ImageInTerminal.jl
Which should show up as an image in Juno or VSCode, and which you could save to a file with e.g. `save("somefilename.png", img)`
Which will give you a “`100×100 Array{Gray{Float64},2} with eltype Gray{Float64}:`”
What are you starting with? If you’re starting say with a matrix of numbers you could do
using Images
a = rand(100,100)
img = Gray.(a)
sorry for the beginner questions.. how do i show a grayscale image?
This is a test
View Thread
Is there any reason why inv([x]) has a missing method (i.e. 1x1 arrays do not have an inverse)? Is it at all ambiguous to just write?
inv(x::Array{Int64,1}) = [1/x[1]]
View Thread
A beginner’s issue with metaprogramming: Say we want to define a macro that substitutes input expression into code and the resulting expression is afterwards evaluated in the caller’s scope. like this
macro foo(ex)
:(Array{Int64}(undef, $ex))
end
let
a = [1, 2]
@foo length(a)
end
I’d like to substitute the `ex` with `length(a)` and evaluate it within the local scope. However, it doesn’t work: The $ does the expansion and finds out that `a` is missing in the macro scope, while `ex` can’t be used either. Any hint?
View Thread
hey, trying out julia, given an RGB image? how to i get an array that only has the red channel?
View Thread
How should I deal with n x m matrices where I want to extract the size, but one of n or m is possibly 1, hence Julia returns a single value rather than a tuple?
size([2, 1]) = (2,)
I need to fill in an upper triangular matrix with zeros of sizes that depend on the size of its surrounding blocks.
View Thread
Is there a fast speech to text library in Julia?
View Thread
I am writing tests for a package where a method needs some user input(using readLine()). Is there any way I can get julia to automatically send the input when the readLine() method is supposed to take an input?
View Thread
What might be the fastest way to check if all tuple elements are 1? I
View Thread
Hello community, is it possible to retrieve the type and size of input & output arguments of a function? E.g. input: Float64 vector of length N and output Int array of size KxL? This would be usefull for troubleshooting I guess:
`typeof(J_AD)`
`var"#17#18"`
Or am I missing something? Thanks
View Thread
how can i send status code in genie
what is recommended, return an error or throw an error?
I have one super simple question, say we have a dataframe `df` with two columns `share` and `year`, how to create a new column `res_share` which is the residual share in each year? In R that would be: `df %>% group_by(year) %>% 1-sum(share)`. But somehow I can't figure out how to do this in Query (or in plain Julia without writing ugly loops)
View Thread
Hey folks. I’m trying to use Optim.jl for a small problem but keep running into precompile issues and the errors don’t seem to have any useful information (to my best knowledge). Any ideas what could be causing the issue (error posted in thread)?
View Thread
Thank you for bearing with me, good old XY problem I suppose – as well as not continuing in an ancient thread elsewhere. Background here: <https://julialang.slack.com/archives/CBF3Z1D7V/p1602646185191500> What I am trying to achieve is patching Pkg to include a few lines to apply necessary patches for binaries to run on NixOS – the lines themselves are ~5 and not scary. However, as Pkg is in base that would mean touching the system image. Ideally, I would like to make this work without rebuilding Julia from source (this is the “easy” way) so that one can rely on the official binaries to the largest extent possible on a wonky OS like NixOS.
is there a way to check if the io on where im printing results has support for unicode?
View Thread
Is there a way to dispatch on keys of NamedTuples? Like:
struct Foo end
struct Bar end
tnt = (Foo() => anything1, Bar() => anything2) # not allowed, but similar to NamedTuple
@test getproperty(tnt, Foo()) == anything1
@test getproperty(tnt, Bar()) == anything2
Or are there types like this defined somewhere?
View Thread
There's `std` from the `Statistics` standard library.
julia> using Statistics: std
julia> std(randn(1000))
0.9768968828910654
Eyo! what is UP. Just like "mean." can find the mean of multiple lists at once, is there then one function that can find the standard deviation or some kind of spread measure?
Hi all. I wanna know If there is a way to create a macro to represent an access _v[i]_ of an array _v_ as something like xi (math style).
View Thread
Is there any way to dispatch a function for a type alias? Or do I have to make a struct which minimally wraps the alias and reimplement the methods which I wanted to get from the alias? Consider the specific example of creating an alias for `Dict{Symbol, Int}` . This type has a bunch of nice methods, but one might also imagine that I'd like to distinguish between my inhabitants of it and inhabitants of my alias with, for example, `Base.show` .
View Thread
What's the equivalent of
In [3]: list(itertools.product([1,2,3],repeat=2))
Out[3]: [(1, 1), (1, 2), (1, 3), (2, 1), (2, 2), (2, 3), (3, 1), (3, 2), (3, 3)]
in Julia?
View Thread
Anyone knows what was breaking in the latest realease of `FillArrays`?
while trying to update `Franklin.jl` I ran into the error `ERROR: ArgumentError: Unsupported architecture 'aarch64' for macOS`. I tried running `pkg> update`and `pkg> resolve` as suggested here: , but that did not help. I am using julia 1.5.0 and windows 10. Any suggestions what I should do?
View Thread
how to get the dependencies of a package, such as Flux@0.10.4
View Thread
If i have a dataset with 1.000.000 obs. is there a way to select the first 1000 then skip 9000 and then select 10.000-11.000 etc?
View Thread
How can I log both to console as well as a file (and flush after each log line)? Basically I am trying to combine the following into the same global logger:
logger = ConsoleLogger(io, <http://Logging.Info|Logging.Info>)
global_logger(logger)
logger = ConsoleLogger(stdout, <http://Logging.Info|Logging.Info>)
global_logger(logger)
View Thread
I was wondering what is the most Julia way to return data. I have a function that can return two different results. This is what I have so far
function bar()
res1 = zeros(Float64, 1000)
res2 = zeros(Float64, 1000)
# algorithm to fill in res1 and res2
return res1, res2
end
but maybe I am thinking of using a `kwarg`
function bar(;result_type)
res1 = zeros(Float64, 1000)
res2 = zeros(Float64, 1000)
# algorithm to fill in res1 and res2
if result_type == :first
return res1
else
return res2
end
end
I like the second option because there is code downstream which assumes `bar()` returns a single array (but that's really not that big of a deal). Third option would be to use a struct?
struct MyResults
res1::Array{Float64, 1}
res2::Array{Float64, 1}
end
function bar()
res1 = zeros(Float64, 1000)
res2 = zeros(Float64, 1000)
# algorithm to fill in res1 and res2
res = MyResults()
res.res1 = res1
res.res2 = res2
return res
end
but I think this is unneccesarily making things complicated
View Thread
I guess, I could just map over integers and index in. Or use `enumerate`
View Thread
Is it possible to get the index of an array when using `map` I have code like this
res = map(myarray) do x
do stuff with x
do special things if x is the first element
end
but I don't really know how to do the second item there
Wat?
julia> f(;args::T...)where {T} = T
ERROR: syntax: space before "{" not allowed in "where {" at none:1
View Thread
maybe close it first
View Thread
I have a bewildering situation. I have generated some `Expr` , let's call it `code` . Now if I do
function foo()
$code
end
it works. But if I do
# Print code to file
open(io -> println(io, code), "foo.jl", "w")
# read in code
code2 = Meta.parse(String(open(read, "foo.jl")))
function foo()
$code2
end
then it errors. Should these two behave the same? Edit: Figured it out, see thread.
View Thread
It happens quite often (from time to time) that I have a set of elements, and want to create a dictionary mapping each unique element in the set to the number of occurrences of it in the set, like this:
count_dict = Dict(map(element -> element => count(element .== my_set), unique(my_set)))
Does there exists a function for this
(like I can manage without, but it seemed like something which might exist, and if it does, I should ask)
View Thread
If i have a dataframe and i only want to look at each 10th observation, how do i do that?
View Thread
Thank you <@USU9FRPEU>, I ended up reading a slightly more general one (<https://julialang.github.io/PackageCompiler.jl/dev/devdocs/sysimages_part_1/>), but now I feel much more comfortable with the process.
Follow-up question: If I want to change definitions in the base system image (rather than add another module), I suppose I would change the code in Base, find a way to unload the module, and then apply the same logic described in the link above?
Sorry if this is “too advanced” for the help desk.
Can I plot a matrix like this in Julia?
View Thread
I'm looking for an iterator that generates the same output as
Base.Iterators.product([0:1 for i in 1:n]...)
but where the output is ordered in the total number of 1s. So, the first element should be all zeros, then the next block are all the `(0,...,0,1,0,...0)`, before the elements with two 1s, and so on.
Another option that would work for me would be something akin to `Itertools.subsets` but where the output is ordered in the size of the subsets.
View Thread
Hello, in matlab language, we can use figure(1) and figure(2) to creat two independent plots. How should I do in Julia language? It shows that in Julia,
x = plot( 1:10, rand(10, 1 ) ) # x-plot
y = plot( 1:10, rand(10, 1 ) ) # y-plot
the screen will show only the second plot, and one has to use display function to show x-plot or y-plot, but not both. Google tells that an option of plot,
"reuse = false", of y-plot will solve this problem in REPL, but it shows that this does not work in script or function environment. I do not want to do subplot either.
Is there any trick to solve this problem?
View Thread
Is there some easy way to make the `MethodError: no method matching keymap(::Vector{Dict})` on master go away?
How do I make sure that channels are closed properly when a producer or consumer fails, without the following to deadlock:
producer(c1, c2) = foreach(x -> (put!(c1, x); put!(c2, x)), 1:3)
consumer1(c) = foreach(x -> println("One: ", x), c)
consumer2(c) = foreach(x -> println("Two: ", x), c)
@sync begin
c1 = Channel()
c2 = Channel()
t = @async producer(c1, c2)
bind(c1, t)
bind(c2, t)
@async consumer1(c1)
@async consumer2(c2)
end
The `bind` only works for errors in `producer`, but not `consumer`.
Hello,
I hope this is not a very dump question. I would like to associate a manifest.toml to a .jl file. Is it possible or do I need to create a package?
View Thread
I am trying to implement `rref` in a modulo field, but I am having trouble with all-zero rows. I wonder if someone could take a look at my code (in thread) and see where I am going wrong, because I’m at a loss…
View Thread
How might I go about writing a function that takes in a matrix `G` and a number `m` (which is the modulus of the field), and outputs all unique linear combinations?
I have a feeling I need to use `@nloops`, so I have written this:
@generated function get_codewords(G::AbstractArray, ::Val{n}, m::Integer) where n
quote
Base.Cartesian.@nloops $n i d -> 0:m-1 begin
wᵢ = vec([(Base.Cartesian.@ntuple $n i)...]) .* Base.Cartesian.@nextract 1 x d -> G[d, :]
println(wᵢ)
end
end
end
get_codewords(G::AbstractArray, m::Integer) = get_codewords(G, Val(size(G, 1)), m)
But this is not quite what I want. Any ideas? I am a little new to the Linear Algebra game in Julia, so I am probably _way_ overcomplicating it…
View Thread
Apologies, this is stuff I should know by experience. But apparently I am getting old.
I somehow seem to have failed to wrap my head around the docs. But is there any way to rebuild/build a system image without needing a complete checkout of the Julia source tree?
View Thread
100: dist = 940031.0555043541
200: dist = 841554.7489537231
julia> 300: dist = 824895.3910763789^C
julia>
^C
julia>
600: dist = 803526.8252443164
700: dist = 760113.3374338557
800: dist = 741908.676501098
900: dist = 735667.8233516186
I got something like above
View Thread
Would anyone tell me how to interrupt `Optim.optimize`? I tried `cntr+c` but it doesn't work.. It will just continue to optimize unless I kill the whole Julia session
Would anyone with expertise in GTK be willing to help me with this issue here: <https://github.com/JuliaGraphics/Gtk.jl/issues/529>
In short, what I am trying to do is grab a previously created GTK window that is created by a Julia script and "recycle" it in such way as to not have to open and close a new GTK window every single time I run the script. I want to use the same GTK each time I run my script. How do I do this?
View Thread
Why is `\endash` and `\emdash` listed in the <https://docs.julialang.org/en/v1.5/manual/unicode-input/|unicode support> but when I use it I get `syntax: invalid character "–" near column 1`?…
View Thread
If I have an identity matrix followed by some other stuff (e.g., `[1 0 0 2 3 0; 0 1 0 1 2 2; 0 0 1 4 3 0]`), is there a way in Julia to return only the part of the matrix that isn’t the identity? E.g., return `[2 3 0; 1 2 2; 4 3 0]`?
View Thread
Is there a way to plot with a second y axis (say, on the right) on a single plot? I didn't see anything in the Plots.jl examples or tutorial and stackoverflow wasn't much use either... I tried `axis=:right`, but it must be an unknown symbol
View Thread
How can I cube an entire array?
View Thread
I encountered some strange behaviour while testing the speed of sampling 1 out of 3 values with specified sampling weights. One of the values is null so I mistakenly used `Nothing` to represent it (instead of `nothing`, whose type is actually Nothing). The code is something like this:
M = M_trans(params...)
@time for i in 1:1000000
sample([1, 0, Nothing], aweights(M[s0, :]))
end
which returns `0.640328 seconds (5.00 M allocations: 289.917 MiB, 4.92% gc time)`. I decided to fix it by using `nothing` but unexpectedly this results in a >10x decrease in speed: `8.461066 seconds (7.00 M allocations: 350.952 MiB, 0.42% gc time)`.
Ultimately I'll just use an integer to encode the null value which is faster than both but I'm just curious about this behaviour. Should I avoid using `nothing` at all costs?
View Thread
Has anyone run into an issue with `using Flux` inside of a package lately? As of a couple hours ago, I get a bunch of errors about methods being overwritten and `incremental compilation may be fatally broken for this module`
I made an issue about it, but I'm really not sure what's going on at all: <https://github.com/FluxML/Flux.jl/issues/1370>
View Thread
Optim.jl,JuMP.jl
Is there a package that lets you optimize nonlinear user-defined functions?
The Julia Artifacts string macro `artifact"blabla"` appears to be dispatched on REPL behavior (only then it will look for the `toml` file in `pwd()`): <https://github.com/JuliaLang/Pkg.jl/blob/aaf4e6e8ab784f7435c1bdc56832bc03e014dedb/src/Artifacts.jl#L1046> It fails for me when using it in a `notebook` environment (Basically doesn't find `Artifacts.toml`). Are there simple work-around solutions?
View Thread
I have a 2d array I create like `a = [rand(4) for i in [0]]` (simplified for clarity) and I want to broadcast `cos()` over it. However `cos.(a)` yields `MethodError: no method matching cos(::Array{Float64,1})` . What am I missing?
View Thread
The following works fine:
julia> using Dates
julia> Dates.DateTime("2020-10-22T16:52:14.409Z", dateformat"yyyy-mm-dd\THH:MM:")
2020-10-22T16:52:14.409
Now if I add to it `using` or even `import` of `TimeZones`, then now the same code fails:
julia> using Dates
julia> import TimeZones
julia> Dates.DateTime("2020-10-22T16:52:14.409Z", dateformat"yyyy-mm-dd\THH:MM:")
ERROR: ArgumentError: Unable to parse date time. Expected directive DatePart(Z) at char 22
Stacktrace:
[1] macro expansion at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/parse.jl:104 [inlined]
[2] tryparsenext_core(::String, ::Int64, ::Int64, ::DateFormat{Symbol("yyyy-mm-dd\\THH:MM:"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.DatePart{'Z'}}}, ::Bool) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/parse.jl:38
[3] macro expansion at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/parse.jl:150 [inlined]
[4] tryparsenext_internal at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/parse.jl:125 [inlined]
[5] parse(::Type{DateTime}, ::String, ::DateFormat{Symbol("yyyy-mm-dd\\THH:MM:"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.DatePart{'Z'}}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/parse.jl:282
[6] DateTime(::String, ::DateFormat{Symbol("yyyy-mm-dd\\THH:MM:"),Tuple{Dates.DatePart{'y'},Dates.Delim{Char,1},Dates.DatePart{'m'},Dates.Delim{Char,1},Dates.DatePart{'d'},Dates.Delim{Char,1},Dates.DatePart{'H'},Dates.Delim{Char,1},Dates.DatePart{'M'},Dates.Delim{Char,1},Dates.DatePart{'S'},Dates.Delim{Char,1},Dates.DatePart{'s'},Dates.DatePart{'Z'}}}) at /Users/julia/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.5/Dates/src/io.jl:482
[7] top-level scope at REPL[8]:1
Looks like it is a bug and I reported it . But in the meantime, how can I work around this? (given that I do need to use both `Dates` and `TimeZones`)
Hello, for this code
#lower power flow limit
@constraint(wildfire_model,
-ref[:branch][l]["rate_a"] <=
sum(SF[l_index,j]*p[j] for j in 1:length(ref[:bus]))
+ sum(PSDF[l_index,j]*alpha[j] for j in 1:length(ref[:branch])))
#upper power flow limit
@constraint(wildfire_model,
sum(SF[l_index,j]*p[j] for j in 1:length(ref[:bus]))
+ sum(PSDF[l_index,j]*alpha[j] for j in 1:length(ref[:branch])))
<= ref[:branch][l]["rate_a"])
I am getting this error `syntax: "<=" is not a unary operator` . This is in JuMP. I am not sure what I did wrong
View Thread
I am struggling on a data structure dilemma. I have a time series data set spread out across five different file formats. File 1 contains the time series, File 2 and 3 contains about how the data collection instrument was set up for that particular time series, File 4 contains additional time series information, and File 5 contains further information on the data collection instrument. These files exist for nearly 30 separate data recording sessions and each file could contain differing information that would be important for analysis. In total, this comes to about 3 billion data entries spread across these files.
How best could I structure this data? I have looked at RecursiveArrayTools.jl and thought that waspromising, AxisArrays.jl may also work as it can get me away from dictionaries, and AxisIndices (which looks like it builds on top of AxisArrays and makes it even better). Does anyone have any suggestions on what I should do here? Thanks for the help everyone! :smile:
View Thread
I am discovering the joys and headaches of Named Tuples. How can I make this work?
`function nameparts(v)`
`t = split(v,':')`
`length(t) < 2 ? (nothing,t[1]) : (t[1],t[2])`
`end`
`struct QName{T<:AbstractString}`
`pfx::Union{T,Nothing}`
`nm::T`
`end`
`QName(nm::AbstractString) = QName(nameparts(nm)...)`
`struct ID{T<:AbstractString}`
`id::T`
`end`
`attr = Dict("base"=>"xs:string")`
`atts = @NamedTuple{base::QName, id::Union{Nothing,ID}}`
`s = string.(fieldnames(atts))`
`vals = get.(Ref(attr), s, nothing) #vals will be strings or nothing`
Now I want to instantiate the types to create a result tuple that looks like
`(QName{SubString{String}}("xs", "string"), nothing)`
…but instantiating the NamedTuple gives an error
`maybe = atts(vals)`
ERROR: MethodError: Cannot `convert` an object of type
String to an object of type
QName
Closest candidates are:
convert(::Type{T}, ::T) where T at essentials.jl:171
QName(::AbstractString) at /Users/doug/dev/XSDJ/src/ex.jl:10
QName(::Union{Nothing, T}, ::T) where T<:AbstractString at /Users/doug/dev/XSDJ/src/ex.jl:7
What am I missing? Do I need to implement new methods for `convert` ?
View Thread
What is going on :sob: I am pressing enter
View Thread
I have a `t=(;a=f, b=g)` named tuple of functions and I want to transform this in a named tuple of return values, such `ev(t, x)` gives `(;a=f(x), b=g(x))` The tricky part is reading the key names from the argument type of `t` of the function `ev` and use this somehow to create a new named tuple...
View Thread
Is there a simple way to batch together a dataset of 3D images? I know flux has a flux.batch but I’m not sure if that works for 3D images
View Thread
Is there a neat way of figuring out if a bitstype has a specific bit layout? For example, right now I do
function iszero(x::NTuple{16, UInt8})
r = Ref(x)
ptr = Ptr{UIn128}(pointer_from_objref(r))
return iszero(unsafe_load(ptr))
end
Getting a stable error on Taro activation. Any ideas on how to get more detailed description?
`export JULIA_COPY_STACKS=yes && julia --project=.`
`julia> using Taro`
`julia> Taro.init()`
`signal (11): Segmentation fault: 11`
`in expression starting at REPL[2]:1`
`unknown function (ip: 0x13452f62d)`
`Allocations: 4054721 (Pool: 4053324; Big: 1397); GC: 5`
julia> versioninfo()
Julia Version 1.5.2
Commit 539f3ce943 (2020-09-23 23:17 UTC)
Platform Info:
OS: macOS (x86_64-apple-darwin18.7.0)
CPU: Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
WORD_SIZE: 64
LIBM: libopenlibm
LLVM: libLLVM-9.0.1 (ORCJIT, broadwell)
Environment:
JULIA_COPY_STACKS = yes
View Thread
Out of curiosity, is there an autodiff package that can mollify if statements?
View Thread
Any idea what is wrong?
struct StVenant_rakenne
Parametrit::Dict
Johdannaisparametrit::Dict
Joki::SharedArray
end
...
Johdannaisparametrit = Johdannaiset(s.Parametrit)
...
function Johdannaiset(Parametrit::Dict)
dX = Parametrit["Pituus"] / (Parametrit["Laskentapisteet"] - 1)
So = (Parametrit["Pohja_alkukorko"] - Parametrit["Pohja_loppukorko"]) / Parametrit["Pituus"]
x = Dict{String,Float64}("dX" => dX, "So" => So)
return x
end
This gets "ERROR: LoadError: MethodError: no method matching -(::String, ::Int64)
Closest candidates are:
-(::Missing, ::Number) at missing.jl:115
-(::BigInt, ::Union{Int16, Int32, Int64, Int8}) at gmp.jl:532
-(::BigFloat, ::Union{Int16, Int32, Int64, Int8}) at mpfr.jl:425
..."
View Thread
Is there a way to catch a warning? I want to redefine some constants, but instead of triggering a whole list of warnings, I thought it might be better to catch them and print a single one.
View Thread
Hi, I was just glancing at <https://docs.julialang.org/en/v1/manual/integers-and-floating-point-numbers/> and in the table I saw that the boolean has 8 bits. Why does it have 8 instead of 1 ...?
View Thread
I'm looking for something that leverages some flavor of search trees to achieve intersections in ~ O(log(N)) time
Anybody know of a package to (efficiently) find intersections of N-dimensional meshes with lines, planes, etc?
What's the best way currently to get `Pkg` to run in a reasonable time on Windows and Julia 1.5.2? Updating the registry currently takes something like 5 minutes for me, part of which is probably my lovely corporate antivir which I can't disable
View Thread
Can verify that I reran a previously successful job to get this error
Is anyone familiar with this build error I'm getting that wasn't an issue maybe an hour ago? Testing with Julia 1.4 on Ubuntu-latest via GitHub Actions
Run julia-actions/julia-buildpkg@latest
Cloning default registries into `~/.julia`
Cloning registry from ""
25l Fetching: [> ] 0.0 %
Fetching: [=============> ] 31.9 %
Fetching: [==================================> ] 83.0 %
Added registry `General` to `~/.julia/registries/General`
Updating registry at `~/.julia/registries/General`
Updating git-repo ``
Installed PooledArrays ───────────────── v0.5.3
Installed ProgressMeter ──────────────── v1.4.0
Installed MultipleTesting ────────────── v0.4.1
Installed FileIO ─────────────────────── v1.4.3
Installed StaticArrays ───────────────── v0.12.4
Installed StatsBase ──────────────────── v0.33.2
Installed Distributions ──────────────── v0.23.12
Installed DataAPI ────────────────────── v1.3.0
Installed Requires ───────────────────── v1.1.0
Installed Artifacts ──────────────────── v1.3.0
Installed OpenSpecFun_jll ────────────── v0.5.3+4
Installed JLD2 ───────────────────────── v0.2.4
Installed CategoricalArrays ──────────── v0.8.3
Installed TableTraits ────────────────── v1.0.0
Installed DataFrames ─────────────────── v0.21.8
Installed CodecZlib ──────────────────── v0.7.0
Installed PDMats ─────────────────────── v0.10.1
Installed Rmath_jll ──────────────────── v0.2.2+1
Installed IteratorInterfaceExtensions ── v1.0.0
Installed Rmath ──────────────────────── v0.6.1
Installed SortingAlgorithms ──────────── v0.3.1
Installed MacroTools ─────────────────── v0.5.6
Installed DataStructures ─────────────── v0.18.7
Installed QuadGK ─────────────────────── v2.4.1
Installed OrderedCollections ─────────── v1.3.1
Installed StructTypes ────────────────── v1.1.0
Installed Reexport ───────────────────── v0.2.0
Installed JLLWrappers ────────────────── v1.1.2
Installed SentinelArrays ─────────────── v1.2.16
Installed DataValueInterfaces ────────── v1.0.0
Installed FillArrays ─────────────────── v0.9.7
Installed Tables ─────────────────────── v1.1.0
Installed TranscodingStreams ─────────── v0.9.5
Installed StatsFuns ──────────────────── v0.9.5
Installed CompilerSupportLibraries_jll ─ v0.3.5+0
Installed Parsers ────────────────────── v1.0.11
Installed InvertedIndices ────────────── v1.0.0
Installed Missings ───────────────────── v0.4.4
Installed JSON ───────────────────────── v0.21.1
Installed Zlib_jll ───────────────────── v1.2.11+18
Installed Compat ─────────────────────── v3.21.0
Installed SpecialFunctions ───────────── v0.10.3
Installed CSV ────────────────────────── v0.7.7
ERROR: ArgumentError: Unsupported architecture 'aarch64' for macOS
Stacktrace:
[1] MacOS at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/BinaryPlatforms.jl:216 [inlined]
[2] unpack_platform(::Dict{String,Any}, ::String, ::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Artifacts.jl:429
[3] (::Pkg.Artifacts.var"#21#22"{String,String})(::Dict{String,Any}) at ./none:0
[4] iterate at ./generator.jl:47 [inlined]
View Thread
Could anyone point out why the following is happening? If `t0 ≤ t < t1 == true`, `ExcitatoryConductance` gives `ge = Ne*gbar*(finf+(f0-finf)` and ignores `exp(-t/tau)`. Does this have something to do with my usage of constants?
View Thread
Sorry, I don't understand why your `deepsym` function doesn't solve the issue. It does exactly what you say you want.
View Thread
Sorry if I am cluttering up the channel, but I also can’t figure out how to get a function to act on the innermost element of an abstract array? I want:
julia deepsymbol([[1 2 3], [4 5 6]])
2-element Array{Symbol,1}:
[Symbol(\"1\") Symbol(\"2\") Symbol(\"3\")]
[Symbol(\"4\") Symbol(\"5\") Symbol(\"6\")]
Broadcastring `Symbol` makes the outer-most elements in the array `Symbol`s, and I have tried defining
julia> deepsym(a::Number) = a
deepsym (generic function with 1 method)
julia> deepsym(a) = Symbol.(deepsym.(a))
deepsym (generic function with 2 methods)
But that makes _everything_ symbols. Any ideas? :slightly_smiling_face:
How can I use `where T` with a return type in a one-line function?
julia> function myfunc(x::T)::T where T
return x^2
end
myfunc (generic function with 1 method)
julia> myfunc(x::T)::T where T = x^2
ERROR: UndefVarError: T not defined
julia> myfunc(x::T) where T = x^2
myfunc (generic function with 1 method)
View Thread
Can I make values of a matrix into a Dict()?
View Thread
I have a package with Python dependencies that uses `Base.prompt` to ask users if it should try auto-installing the dependnecy using either conda or pip. We need the Python package when precompiling to build docstrings. But it looks like `Base.prompt` never prompts the user during precompilation, so it fails. Any suggestions?
View Thread