Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
BridgingBot
@GitterIRCbot
[slack] <simon> yeah, image(x_start...x_end, y_start...y_end, raster_image)
[irc] <[exa]> that should work then
[slack] <eric.forgy> :man-shrugging:
David Smith
@davidssmith_gitlab
Hi, all! What is the Julia 1.0+ way to check if a package is installed?
matrixbot
@matrixbot
&Adam David Smith (Gitter):
using Pkg

"Modia" in keys(Pkg.installed())
&Adam @davidssmith_gitlab: ^
David Smith
@davidssmith_gitlab
When I do that I get an error like "Package X does not have Pkg in its dependencies"
A Travis error, I should have said.
matrixbot
@matrixbot
&Adam Well then you need to add Pkg to the environment that Travis is running the command in.
David Smith
@davidssmith
how do I do that?
matrixbot
@matrixbot
&Adam You have a link to the package in question?
&Adam Well anyway, activate the environment in question with a Julia REPL: using Pkg; Pkg.activate("path/to/environment"). And then add Pkg to the environment with Pkg.add("Pkg").
BridgingBot
@GitterIRCbot
[irc] <lechner> Hi, I cannot install arpack on Debian testing even though libarpack.so.2.1.0 is installed. What is the issue in this log, please? http://paste.debian.net/1099605/
BridgingBot
@GitterIRCbot
[slack] <nalimilan> What's in ~/.julia/packages/Arpack/cu5By/deps/build.log?
[slack] <nalimilan> I.e. a problem with Debian packages which should be reported there, and can be fixed by using official binaries.
BridgingBot
@GitterIRCbot
[irc] <efrahim> Is there a way to check which git-commit of a certain package one is using through julia?
BridgingBot
@GitterIRCbot
[slack] <fredrikekre> Just check the version number, which (should) have a corresponding git tag.
BridgingBot
@GitterIRCbot
[slack] <oxinabox> Unless you have it dev’d
[slack] <oxinabox> or have added a branch
[slack] <oxinabox> Or if they were not using tagbot / manually tagging. (But for that can you can read the registry by hand it is just more annoying.)
BridgingBot
@GitterIRCbot
[irc] <uskerine> hi, I want to understand how can I define some global variables in a separate file and call them from other file. I am starting with Julia, any guideline so I can google in the right direction is welcomed. thanks
BridgingBot
@GitterIRCbot
[slack] <mortenpi> include("global_variable_file.jl") should do the trick?
[irc] <uskerine> I want to have several files (structured code) and a common file with global variables
[irc] <uskerine> would include try to redefine the same global variables ?
BridgingBot
@GitterIRCbot
[irc] <uskerine> is there any recommendation for variable/function names in Julia? Like, this_is_my_function vs. thisIsMyFunction ?
BridgingBot
@GitterIRCbot
[slack] <jeffrey_sarnoff> https://github.com/JuliaPraxis/Naming
BridgingBot
@GitterIRCbot
[irc] <uskerine> how can I return a vector of 4 Int32
[irc] <uskerine> in a function?
[slack] <pfitzseb> f(a,b,c,d) = [a,b,c,d]?
[slack] <pfitzseb> you can't with normal arrays -- their type doesn't include any information about the vector's length
[slack] <pfitzseb> you can look into StaticArrays.jl though, which do include that info in their type
BridgingBot
@GitterIRCbot
[irc] <uskerine> but if I do this: a = Vector{Int32}(undef, 4) I allocate space for a 4 item vector, right?
[slack] <pfitzseb> yes
BridgingBot
@GitterIRCbot
[irc] <uskerine> I see, but you can not specify that as return value of a function
[irc] <uskerine> btw, what is the value of specifying a return value of a function?
[irc] <uskerine> by value I mean benefit
BridgingBot
@GitterIRCbot
[slack] <pfitzseb> it can improve performance if Julia can't infer the return type on it's own
[slack] <pfitzseb> and it helps with correctness, because you get a runtime error if return value can't be converted to the indicated return type
[slack] <pfitzseb> julia> typeof((Int32(1), Int32(2), Int32(3), Int32(4)))
NTuple{4,Int32}
BridgingBot
@GitterIRCbot
[irc] <uskerine> Thanks, I am trying to get that be the value of a returned function now
[irc] <uskerine> please kindly see edited question
BridgingBot
@GitterIRCbot
[irc] <uskerine> nah I found the issue, I was using Tuple instead of NTuple in the return