# General Usage

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

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

**Page:** 341

---

## [How to scale all the vertices in a GeometryBasics.Mesh?](https://discourse.julialang.org/t/how-to-scale-all-the-vertices-in-a-geometrybasics-mesh/93153)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 5\
**Last updated:** [January 20, 2023, 1:37pm UTC](https://discourse.julialang.org/t/how-to-scale-all-the-vertices-in-a-geometrybasics-mesh/93153 "2023-01-20T13:37:24Z")

</div>

I’m attempting to port Steven De Keninck’s 3D slicer example application (listed here and demonstrated here) from JavaScript to Julia. The example application loads a 3D model of a bunny (from https://enkimute.github.io/…

---

## [Possible to save Differential Equation interpolation solution to a file?](https://discourse.julialang.org/t/possible-to-save-differential-equation-interpolation-solution-to-a-file/41308)

<div class="topic-metadata">

**Author:** [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Replies:** 8\
**Last updated:** [January 20, 2023, 10:42am UTC](https://discourse.julialang.org/t/possible-to-save-differential-equation-interpolation-solution-to-a-file/41308 "2023-01-20T10:42:46Z")

</div>

Hi again everyone, I’ve got another question… Using the DifferentialEquations package, the solutions aren’t just discrete lists of numbers for the function and its derivative, but it’s also an INTERPOLATION scheme which…

---

## [High performance vector/matrix/tensor linear algebra operations](https://discourse.julialang.org/t/high-performance-vector-matrix-tensor-linear-algebra-operations/88756)

<div class="topic-metadata">

**Author:** [@FireCrumb](https://discourse.julialang.org/u/FireCrumb)\
**Replies:** 9\
**Last updated:** [January 20, 2023, 9:12am UTC](https://discourse.julialang.org/t/high-performance-vector-matrix-tensor-linear-algebra-operations/88756 "2023-01-20T09:12:59Z")

</div>

Hi, I have vectors (say 20 of them) of the same size (say 256 Float64). Now I want to add two of them and put the result into the third one, with the index of which one given as input. TL;DR: what is the fastest way to…

---

## [Scaling of @threads for "embarrassingly parallel" problem](https://discourse.julialang.org/t/scaling-of-threads-for-embarrassingly-parallel-problem/92949)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 29\
**Last updated:** [January 20, 2023, 9:01am UTC](https://discourse.julialang.org/t/scaling-of-threads-for-embarrassingly-parallel-problem/92949 "2023-01-20T09:01:22Z")

</div>

I’m having a “trivially parallel” an “embarrassingly parallel” problem, where I’m running the following function: function map\_fidelity(potential\_depth\_values, separation\_time\_values; kwargs...) N = length(potentia…

---

## [How simple get vector from ranges?](https://discourse.julialang.org/t/how-simple-get-vector-from-ranges/5537)

<div class="topic-metadata">

**Author:** [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Replies:** 14\
**Last updated:** [January 20, 2023, 8:59am UTC](https://discourse.julialang.org/t/how-simple-get-vector-from-ranges/5537 "2023-01-20T08:59:38Z")

</div>

In Matlab I have vector and vector of ranges. a = \[10., 9., 8., 7., 6., 5., 4., 3., 2., 1.\] dr = \[1:2, 4:7\] If I want a new vector from ranges I will call. mo = a(dr) mo = 10 9 7 6 5 4 In J…

---

## [Wrapping C++ struct with libcxxwrap-julia](https://discourse.julialang.org/t/wrapping-c-struct-with-libcxxwrap-julia/92795)

<div class="topic-metadata">

**Author:** [@sunayana](https://discourse.julialang.org/u/sunayana)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 8:03am UTC](https://discourse.julialang.org/t/wrapping-c-struct-with-libcxxwrap-julia/92795 "2023-01-20T08:03:30Z")

</div>

Hello, I need some help with wrapping a C++ template struct (from richdem C++ library) into Julia such that it is seamlessly available in Julia to check values of and set values to. This is what I have so far: The tem…

---

## [How to do permutations with repetition?](https://discourse.julialang.org/t/how-to-do-permutations-with-repetition/93192)

<div class="topic-metadata">

**Author:** [@Name1](https://discourse.julialang.org/u/Name1)\
**Replies:** 5\
**Last updated:** [January 20, 2023, 4:34am UTC](https://discourse.julialang.org/t/how-to-do-permutations-with-repetition/93192 "2023-01-20T04:34:32Z")

</div>

Hi there, Looking to get some ideas on the best approach to doing permutations with repetition please. If I have an array with {x,y,z,…} distinct elements and want to generate all permutations to a length of N allowing …

---

## [Creating a custom Dict clone for formatted printing?](https://discourse.julialang.org/t/creating-a-custom-dict-clone-for-formatted-printing/92975)

<div class="topic-metadata">

**Author:** [@daharn](https://discourse.julialang.org/u/daharn)\
**Replies:** 2\
**Last updated:** [January 19, 2023, 11:54pm UTC](https://discourse.julialang.org/t/creating-a-custom-dict-clone-for-formatted-printing/92975 "2023-01-19T23:54:27Z")

</div>

I want to be able to print the key-value pairs from a Dict-like object in a certain formatted way. I see two ways to do this: Either write a my\_print(dct::Dict) function that does this and use a regular Dict to store th…

---

## [Export from REPL history to julia script?](https://discourse.julialang.org/t/export-from-repl-history-to-julia-script/59399)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 10\
**Last updated:** [January 19, 2023, 10:12pm UTC](https://discourse.julialang.org/t/export-from-repl-history-to-julia-script/59399 "2023-01-19T22:12:23Z")

</div>

Is it possible to save the REPL history as a valid julia script? Something like: \> a = 3 3 \> b = 5 5 \> a + b 8 \> REPL.save("myscript.jl") myscript.jl: # REPL history export # Date: 16.04.2021 a = 3 # 3 b = 5 # 5 a +…

---

## [Copy vs view of DataFrame column?](https://discourse.julialang.org/t/copy-vs-view-of-dataframe-column/93182)

<div class="topic-metadata">

**Author:** [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Replies:** 16\
**Last updated:** [January 19, 2023, 8:07pm UTC](https://discourse.julialang.org/t/copy-vs-view-of-dataframe-column/93182 "2023-01-19T20:07:05Z")

</div>

Hello, do you know an example in which a copy, df\[:,:a\], should be used instead of a view with df\[!,:a\]? Thanks !

---

## [How to handle an array of structures when embedding Julia in C](https://discourse.julialang.org/t/how-to-handle-an-array-of-structures-when-embedding-julia-in-c/18661)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 2\
**Last updated:** [January 19, 2023, 7:07pm UTC](https://discourse.julialang.org/t/how-to-handle-an-array-of-structures-when-embedding-julia-in-c/18661 "2023-01-19T19:07:53Z")

</div>

Hi! I have a function that returns an array of a structure. This function is called inside a C++ software using this code: jl\_value\_t \*filename = jl\_eval\_string("\\"amz1.tle\\""); jl\_array\_t \*array\_tle = (jl\_arr…

---

## [Continuous provision of current logs](https://discourse.julialang.org/t/continuous-provision-of-current-logs/93143)

<div class="topic-metadata">

**Author:** [@max](https://discourse.julialang.org/u/max)\
**Replies:** 5\
**Last updated:** [January 19, 2023, 6:38pm UTC](https://discourse.julialang.org/t/continuous-provision-of-current-logs/93143 "2023-01-19T18:38:43Z")

</div>

Hello all, I want to continuously provide the logs in a cloud instance that are the output in a long running processes (optimization problems). For this I tried to run asynchronously and also on a separate thread the fu…

---

## [LCOV -\> Cobertura format conversion](https://discourse.julialang.org/t/lcov-cobertura-format-conversion/93200)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 2\
**Last updated:** [January 19, 2023, 5:08pm UTC](https://discourse.julialang.org/t/lcov-cobertura-format-conversion/93200 "2023-01-19T17:08:27Z")

</div>

Hi all, I’ve been trying to figure how to show coverage results on a GitLab hosted project generated using Coverage.jl. I found that LocalCoverage.jl provides a way to convert the LCOV file to a Cobertura XML file reada…

---

## [How to tell ForwardDiff what i want it to do?](https://discourse.julialang.org/t/how-to-tell-forwarddiff-what-i-want-it-to-do/93167)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 8\
**Last updated:** [January 19, 2023, 4:13pm UTC](https://discourse.julialang.org/t/how-to-tell-forwarddiff-what-i-want-it-to-do/93167 "2023-01-19T16:13:48Z")

</div>

Hey, This is a follow up to this previous post where I was looking for the right derivatives of the gamma\_inc function. I found them. Now i am trying to tell ForwardDiff to use them… with issues. The function has two a…

---

## [How to convert wrapped matrix type of KeyedArray](https://discourse.julialang.org/t/how-to-convert-wrapped-matrix-type-of-keyedarray/93149)

<div class="topic-metadata">

**Author:** [@jtackm](https://discourse.julialang.org/u/jtackm)\
**Replies:** 3\
**Last updated:** [January 19, 2023, 3:09pm UTC](https://discourse.julialang.org/t/how-to-convert-wrapped-matrix-type-of-keyedarray/93149 "2023-01-19T15:09:18Z")

</div>

Say I have a KeyedArray wrapping a dense matrix: using AxisKeys, Random n = 100 A = KeyedArray(rand(0:1, n, n), dim1=\["a$i" for i in 1:n\], dim2=\["b$i" for i in 1:n\]) 2-dimensional KeyedArray(NamedDimsArray(...)) with k…

---

## [Pkg.update in Julia 1.5 uses github](https://discourse.julialang.org/t/pkg-update-in-julia-1-5-uses-github/44331)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 5\
**Last updated:** [January 19, 2023, 2:43pm UTC](https://discourse.julialang.org/t/pkg-update-in-julia-1-5-uses-github/44331 "2023-01-19T14:43:36Z")

</div>

When I Pkg.update in Julia 1.5, Pkg seems to still pull from github: (@v1.5) pkg\> up Updating registry at \`~/.julia/registries/General\` Updating git-repo \`https://github.com/JuliaRegistries/General\` Updating re…

---

## ["inline" variable in closure](https://discourse.julialang.org/t/inline-variable-in-closure/93213)

<div class="topic-metadata">

**Author:** [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Replies:** 2\
**Last updated:** [January 19, 2023, 2:22pm UTC](https://discourse.julialang.org/t/inline-variable-in-closure/93213 "2023-01-19T14:22:25Z")

</div>

I have a some function depending on an independent variable and some general parameters. In a simplified version f(a, x) = a + x where a is some complicated struct of parameters which I ideally would like to type only …

---

## [How do I import a module to another program](https://discourse.julialang.org/t/how-do-i-import-a-module-to-another-program/93197)

<div class="topic-metadata">

**Author:** [@dmtrung14](https://discourse.julialang.org/u/dmtrung14)\
**Replies:** 1\
**Last updated:** [January 19, 2023, 10:43am UTC](https://discourse.julialang.org/t/how-do-i-import-a-module-to-another-program/93197 "2023-01-19T10:43:26Z")

</div>

I am trying to import a module from another file to my program (i.e. my program and my module is not in the same folder) Can I do that or do I have to install my own package? If so, how can I do that? Thanks

---

## [Plot of Circle Revolution Around x and y axis with PyCall and PyPlot](https://discourse.julialang.org/t/plot-of-circle-revolution-around-x-and-y-axis-with-pycall-and-pyplot/93204)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 0\
**Last updated:** [January 19, 2023, 10:30am UTC](https://discourse.julialang.org/t/plot-of-circle-revolution-around-x-and-y-axis-with-pycall-and-pyplot/93204 "2023-01-19T10:30:28Z")

</div>

Hi all, I have this code in Python, using PyCall. The question is, are the revolution around the x and y axis correct (the 3-dimension object)? It looks not convincing for me: # Calculate the surface area of y = sqrt…

---

## [Removing row from GridLayout](https://discourse.julialang.org/t/removing-row-from-gridlayout/93196)

<div class="topic-metadata">

**Author:** [@Daniel\_Lewis](https://discourse.julialang.org/u/Daniel_Lewis)\
**Replies:** 5\
**Last updated:** [January 19, 2023, 9:49am UTC](https://discourse.julialang.org/t/removing-row-from-gridlayout/93196 "2023-01-19T09:49:35Z")

</div>

hi, I’m trying to create an interactive plot using GLMakie, one of the thing I’m doing is adding menus from which the user can choose the data to plot. Here is a simplified code which create the menus GridLayout: usin…

---

## [Double integration with hcubature slower than nested quadgk](https://discourse.julialang.org/t/double-integration-with-hcubature-slower-than-nested-quadgk/89943)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 8\
**Last updated:** [January 19, 2023, 9:27am UTC](https://discourse.julialang.org/t/double-integration-with-hcubature-slower-than-nested-quadgk/89943 "2023-01-19T09:27:34Z")

</div>

It is probably related to this topic this topic. I find the performances of HCubature.jl not intuitive. Lets take the following function as a test case for our MWE: internal(k,x) = exp(-x^2)\*sin(k\*x)^2 I tried perfor…

---

## [Can \`findmin\` use a counter if \`keys\` is not defined for an iterator?](https://discourse.julialang.org/t/can-findmin-use-a-counter-if-keys-is-not-defined-for-an-iterator/93069)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 12\
**Last updated:** [January 19, 2023, 7:45am UTC](https://discourse.julialang.org/t/can-findmin-use-a-counter-if-keys-is-not-defined-for-an-iterator/93069 "2023-01-19T07:45:30Z")

</div>

I want the index for which an iterator itr is minimized. I had expected \_, ind = findmin(f, itr) to return the index, but this doesn’t work if keys(itr) is not defined. What does work is: ind, \_ = argmin(((ind, v),) -\>…

---

## [\`@time\` output is a tiny bit noisy](https://discourse.julialang.org/t/time-output-is-a-tiny-bit-noisy/93113)

<div class="topic-metadata">

**Author:** [@tfiers](https://discourse.julialang.org/u/tfiers)\
**Replies:** 6\
**Last updated:** [January 19, 2023, 12:03am UTC](https://discourse.julialang.org/t/time-output-is-a-tiny-bit-noisy/93113 "2023-01-19T00:03:00Z")

</div>

Quick question, is there a mini-package that defines something like the following: using Printf macro time′(ex) # prime time # (saner name, e.g: htime, for 'human' time) quote t0 = time() $(…

---

## [Difference between df\[:, :a\] and df\[!, :a\]](https://discourse.julialang.org/t/difference-between-df-a-and-df-a/28561)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 6\
**Last updated:** [September 9, 2019, 3:18pm UTC](https://discourse.julialang.org/t/difference-between-df-a-and-df-a/28561 "2019-09-09T15:18:39Z")

</div>

I recently updated my DataFrames.jl package and noticed the following deprecation warning when doing df\[:a\]: Warning: \`getindex(df::DataFrame, col\_ind::ColumnIndex)\` is deprecated, use \`df\[!, col\_ind\]\` instead. I under…

---

## [Please help me with the meaning of dot and three dots (...) in this code line:](https://discourse.julialang.org/t/please-help-me-with-the-meaning-of-dot-and-three-dots-in-this-code-line/93170)

<div class="topic-metadata">

**Author:** [@Kianoush\_Ramezani\_sh](https://discourse.julialang.org/u/Kianoush_Ramezani_sh)\
**Replies:** 5\
**Last updated:** [January 18, 2023, 9:07pm UTC](https://discourse.julialang.org/t/please-help-me-with-the-meaning-of-dot-and-three-dots-in-this-code-line/93170 "2023-01-18T21:07:38Z")

</div>

(x → typeof(x)).(values(complexity\_of\_operators))…, Notes: complexity\_of\_operators is a dictionary I don’t know what the dot between the two parentheses means or what the … means at the end.

---

## [Static for loops](https://discourse.julialang.org/t/static-for-loops/93051)

<div class="topic-metadata">

**Author:** [@gtgt](https://discourse.julialang.org/u/gtgt)\
**Replies:** 7\
**Last updated:** [January 17, 2023, 3:12pm UTC](https://discourse.julialang.org/t/static-for-loops/93051 "2023-01-17T15:12:36Z")

</div>

I have a function f(::Val{m}) where m which I want to specialize to a few values. Can I do it in a for loop instead of writing all the specializations by hand? I tried for m in 1:3 f(Val(m)) end and for m in (1,…

---

## [Unable to precompile Plots](https://discourse.julialang.org/t/unable-to-precompile-plots/92848)

<div class="topic-metadata">

**Author:** [@HelloHelpp](https://discourse.julialang.org/u/HelloHelpp)\
**Replies:** 10\
**Last updated:** [January 18, 2023, 6:46pm UTC](https://discourse.julialang.org/t/unable-to-precompile-plots/92848 "2023-01-18T18:46:32Z")

</div>

Hi all, I am unable to precompile the package Plots due to the following error: The following remedies have been attempted but so far none have been successful: -Uninstalling and reinstalling Julia -Adding and buildi…

---

## [Median calculation performing better than expected](https://discourse.julialang.org/t/median-calculation-performing-better-than-expected/93174)

<div class="topic-metadata">

**Author:** [@Nino\_Rode](https://discourse.julialang.org/u/Nino_Rode)\
**Replies:** 3\
**Last updated:** [January 18, 2023, 6:19pm UTC](https://discourse.julialang.org/t/median-calculation-performing-better-than-expected/93174 "2023-01-18T18:19:43Z")

</div>

I have an “it works … why?” question. I hope this is the right place. I’m trying to learn to write julia code to have as good performance as possible (yes, I’m new with julia). Most of the time, I’m trying to reproduce …

---

## [Before upgrading Julia version for the first time: What happens with the packages in each local environment?](https://discourse.julialang.org/t/before-upgrading-julia-version-for-the-first-time-what-happens-with-the-packages-in-each-local-environment/93175)

<div class="topic-metadata">

**Author:** [@martinmestre](https://discourse.julialang.org/u/martinmestre)\
**Replies:** 0\
**Last updated:** [January 18, 2023, 5:56pm UTC](https://discourse.julialang.org/t/before-upgrading-julia-version-for-the-first-time-what-happens-with-the-packages-in-each-local-environment/93175 "2023-01-18T17:56:47Z")

</div>

Hi, first of all I would like to know the step by step procedure to upgrade Julia. I would also like to know what happens with the package versions I have in a local environment. How are them updated? If I keep older ju…

---

## [\`const\` syntax outside of \`struct\`](https://discourse.julialang.org/t/const-syntax-outside-of-struct/93173)

<div class="topic-metadata">

**Author:** [@thevolatilebit](https://discourse.julialang.org/u/thevolatilebit)\
**Replies:** 0\
**Last updated:** [January 18, 2023, 5:15pm UTC](https://discourse.julialang.org/t/const-syntax-outside-of-struct/93173 "2023-01-18T17:15:41Z")

</div>

Background: In Agents.jl, any agent type being made from calling @agent is mutable, but with Julia versions \>= 1.8 now we can specify particular fields as being const, which can help bring performance closer to immutabl…

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

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