# General Usage

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

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

**Page:** 399

---

## [Copy the return value of a function to the clipboard](https://discourse.julialang.org/t/copy-the-return-value-of-a-function-to-the-clipboard/87112)

<div class="topic-metadata">

**Author:** [@qwerty](https://discourse.julialang.org/u/qwerty)\
**Replies:** 1\
**Last updated:** [September 12, 2022, 7:54am UTC](https://discourse.julialang.org/t/copy-the-return-value-of-a-function-to-the-clipboard/87112 "2022-09-12T07:54:10Z")

</div>

I have a function that returns a string, how can I make it so that when the function terminates the result is automatically copied to the clipboard (ctrl + c)? Thank you.

---

## [Julia in Colab suddenly does not work](https://discourse.julialang.org/t/julia-in-colab-suddenly-does-not-work/87108)

<div class="topic-metadata">

**Author:** [@Shuo\_Z](https://discourse.julialang.org/u/Shuo_Z)\
**Replies:** 0\
**Last updated:** [September 12, 2022, 5:27am UTC](https://discourse.julialang.org/t/julia-in-colab-suddenly-does-not-work/87108 "2022-09-12T05:27:47Z")

</div>

I had been using Julia in Colab for months, it had been working well until 8th Sep. The template I use is: Julia Template Colab The installation (1st cell) suddenly cannot be complete. I tried to change runtime type, …

---

## [About limitations and mismatch in set of identifiers when using PyJulia](https://discourse.julialang.org/t/about-limitations-and-mismatch-in-set-of-identifiers-when-using-pyjulia/87042)

<div class="topic-metadata">

**Author:** [@AntoineRestivo](https://discourse.julialang.org/u/AntoineRestivo)\
**Replies:** 5\
**Last updated:** [September 11, 2022, 8:01pm UTC](https://discourse.julialang.org/t/about-limitations-and-mismatch-in-set-of-identifiers-when-using-pyjulia/87042 "2022-09-11T20:01:19Z")

</div>

Hi everyone, I am interested to make a package available for python users. I understood that the right tool would be PyJulia. The point is, as I understand it has some limitations about the comprehension of valid identif…

---

## [How to update Julia in Juliaup?](https://discourse.julialang.org/t/how-to-update-julia-in-juliaup/87067)

<div class="topic-metadata">

**Author:** [@Shayan](https://discourse.julialang.org/u/Shayan)\
**Replies:** 7\
**Last updated:** [September 11, 2022, 5:04pm UTC](https://discourse.julialang.org/t/how-to-update-julia-in-juliaup/87067 "2022-09-11T17:04:59Z")

</div>

I’m using Juliaup in my Windows OS, and now I’m waiting for Julia 1.8.1 to be installable by Juliaup. In their Github, they stated that juliaup update should do the job and update the installed Julia to the latest releas…

---

## [Is the manual register of new versions over?](https://discourse.julialang.org/t/is-the-manual-register-of-new-versions-over/87077)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 1\
**Last updated:** [September 11, 2022, 1:06pm UTC](https://discourse.julialang.org/t/is-the-manual-register-of-new-versions-over/87077 "2022-09-11T13:06:51Z")

</div>

Hi, I’ve, been trying to register a new version of GMT since 29 July. The automatic register fails due to the known libstdc++ issue ERROR: LoadError: could not load library "/tmp/jl\_C4sfbH/conda/3/lib/libgmt.so" /opt/h…

---

## [Unable to download Julia 1.8.1](https://discourse.julialang.org/t/unable-to-download-julia-1-8-1/87027)

<div class="topic-metadata">

**Author:** [@vector](https://discourse.julialang.org/u/vector)\
**Replies:** 21\
**Last updated:** [September 11, 2022, 11:26am UTC](https://discourse.julialang.org/t/unable-to-download-julia-1-8-1/87027 "2022-09-11T11:26:00Z")

</div>

I am unable to download Julia 1.8.1. Clicking on the link just keeps waiting. Julia documentation is also not available as a pdf download.

---

## [Compiling Julia to C/C++ or small executable file](https://discourse.julialang.org/t/compiling-julia-to-c-c-or-small-executable-file/86949)

<div class="topic-metadata">

**Author:** [@Bardo](https://discourse.julialang.org/u/Bardo)\
**Replies:** 4\
**Last updated:** [September 11, 2022, 10:16am UTC](https://discourse.julialang.org/t/compiling-julia-to-c-c-or-small-executable-file/86949 "2022-09-11T10:16:41Z")

</div>

My programs often use complex intermediate data structures and algorithms (databases, rule-based transforms, symbolic math, simplifications, …). Their results are rather simple, to be included or embedded in other C/C++…

---

## [How to call a vector of functions?](https://discourse.julialang.org/t/how-to-call-a-vector-of-functions/87064)

<div class="topic-metadata">

**Author:** [@photor](https://discourse.julialang.org/u/photor)\
**Replies:** 5\
**Last updated:** [September 11, 2022, 9:04am UTC](https://discourse.julialang.org/t/how-to-call-a-vector-of-functions/87064 "2022-09-11T09:04:17Z")

</div>

julia\> f(x)=x^2 f (generic function with 1 method) julia\> g(x)=x+1 g (generic function with 1 method) julia\> \[f,g\](3) ERROR: MethodError: objects of type Vector{Function} are not callable Use square brackets \[\] for ind…

---

## [Getting generated\_quantities from optimization result in Turing.jl](https://discourse.julialang.org/t/getting-generated-quantities-from-optimization-result-in-turing-jl/87025)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 3\
**Last updated:** [September 10, 2022, 11:45pm UTC](https://discourse.julialang.org/t/getting-generated-quantities-from-optimization-result-in-turing-jl/87025 "2022-09-10T23:45:41Z")

</div>

Suppose I optimize my Turing model to get some kind of reasonable parameter values… Is there a way to get the generated\_quantities? mapest = optimize(mymodel,MAP()) gen\_quant = ???

---

## [JuliaCall and SimpleChains not working together](https://discourse.julialang.org/t/juliacall-and-simplechains-not-working-together/86978)

<div class="topic-metadata">

**Author:** [@marcobonici](https://discourse.julialang.org/u/marcobonici)\
**Replies:** 8\
**Last updated:** [September 10, 2022, 9:12pm UTC](https://discourse.julialang.org/t/juliacall-and-simplechains-not-working-together/86978 "2022-09-10T21:12:28Z")

</div>

Hi, I have been working on a surrogate model, based on SimpleChains NNs, and I am quite satisfied with the performance. from juliacall import Main as jl jl.seval(“using Capse”) jl.seval(“using SimpleChains”) Since…

---

## [Julia autodiff result exporting to Fortran](https://discourse.julialang.org/t/julia-autodiff-result-exporting-to-fortran/87053)

<div class="topic-metadata">

**Author:** [@congUoM](https://discourse.julialang.org/u/congUoM)\
**Replies:** 2\
**Last updated:** [September 10, 2022, 9:11pm UTC](https://discourse.julialang.org/t/julia-autodiff-result-exporting-to-fortran/87053 "2022-09-10T21:11:16Z")

</div>

Hi all, I am working on an optimization problem in Fortran and I need a gradient of a function. Fortran does not have a good autodiff library so I am thinking of writing the Fortran function in Julia, using Julia autodi…

---

## [Why the Project Activated in Jupyter Notebook Does Not Change?](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 5\
**Last updated:** [September 10, 2022, 8:56am UTC](https://discourse.julialang.org/t/why-the-project-activated-in-jupyter-notebook-does-not-change/87032 "2022-09-10T08:56:17Z")

</div>

Hi all, I know to start a new clean environment / project is by typing this in a terminal: julia --project="." So when I do that in different folder and check with: julia\> \] pkg\> st the packages will be different f…

---

## [Help understanding when .= allocates](https://discourse.julialang.org/t/help-understanding-when-allocates/87009)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 9\
**Last updated:** [September 10, 2022, 8:47am UTC](https://discourse.julialang.org/t/help-understanding-when-allocates/87009 "2022-09-10T08:47:49Z")

</div>

I could use help understanding the magic of allocations in Julia with the inplace .= operation. Below I have 4 ways to write the same operation, but allocations are different for each. Only the first doesn’t allocate. My…

---

## [Precompile error on Windows](https://discourse.julialang.org/t/precompile-error-on-windows/87026)

<div class="topic-metadata">

**Author:** [@mkoculak](https://discourse.julialang.org/u/mkoculak)\
**Replies:** 0\
**Last updated:** [September 10, 2022, 1:14am UTC](https://discourse.julialang.org/t/precompile-error-on-windows/87026 "2022-09-10T01:14:55Z")

</div>

Since last week I am encountering problems with precompilation - with language server on VSCode and with packages in projects. Seems to be the same issue as here, although it seems it should have been fixed. For me, th…

---

## [@unpack with Parameters.jl when key is not found](https://discourse.julialang.org/t/unpack-with-parameters-jl-when-key-is-not-found/60716)

<div class="topic-metadata">

**Author:** [@gregory](https://discourse.julialang.org/u/gregory)\
**Replies:** 12\
**Last updated:** [September 9, 2022, 10:28pm UTC](https://discourse.julialang.org/t/unpack-with-parameters-jl-when-key-is-not-found/60716 "2022-09-09T22:28:43Z")

</div>

Hi, is there an easy way to have Parameters.jl skip missing keys or fields? using Parameters mydict = Dict(a=\>3,b=\>2.3,c=\>"mystr") @unpack (a,b,c,d) = mydict ERROR: KeyError: key "d" not found I would like it to just s…

---

## [Multithreading in many nested loops](https://discourse.julialang.org/t/multithreading-in-many-nested-loops/87017)

<div class="topic-metadata">

**Author:** [@Jonas208](https://discourse.julialang.org/u/Jonas208)\
**Replies:** 1\
**Last updated:** [September 9, 2022, 9:46pm UTC](https://discourse.julialang.org/t/multithreading-in-many-nested-loops/87017 "2022-09-09T21:46:13Z")

</div>

I am trying to optimize a function which performs a convolution-operation known from neuronal networks. I have already tried to optimize the function as much as possible (e.g. code\_warntype etc.), now I would like to gi…

---

## [Advice on rank-hot (thermometer) encoding of categorical variables](https://discourse.julialang.org/t/advice-on-rank-hot-thermometer-encoding-of-categorical-variables/87007)

<div class="topic-metadata">

**Author:** [@opera\_malenky](https://discourse.julialang.org/u/opera_malenky)\
**Replies:** 3\
**Last updated:** [September 9, 2022, 7:38pm UTC](https://discourse.julialang.org/t/advice-on-rank-hot-thermometer-encoding-of-categorical-variables/87007 "2022-09-09T19:38:54Z")

</div>

As the title says, I was interested in trying to play around with rank-hot encoding for ordinal data (sometimes also called thermometer encoding). It’s like one-hot, but instead of a single 1 in the position associated …

---

## [How to convert Vector{Array{T,N}} to Array{T,N+1}](https://discourse.julialang.org/t/how-to-convert-vector-array-t-n-to-array-t-n-1/87004)

<div class="topic-metadata">

**Author:** [@ChiMaoShuPhy](https://discourse.julialang.org/u/ChiMaoShuPhy)\
**Replies:** 6\
**Last updated:** [September 9, 2022, 7:32pm UTC](https://discourse.julialang.org/t/how-to-convert-vector-array-t-n-to-array-t-n-1/87004 "2022-09-09T19:32:03Z")

</div>

Is there any way (without using third party packages) to convert a vector of multi-dimensional array to multidimensional array, such as convert \[T\_1,T\_2,...,T\_q\] (each T\_i is a multi-dimensional array of type Array{T,3},…

---

## [Using Optim.jl with only\_fg!, what is the "Function value" that prints in the trace?](https://discourse.julialang.org/t/using-optim-jl-with-only-fg-what-is-the-function-value-that-prints-in-the-trace/87013)

<div class="topic-metadata">

**Author:** [@pluie](https://discourse.julialang.org/u/pluie)\
**Replies:** 0\
**Last updated:** [September 9, 2022, 7:14pm UTC](https://discourse.julialang.org/t/using-optim-jl-with-only-fg-what-is-the-function-value-that-prints-in-the-trace/87013 "2022-09-09T19:14:23Z")

</div>

I am trying to execute the following optimization. res = optimize( Optim.only\_fg!((F, G, Az)-\>fg!(F,G,first(Az),x,z)), \[100000.0\],\[500000.0\],\[400000.0\],Fminbox(GradientDescent()),Optim.Options(iterations=10,show\_trace=t…

---

## [Package to compute dominators in a DAG (directed acyclic graph)](https://discourse.julialang.org/t/package-to-compute-dominators-in-a-dag-directed-acyclic-graph/86617)

<div class="topic-metadata">

**Author:** [@brianguenter](https://discourse.julialang.org/u/brianguenter)\
**Replies:** 2\
**Last updated:** [September 9, 2022, 6:17pm UTC](https://discourse.julialang.org/t/package-to-compute-dominators-in-a-dag-directed-acyclic-graph/86617 "2022-09-09T18:17:44Z")

</div>

Is there a Julia package for DAG’s that supports these operations: dominator, postdominator, preorderdfs, postorderdfs? AbstractTrees looks like it only works for trees not DAG’s (big surprise) and the few graph package…

---

## [How to plot this diagram?](https://discourse.julialang.org/t/how-to-plot-this-diagram/86990)

<div class="topic-metadata">

**Author:** [@Raymond](https://discourse.julialang.org/u/Raymond)\
**Replies:** 2\
**Last updated:** [September 9, 2022, 5:24pm UTC](https://discourse.julialang.org/t/how-to-plot-this-diagram/86990 "2022-09-09T17:24:25Z")

</div>

Can Julia plot this kind of graph?

---

## [Why more BLAS threads take more time](https://discourse.julialang.org/t/why-more-blas-threads-take-more-time/86975)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 2\
**Last updated:** [September 9, 2022, 4:14pm UTC](https://discourse.julialang.org/t/why-more-blas-threads-take-more-time/86975 "2022-09-09T16:14:35Z")

</div>

Hi, I wrote a deep learning model using MNIST data and when I ran it on PC and server respectively, I encountered some performance issues. More details are listed below. About the devices I’m using. the PC have 1 phy…

---

## [Fast small integer matrix multiplication](https://discourse.julialang.org/t/fast-small-integer-matrix-multiplication/86981)

<div class="topic-metadata">

**Author:** [@Fabrice\_Rosay](https://discourse.julialang.org/u/Fabrice_Rosay)\
**Replies:** 11\
**Last updated:** [September 9, 2022, 3:03pm UTC](https://discourse.julialang.org/t/fast-small-integer-matrix-multiplication/86981 "2022-09-09T15:03:38Z")

</div>

Hi, I need to multiply a lot of times a vector B of integers of size 64 by a 24x64 integer matrix B. Currently the fastest way I found is simply A\*B, which is very fast if the matrix are converted to Float32 (which I’d…

---

## [Finishing a task](https://discourse.julialang.org/t/finishing-a-task/86784)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 5\
**Last updated:** [September 9, 2022, 2:41pm UTC](https://discourse.julialang.org/t/finishing-a-task/86784 "2022-09-09T14:41:13Z")

</div>

If I’m manipulating tasks with yieldto, without the scheduler, when a task finishes it just hangs the REPL (i.e. yieldto(@task 1+1) hangs). So I have to yieldto back to the main task at the end (or is there some other wa…

---

## [Why I can't connect 2 complex dots using plot(\[z1\],\[z2\]...)?](https://discourse.julialang.org/t/why-i-cant-connect-2-complex-dots-using-plot-z1-z2/86986)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [September 9, 2022, 1:54pm UTC](https://discourse.julialang.org/t/why-i-cant-connect-2-complex-dots-using-plot-z1-z2/86986 "2022-09-09T13:54:32Z")

</div>

Hi all, I try this code: using Plots, LaTeXStrings z1 = 4+2im z2 = 4-2im z3 = z1+z2 z4 = z1-z2 plot(\[z1\], framestyle = :zerolines, label=L"z = 4 + 2i"; st=:scatter, legend=:outerright) plot!(\[z2\], label=L"z = 4 - 2i"…

---

## [ComplexRegions.jl Package to plot complex plot z = a +ib](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 9\
**Last updated:** [September 9, 2022, 1:36pm UTC](https://discourse.julialang.org/t/complexregions-jl-package-to-plot-complex-plot-z-a-ib/86982 "2022-09-09T13:36:43Z")

</div>

Hi all, I am trying to add this package: ComplexRegions.jl then it comes: I want to plot a simple complex equation like: z = 3 -i But I can’t even add the package, due to some restriction / problem with Colors pa…

---

## [Generate type specific code when type is a variable in a loop](https://discourse.julialang.org/t/generate-type-specific-code-when-type-is-a-variable-in-a-loop/86947)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 12\
**Last updated:** [September 9, 2022, 12:58pm UTC](https://discourse.julialang.org/t/generate-type-specific-code-when-type-is-a-variable-in-a-loop/86947 "2022-09-09T12:58:35Z")

</div>

I have a package where I have a growing amount of types that contain each a specific type of data. Each type follows a minimal interface described by : A container number Cnum A description Cdescription Each type C…

---

## [~7x compliation time regression in the following data reading code](https://discourse.julialang.org/t/7x-compliation-time-regression-in-the-following-data-reading-code/86951)

<div class="topic-metadata">

**Author:** [@artemsolod](https://discourse.julialang.org/u/artemsolod)\
**Replies:** 6\
**Last updated:** [September 9, 2022, 12:11pm UTC](https://discourse.julialang.org/t/7x-compliation-time-regression-in-the-following-data-reading-code/86951 "2022-09-09T12:11:46Z")

</div>

I noticed a big regression in my data reading code (read csv.zip files from a folder). Stripping it down I get significant time difference between 1.7.3 and 1.8.0. This setup is quite fragile, for example, DataFrames is…

---

## [Julia debugging](https://discourse.julialang.org/t/julia-debugging/86512)

<div class="topic-metadata">

**Author:** [@AbhimanyuAryan](https://discourse.julialang.org/u/AbhimanyuAryan)\
**Replies:** 4\
**Last updated:** [August 30, 2022, 4:04pm UTC](https://discourse.julialang.org/t/julia-debugging/86512 "2022-08-30T16:04:37Z")

</div>

Can someone point me into Julia’s VSCode debugging Guide/Tutorial(if possible a video tutorial) like C++ in Visual Studio? I want to run the script and step out, step in, and set breakpoints. See values of variables etc …

---

## [High memory usage in v1.8.0 vs v1.7.2](https://discourse.julialang.org/t/high-memory-usage-in-v1-8-0-vs-v1-7-2/86559)

<div class="topic-metadata">

**Author:** [@fastwave](https://discourse.julialang.org/u/fastwave)\
**Replies:** 2\
**Last updated:** [September 9, 2022, 8:54am UTC](https://discourse.julialang.org/t/high-memory-usage-in-v1-8-0-vs-v1-7-2/86559 "2022-09-09T08:54:09Z")

</div>

I have a calculation that runs over two days. The memory usage stays below 3GB when using 1.7.2, but grows very slowly to over 30GB in 1.8.0 until the OOM killer terminates julia. It takes about a day to get there though…

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

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