# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=764

[Latest](https://discourse.julialang.org/latest.md) · [Categories](https://discourse.julialang.org/categories.md) · [Tags](https://discourse.julialang.org/tags.md)

**Page:** 765

---

## [Why cannot Julia v1.4 find the installed Python?](https://discourse.julialang.org/t/why-cannot-julia-v1-4-find-the-installed-python/37726)

<div class="topic-metadata">

**Author:** [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Replies:** 0\
**Last updated:** [April 17, 2020, 12:17am UTC](https://discourse.julialang.org/t/why-cannot-julia-v1-4-find-the-installed-python/37726 "2020-04-17T00:17:08Z")

</div>

I installed Python V3.8 on windows 7 x64 and would like to rebuild PyCall. I added PyCall package. I changed the global variable ENV ENV\[“PYTHON”\] = “D:\\programs\\python\\v38\\python.exe” Then I use the command usin…

---

## [Unsafe\_wrap C pointer after first element](https://discourse.julialang.org/t/unsafe-wrap-c-pointer-after-first-element/37723)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 4\
**Last updated:** [April 17, 2020, 12:37am UTC](https://discourse.julialang.org/t/unsafe-wrap-c-pointer-after-first-element/37723 "2020-04-17T00:37:31Z")

</div>

Hi, How to wrap the contents of a C pointer, not from its first element, which is done with unsafe\_wrap(Array, ptr, 100) but for example, from its 50th element? With C address it would be unsafe\_wrap(Array, &ptr\[49\]…

---

## [Plot using @timed](https://discourse.julialang.org/t/plot-using-timed/37714)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 3\
**Last updated:** [April 16, 2020, 10:48pm UTC](https://discourse.julialang.org/t/plot-using-timed/37714 "2020-04-16T22:48:40Z")

</div>

I have implemented three functions to calculate the Fibonacci numbers like the following: function fib(n::Integer)::BigInt if n \<= 1 n else fib(n-1) + fib(n-2) end end \*\* fib2(n::Integer)::BigInt =round(BigInt,((1+sqr…

---

## [How to access the data in @timed and plot directly](https://discourse.julialang.org/t/how-to-access-the-data-in-timed-and-plot-directly/37692)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 0\
**Last updated:** [April 16, 2020, 10:24am UTC](https://discourse.julialang.org/t/how-to-access-the-data-in-timed-and-plot-directly/37692 "2020-04-16T10:24:02Z")

</div>

I have implemented three functions to calculate the Fibonacci numbers like the following: function fib(n::Integer)::BigInt if n \<= 1 n else fib(n-1) + fib(n-2) end end \*\* fib2(n::Integer)::BigInt =round(BigInt,((1+sqr…

---

## [Error when compile v1.4.0](https://discourse.julialang.org/t/error-when-compile-v1-4-0/37700)

<div class="topic-metadata">

**Author:** [@Zhang\_Wei](https://discourse.julialang.org/u/Zhang_Wei)\
**Replies:** 5\
**Last updated:** [April 16, 2020, 5:37pm UTC](https://discourse.julialang.org/t/error-when-compile-v1-4-0/37700 "2020-04-16T17:37:30Z")

</div>

Hi All, I try to compile v1.4.0 using gcc 6.4.0, get following error: error during bootstrap: LoadError(“sysimg.jl”, 3, LoadError(“Base.jl”, 198, LoadError(“version.jl”, 240, ArgumentError("invalid version string: ")…

---

## [Mapleaves not found?](https://discourse.julialang.org/t/mapleaves-not-found/37704)

<div class="topic-metadata">

**Author:** [@SY\_QQX](https://discourse.julialang.org/u/SY_QQX)\
**Replies:** 2\
**Last updated:** [April 16, 2020, 5:10pm UTC](https://discourse.julialang.org/t/mapleaves-not-found/37704 "2020-04-16T17:10:14Z")

</div>

I was trying to map a layer into Cuda following the tutorial at https://fluxml.ai/Flux.jl/v0.4/gpu.html However, when I tried, it said mapleaves not defined. Is the method deprecated? If so, what is the proper way of d…

---

## [Why is the y axis label horizontal](https://discourse.julialang.org/t/why-is-the-y-axis-label-horizontal/37681)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 4\
**Last updated:** [April 16, 2020, 4:52pm UTC](https://discourse.julialang.org/t/why-is-the-y-axis-label-horizontal/37681 "2020-04-16T16:52:40Z")

</div>

For weeks this worked. I haven’t touched the plot function. Suddenly, the y axis label is horizontal instead of vertical. guidefontrotation changes both the x axis and y axis labels. So, that won’t work. Yes, I adde…

---

## [Cannot use Plots](https://discourse.julialang.org/t/cannot-use-plots/37616)

<div class="topic-metadata">

**Author:** [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Replies:** 11\
**Last updated:** [April 16, 2020, 3:59pm UTC](https://discourse.julialang.org/t/cannot-use-plots/37616 "2020-04-16T15:59:20Z")

</div>

I am unable to create plots with Julia v1.4 on Windows 7 x64. The package cannot be initiated. see the screenshot and error message below. Blockquote julia\> using Plots ERROR: InitError: could not load library …

---

## [Efficient way to apply monotonous rank transformation to an array](https://discourse.julialang.org/t/efficient-way-to-apply-monotonous-rank-transformation-to-an-array/37689)

<div class="topic-metadata">

**Author:** [@francesco.alemanno](https://discourse.julialang.org/u/francesco.alemanno)\
**Replies:** 4\
**Last updated:** [April 16, 2020, 1:51pm UTC](https://discourse.julialang.org/t/efficient-way-to-apply-monotonous-rank-transformation-to-an-array/37689 "2020-04-16T13:51:02Z")

</div>

hi guys, i wonder if any of you know of a more efficient way to rank an array currently i am using A=\[45, 4, 7, 10, 25, 36, 36, 22, 31, 16\] # input vector S=invperm(sort(1:length(A),by=i-\>A\[i\])) f(x)=x^2 B=1:length(…

---

## [Atomic\_min for floats](https://discourse.julialang.org/t/atomic-min-for-floats/35880)

<div class="topic-metadata">

**Author:** [@eaubanel](https://discourse.julialang.org/u/eaubanel)\
**Replies:** 9\
**Last updated:** [April 16, 2020, 1:25pm UTC](https://discourse.julialang.org/t/atomic-min-for-floats/35880 "2020-04-16T13:25:57Z")

</div>

I’m getting unexpected behavior for atomic\_min!(x::Atomic{T}, val::T) with floats. This function returns the old value of x. Works fine for Ints, but for Floats it returns the new value: julia\> E = Atomic{Float64}(10) …

---

## [Help understanding what happens in a \`@threads\` loop with race conditions](https://discourse.julialang.org/t/help-understanding-what-happens-in-a-threads-loop-with-race-conditions/37584)

<div class="topic-metadata">

**Author:** [@ExpandingMan](https://discourse.julialang.org/u/ExpandingMan)\
**Replies:** 13\
**Last updated:** [April 15, 2020, 10:03pm UTC](https://discourse.julialang.org/t/help-understanding-what-happens-in-a-threads-loop-with-race-conditions/37584 "2020-04-15T22:03:29Z")

</div>

It tried something silly that went wrong, and I’m trying to get a better understanding of exactly why this happens. Consider the following using Base.Threads function mask!(v, M) @threads for j ∈ 1:size(M,2) …

---

## [How to dispatch on an iterable (e.g. accept both tuple or array)](https://discourse.julialang.org/t/how-to-dispatch-on-an-iterable-e-g-accept-both-tuple-or-array/37629)

<div class="topic-metadata">

**Author:** [@jtravs](https://discourse.julialang.org/u/jtravs)\
**Replies:** 4\
**Last updated:** [April 15, 2020, 9:38pm UTC](https://discourse.julialang.org/t/how-to-dispatch-on-an-iterable-e-g-accept-both-tuple-or-array/37629 "2020-04-15T21:38:22Z")

</div>

Is it possible to dispatch on if a method argument is iterable? I’d like to dispatch a method based on if an argument is scalar input or some kind of iterable. My main target for the iterable method is to accept either a…

---

## [Unable to add Plots package in V1.4](https://discourse.julialang.org/t/unable-to-add-plots-package-in-v1-4/37610)

<div class="topic-metadata">

**Author:** [@fhkm](https://discourse.julialang.org/u/fhkm)\
**Replies:** 8\
**Last updated:** [April 15, 2020, 8:20pm UTC](https://discourse.julialang.org/t/unable-to-add-plots-package-in-v1-4/37610 "2020-04-15T20:20:55Z")

</div>

I have a clean install of V1.4 and failed to add Plots package. See the screenshot and the message below: How can I fix this issue? Thank you very much. julia\> import Pkg julia\> Pkg.add(“Plots”) Updating registry…

---

## [Weird behaviour with packages and multiple processes](https://discourse.julialang.org/t/weird-behaviour-with-packages-and-multiple-processes/37651)

<div class="topic-metadata">

**Author:** [@Ward9250](https://discourse.julialang.org/u/Ward9250)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 6:25pm UTC](https://discourse.julialang.org/t/weird-behaviour-with-packages-and-multiple-processes/37651 "2020-04-15T18:25:57Z")

</div>

Hi, I’m trying to develop a package which has some functionality that uses Distributed, I created a project to test and run my function but I’m getting some weirdness: So I created a project with the package I wanted to…

---

## [Embedding Julia without RTLD\_GLOBAL in dlopen?](https://discourse.julialang.org/t/embedding-julia-without-rtld-global-in-dlopen/37655)

<div class="topic-metadata">

**Author:** [@OliverEvans96](https://discourse.julialang.org/u/OliverEvans96)\
**Replies:** 3\
**Last updated:** [April 15, 2020, 5:47pm UTC](https://discourse.julialang.org/t/embedding-julia-without-rtld-global-in-dlopen/37655 "2020-04-15T17:47:41Z")

</div>

Hi all, I’ll briefly explain my specific problem, then describe the general question with a minimal working example. The specific problem I’m interested in using Julia to create an LV2 plugin, which is basically an eff…

---

## [How to generate variables and assign values from a dictionary by metapgramming?](https://discourse.julialang.org/t/how-to-generate-variables-and-assign-values-from-a-dictionary-by-metapgramming/37638)

<div class="topic-metadata">

**Author:** [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Replies:** 4\
**Last updated:** [April 15, 2020, 2:10pm UTC](https://discourse.julialang.org/t/how-to-generate-variables-and-assign-values-from-a-dictionary-by-metapgramming/37638 "2020-04-15T14:10:31Z")

</div>

I am using ArgParse.jl to parse command line arguments. It returns a dictionary. But I would prefer to generate variables so it’s easier to use them. I tried to use Meta programming as follows function main() parse…

---

## [Using Documenter.jl for non-Julia package documentation](https://discourse.julialang.org/t/using-documenter-jl-for-non-julia-package-documentation/37511)

<div class="topic-metadata">

**Author:** [@tedsteiner](https://discourse.julialang.org/u/tedsteiner)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 10:45am UTC](https://discourse.julialang.org/t/using-documenter-jl-for-non-julia-package-documentation/37511 "2020-04-15T10:45:59Z")

</div>

I recently tried using Documenter.jl to add documentation to a Julia package and I really liked how it worked. I was thinking about using Documenter.jl to write documentation for non-Julia packages and was wondering if a…

---

## [Modify elements of struct without changing original inputs](https://discourse.julialang.org/t/modify-elements-of-struct-without-changing-original-inputs/37592)

<div class="topic-metadata">

**Author:** [@corbat](https://discourse.julialang.org/u/corbat)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 6:53am UTC](https://discourse.julialang.org/t/modify-elements-of-struct-without-changing-original-inputs/37592 "2020-04-15T06:53:14Z")

</div>

Hi, I have a question regarding a situation where I want to pass a (mutable) struct to another struct. Please see the MWE below. mutable struct MyStruct arr::Array{Real, 1} end struct MyOtherStruct ms::MyStru…

---

## [Memory issues](https://discourse.julialang.org/t/memory-issues/37594)

<div class="topic-metadata">

**Author:** [@natgeo-wong](https://discourse.julialang.org/u/natgeo-wong)\
**Replies:** 3\
**Last updated:** [April 15, 2020, 6:47am UTC](https://discourse.julialang.org/t/memory-issues/37594 "2020-04-15T06:47:57Z")

</div>

Hi! Got a question on memory handling: For the following script nlon = 360; nlat = 181; nhr = 744; np = 37; for loop = 1 : 5 @info "$(Dates.now()) - Preallocating arrays ..." Ta = zeros(nlon,nlat,nhr,np); sH…

---

## [Julia function help page](https://discourse.julialang.org/t/julia-function-help-page/37605)

<div class="topic-metadata">

**Author:** [@Jing\_Zhang](https://discourse.julialang.org/u/Jing_Zhang)\
**Replies:** 5\
**Last updated:** [April 15, 2020, 6:38am UTC](https://discourse.julialang.org/t/julia-function-help-page/37605 "2020-04-15T06:38:40Z")

</div>

Dear experienced Julia users, Does Julia offer a help page like R? In R, if you type ?function\_name, a help page will show up with explanations of all arguments and some examples. In Julia, however, if I type ?functio…

---

## [DifferentialEquations.jl inplace implicit ODE problem](https://discourse.julialang.org/t/differentialequations-jl-inplace-implicit-ode-problem/37495)

<div class="topic-metadata">

**Author:** [@santiagobadia](https://discourse.julialang.org/u/santiagobadia)\
**Replies:** 4\
**Last updated:** [April 15, 2020, 5:12am UTC](https://discourse.julialang.org/t/differentialequations-jl-inplace-implicit-ode-problem/37495 "2020-04-15T05:12:24Z")

</div>

I am trying to combine the ODE solvers in DifferentialEquations.jl with the PDE solvers in the Gridap.jl library. It is mandatory for our applications to use the inplace version of the DifferentialEquations.jl package. …

---

## [Computation with huge numbers: BigInt, BigFloat etc](https://discourse.julialang.org/t/computation-with-huge-numbers-bigint-bigfloat-etc/37591)

<div class="topic-metadata">

**Author:** [@harven](https://discourse.julialang.org/u/harven)\
**Replies:** 2\
**Last updated:** [April 15, 2020, 1:16am UTC](https://discourse.julialang.org/t/computation-with-huge-numbers-bigint-bigfloat-etc/37591 "2020-04-15T01:16:45Z")

</div>

I am trying to compute the number binomial(100,50)/2^100, among others. The following code gives an explicit rational value of type Rational{BigInt} for that number. julia\> using Combinatorics julia\> binomial(big(100)…

---

## [Function Problem](https://discourse.julialang.org/t/function-problem/37596)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 6\
**Last updated:** [April 15, 2020, 12:27am UTC](https://discourse.julialang.org/t/function-problem/37596 "2020-04-15T00:27:15Z")

</div>

Sorry I am new in Julia , This is my Fibonacci numbers function : \> global fib\_cache = Dict{BigInt, BigInt}(0 =\> 0, 1 =\> 1) \> function fib(n::Integer) \> global fib\_cache \> if haskey(fib\_cache, n) \> fib\_cache\[n\] \> else \> …

---

## [How to make a global constant thread local?](https://discourse.julialang.org/t/how-to-make-a-global-constant-thread-local/37595)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 1\
**Last updated:** [April 14, 2020, 11:17pm UTC](https://discourse.julialang.org/t/how-to-make-a-global-constant-thread-local/37595 "2020-04-14T23:17:40Z")

</div>

To make my code thread-safe, I am making some constant thread local. However, in the following package example module Foo const bar = zeros(Threads.nthreads()) end the length of bar will be stuck at JULIA\_NUM\_THREADS …

---

## [Package name suggestion](https://discourse.julialang.org/t/package-name-suggestion/37557)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 10\
**Last updated:** [April 14, 2020, 8:18pm UTC](https://discourse.julialang.org/t/package-name-suggestion/37557 "2020-04-14T20:18:21Z")

</div>

Hi, I am the developper of PseudoArcLengthContinuation.jl and based on several discourse posts ( most notably this one), it appears that the name of my package is not very well chosen. More precisely, people seem surpri…

---

## [Startup.jl having no effect](https://discourse.julialang.org/t/startup-jl-having-no-effect/37576)

<div class="topic-metadata">

**Author:** [@ArborealAnole](https://discourse.julialang.org/u/ArborealAnole)\
**Replies:** 0\
**Last updated:** [April 14, 2020, 5:41pm UTC](https://discourse.julialang.org/t/startup-jl-having-no-effect/37576 "2020-04-14T17:41:52Z")

</div>

I’m using Julia Pro 1.4.0 on Arch Linux. I want to import packages and write a text message to the console (for testing) when I start the REPL. But neither happen. The following is my ~/.julia/config/startup.jl and ~/.ju…

---

## [Is it possible to select the Julia version in an environmet?](https://discourse.julialang.org/t/is-it-possible-to-select-the-julia-version-in-an-environmet/37567)

<div class="topic-metadata">

**Author:** [@angelv](https://discourse.julialang.org/u/angelv)\
**Replies:** 4\
**Last updated:** [April 14, 2020, 4:52pm UTC](https://discourse.julialang.org/t/is-it-possible-to-select-the-julia-version-in-an-environmet/37567 "2020-04-14T16:52:14Z")

</div>

Hi, I’m starting to get familiar with environments while following the course on Parallel Computing with Julia in JuliaAcademy. The repository for that course comes with Project.toml and Manifest.toml files to specify t…

---

## [Using isdefined to check where a function is defined](https://discourse.julialang.org/t/using-isdefined-to-check-where-a-function-is-defined/37536)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 15\
**Last updated:** [April 14, 2020, 3:17pm UTC](https://discourse.julialang.org/t/using-isdefined-to-check-where-a-function-is-defined/37536 "2020-04-14T15:17:12Z")

</div>

Hi all, In CxxWrap, there is a check to determine if a function declaration should be prepended with the module, for example to extend functions in Base, using isdefined. However, when creating functions that have the s…

---

## [@timed to plot the time and memory consumption](https://discourse.julialang.org/t/timed-to-plot-the-time-and-memory-consumption/37477)

<div class="topic-metadata">

**Author:** [@A.U.M](https://discourse.julialang.org/u/A.U.M)\
**Replies:** 6\
**Last updated:** [April 14, 2020, 2:58pm UTC](https://discourse.julialang.org/t/timed-to-plot-the-time-and-memory-consumption/37477 "2020-04-14T14:58:37Z")

</div>

Hello, I am new to Julia. I have implemented different type of functions ( Fib 1 , Fib2, … etc ) to calculate Fibonacci numbers in different ways. How can I Use the macro @timed to plot the time and memory consumption o…

---

## [Hashes change whenever package is pre-compiled](https://discourse.julialang.org/t/hashes-change-whenever-package-is-pre-compiled/37555)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 12\
**Last updated:** [April 14, 2020, 12:49pm UTC](https://discourse.julialang.org/t/hashes-change-whenever-package-is-pre-compiled/37555 "2020-04-14T12:49:13Z")

</div>

I have a very simple package I am developing, say defined like this: module MyPkg struct A a::Int end end # module Now in a Julia session, I import this package, and compute a hash of an object: julia\> using MyPkg …

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=763)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=765)
