# General Usage

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

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

**Page:** 390

---

## [Shiny-like interactive plots](https://discourse.julialang.org/t/shiny-like-interactive-plots/88034)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 4\
**Last updated:** [September 30, 2022, 1:30pm UTC](https://discourse.julialang.org/t/shiny-like-interactive-plots/88034 "2022-09-30T13:30:38Z")

</div>

I would like to put together an interactive exploration for moments of an economic model. The basic idea is that the user tweaks 4-10 parameters via sliders, and then a bunch of plots are generated accordingly. Good, cl…

---

## [Stem plots y-values expressed in dB / moving xaxis to a negative value](https://discourse.julialang.org/t/stem-plots-y-values-expressed-in-db-moving-xaxis-to-a-negative-value/87934)

<div class="topic-metadata">

**Author:** [@ellocco](https://discourse.julialang.org/u/ellocco)\
**Replies:** 1\
**Last updated:** [September 30, 2022, 7:08am UTC](https://discourse.julialang.org/t/stem-plots-y-values-expressed-in-db-moving-xaxis-to-a-negative-value/87934 "2022-09-30T07:08:58Z")

</div>

I would like to move the x-axis to a negative value and would like to have stem lines starting from the x-axis upwards, how can this be realized? Below a snippet that does not yet what I would like to achieve :frowning: …

---

## [How to compute hessian of simulated mle](https://discourse.julialang.org/t/how-to-compute-hessian-of-simulated-mle/87998)

<div class="topic-metadata">

**Author:** [@structural](https://discourse.julialang.org/u/structural)\
**Replies:** 7\
**Last updated:** [September 30, 2022, 11:13am UTC](https://discourse.julialang.org/t/how-to-compute-hessian-of-simulated-mle/87998 "2022-09-30T11:13:45Z")

</div>

I need to estimate parameters (a,b) and their corresponding standard errors using simulated MLE. I can successfully estimate the parameters, but I fail to get the SEs. In particular, when I try to obtain the hessian from…

---

## [Given a function with only one method, how to determine the number of arguments that it accepts?](https://discourse.julialang.org/t/given-a-function-with-only-one-method-how-to-determine-the-number-of-arguments-that-it-accepts/88030)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 2\
**Last updated:** [September 30, 2022, 10:59am UTC](https://discourse.julialang.org/t/given-a-function-with-only-one-method-how-to-determine-the-number-of-arguments-that-it-accepts/88030 "2022-09-30T10:59:55Z")

</div>

And would it be possible to determine this statically? An example of what I want julia\> f = x -\> x #5 (generic function with 1 method) julia\> applicable(f, 0) true julia\> applicable(f, 0, 0) false From this, I may d…

---

## [GR doesn't work in Julia](https://discourse.julialang.org/t/gr-doesnt-work-in-julia/88022)

<div class="topic-metadata">

**Author:** [@KotaAihara](https://discourse.julialang.org/u/KotaAihara)\
**Replies:** 10\
**Last updated:** [September 30, 2022, 10:09am UTC](https://discourse.julialang.org/t/gr-doesnt-work-in-julia/88022 "2022-09-30T10:09:21Z")

</div>

I need some help. I am using gr backend but it doesn’t work with the error using Plots x = 1:10; y = rand(10); # These are the plotting data import Pkg ENV\["GRDIR"\]="" Pkg.build("GR") gr() plot(x, y, title = "Two Lin…

---

## [Plotting a direction field of a differential equation](https://discourse.julialang.org/t/plotting-a-direction-field-of-a-differential-equation/87921)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 5\
**Last updated:** [September 30, 2022, 9:49am UTC](https://discourse.julialang.org/t/plotting-a-direction-field-of-a-differential-equation/87921 "2022-09-30T09:49:37Z")

</div>

Hi all, I have read similar title on this discourse, none of them in my opinion help to plot a direction field. The one above is really great, too bad the code does not work… and the link is unreachable again for Mak…

---

## [Shuffle a part of an array](https://discourse.julialang.org/t/shuffle-a-part-of-an-array/87982)

<div class="topic-metadata">

**Author:** [@nethaji8](https://discourse.julialang.org/u/nethaji8)\
**Replies:** 4\
**Last updated:** [September 30, 2022, 9:47am UTC](https://discourse.julialang.org/t/shuffle-a-part-of-an-array/87982 "2022-09-30T09:47:27Z")

</div>

Hi everyone, I am new to julia, can someone please let me know how to shuffle a part of an array in julia using the shuffle function…? using Random A=collect(1:10) shuffle!(A\[1:9\]) println(A\[1:9\]) shuffle!(A) printl…

---

## [Subtleties Around Environment Variable JULIA\_BINDIR](https://discourse.julialang.org/t/subtleties-around-environment-variable-julia-bindir/88028)

<div class="topic-metadata">

**Author:** [@Guanglin\_Du](https://discourse.julialang.org/u/Guanglin_Du)\
**Replies:** 0\
**Last updated:** [September 30, 2022, 9:13am UTC](https://discourse.julialang.org/t/subtleties-around-environment-variable-julia-bindir/88028 "2022-09-30T09:13:11Z")

</div>

The Running Configuration An LXC container instance based on Ubuntu 22.04 (Jammy) with Oh-my-zsh installed. lsb\_release -a No LSB modules are available. Distributor ID: Ubuntu Description: Ubuntu 22.04 LTS Release…

---

## [Monitoring the stack](https://discourse.julialang.org/t/monitoring-the-stack/88026)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 0\
**Last updated:** [September 30, 2022, 8:25am UTC](https://discourse.julialang.org/t/monitoring-the-stack/88026 "2022-09-30T08:25:19Z")

</div>

I am getting a deterministic StackOverflowError, and I have so far not managed to reduce it to a MWE. One of my functions in the callstack uses an array comprehension, and when I replace it with a function where I expli…

---

## [Segmentation fault in embedded Julia](https://discourse.julialang.org/t/segmentation-fault-in-embedded-julia/87917)

<div class="topic-metadata">

**Author:** [@cariocecus](https://discourse.julialang.org/u/cariocecus)\
**Replies:** 9\
**Last updated:** [September 30, 2022, 6:27am UTC](https://discourse.julialang.org/t/segmentation-fault-in-embedded-julia/87917 "2022-09-30T06:27:16Z")

</div>

Dear Julia community, I am developing a Windows desktop application in C++ that uses functionality developed in Julia (v0.3). The application accesses calls Julia indirectly through a DLL, the implementation of which fo…

---

## [Posterior predictive distributions in Turing](https://discourse.julialang.org/t/posterior-predictive-distributions-in-turing/21781)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 6\
**Last updated:** [September 29, 2022, 10:28pm UTC](https://discourse.julialang.org/t/posterior-predictive-distributions-in-turing/21781 "2022-09-29T22:28:00Z")

</div>

I am using Turing and would like to create some posterior predictive distributions. In order to do this, I need to sample from the posterior distribution. I am wondering what is the best way to sample a set of parameters…

---

## [Exception access violation (only Julia 1.8 on Windows)](https://discourse.julialang.org/t/exception-access-violation-only-julia-1-8-on-windows/87781)

<div class="topic-metadata">

**Author:** [@andreasvarga](https://discourse.julialang.org/u/andreasvarga)\
**Replies:** 5\
**Last updated:** [September 29, 2022, 4:29pm UTC](https://discourse.julialang.org/t/exception-access-violation-only-julia-1-8-on-windows/87781 "2022-09-29T16:29:31Z")

</div>

I am using the Fortran 77 library SLICOT in my current project PeriodicSystems via the binary wrapper SLICOT\_jll automatically generated with the BinaryBuilder. Recently, versions of SLICOT\_jll have been generated for J…

---

## [Generate Temporary Environment like Pkg.test](https://discourse.julialang.org/t/generate-temporary-environment-like-pkg-test/87981)

<div class="topic-metadata">

**Author:** [@MatthijsCox](https://discourse.julialang.org/u/MatthijsCox)\
**Replies:** 3\
**Last updated:** [September 29, 2022, 3:03pm UTC](https://discourse.julialang.org/t/generate-temporary-environment-like-pkg-test/87981 "2022-09-29T15:03:29Z")

</div>

The Pkg.test documentation states: The tests are run by generating a temporary environment with only pkg and its (recursive) dependencies in it. I love this ability, it’s a entire setup and teardown of an environment, …

---

## [If new struct should implement show function to well print? otherwise it may cause error?](https://discourse.julialang.org/t/if-new-struct-should-implement-show-function-to-well-print-otherwise-it-may-cause-error/87983)

<div class="topic-metadata">

**Author:** [@xuanquansheng](https://discourse.julialang.org/u/xuanquansheng)\
**Replies:** 6\
**Last updated:** [September 29, 2022, 2:53pm UTC](https://discourse.julialang.org/t/if-new-struct-should-implement-show-function-to-well-print-otherwise-it-may-cause-error/87983 "2022-09-29T14:53:56Z")

</div>

I’ve recently been learning source codes of pkg FixedEffectModels. if false Xall = Combination(y, Xexo, Xendo, Z) else Xall = Combination(y, Xexo) println(typeof(Xall)) # it can been print println("Xal…

---

## [Approximate equality](https://discourse.julialang.org/t/approximate-equality/8952)

<div class="topic-metadata">

**Author:** [@mvhulten](https://discourse.julialang.org/u/mvhulten)\
**Replies:** 54\
**Last updated:** [September 29, 2022, 2:24pm UTC](https://discourse.julialang.org/t/approximate-equality/8952 "2022-09-29T14:24:45Z")

</div>

I read somewhere that the approximation binary operator (\\approx) checks if the number is within machine precision. Whatever it does exactly, it does not appear to behave consistently: julia\> ℯ^(-π\*im) -1.0 - 1.2246467…

---

## [Matrix Initialization with Lamba Expression Missing Dimensions](https://discourse.julialang.org/t/matrix-initialization-with-lamba-expression-missing-dimensions/87952)

<div class="topic-metadata">

**Author:** [@bigdio](https://discourse.julialang.org/u/bigdio)\
**Replies:** 3\
**Last updated:** [September 29, 2022, 1:36pm UTC](https://discourse.julialang.org/t/matrix-initialization-with-lamba-expression-missing-dimensions/87952 "2022-09-29T13:36:53Z")

</div>

a=\[1 2 3\]' b1=\[a a.^2 a.^3\] #withour lambda b2=\[a.^i for i in 1:3\] #with lambda @show b1,size(b1) @show b2,size(b2) ·········· b1 = \[1 1 1; 2 4 8; 3 9 27\] b2 = \[\[1; 2; 3;;\], \[1; 4; 9;;\], \[1; 8; 27;;\]\] (size(b1), size(b2)…

---

## [PyCall installation on macOS - M1](https://discourse.julialang.org/t/pycall-installation-on-macos-m1/87980)

<div class="topic-metadata">

**Author:** [@CompulsoryCoffee](https://discourse.julialang.org/u/CompulsoryCoffee)\
**Replies:** 1\
**Last updated:** [September 29, 2022, 1:12pm UTC](https://discourse.julialang.org/t/pycall-installation-on-macos-m1/87980 "2022-09-29T13:12:42Z")

</div>

Hi, I need to run sklearn.metrics library which is not available in Julia yet. I tried to run on my macbookpro M1 but I run into this issue: julia\> using PyCall Python path configuration: PYTHONHOME = ‘/Users/alexd…

---

## [Is it possible to access row index inside DataFramesMeta macros?](https://discourse.julialang.org/t/is-it-possible-to-access-row-index-inside-dataframesmeta-macros/87944)

<div class="topic-metadata">

**Author:** [@dispeduspo](https://discourse.julialang.org/u/dispeduspo)\
**Replies:** 2\
**Last updated:** [September 29, 2022, 10:08am UTC](https://discourse.julialang.org/t/is-it-possible-to-access-row-index-inside-dataframesmeta-macros/87944 "2022-09-29T10:08:55Z")

</div>

Is there a way to access current\_row\_index in the following snippet ? @with df begin fn.(:col, current\_row\_index) end

---

## [DrWatson.jl encoding a tuple of symbols with savename](https://discourse.julialang.org/t/drwatson-jl-encoding-a-tuple-of-symbols-with-savename/87965)

<div class="topic-metadata">

**Author:** [@bgctw](https://discourse.julialang.org/u/bgctw)\
**Replies:** 1\
**Last updated:** [September 29, 2022, 10:04am UTC](https://discourse.julialang.org/t/drwatson-jl-encoding-a-tuple-of-symbols-with-savename/87965 "2022-09-29T10:04:10Z")

</div>

I try encoding symbols with DrWatson.jl savename. The encoding works, but I have troubles getting the NamedTuple back from the encoded string, but only get MethodError on tryparse. using DrWatson slc = (site = :LUE, ta…

---

## [Autodiff-ing a function defined by the result of Roots.find\_zero fails](https://discourse.julialang.org/t/autodiff-ing-a-function-defined-by-the-result-of-roots-find-zero-fails/87753)

<div class="topic-metadata">

**Author:** [@joaovgranja](https://discourse.julialang.org/u/joaovgranja)\
**Replies:** 12\
**Last updated:** [September 29, 2022, 9:54am UTC](https://discourse.julialang.org/t/autodiff-ing-a-function-defined-by-the-result-of-roots-find-zero-fails/87753 "2022-09-29T09:54:52Z")

</div>

Hi all! I am trying to ForwardDiff a function that is defined by solving a non-linear equation that depends on parameters. The code below reproduces the error. It first redefines exp by solving log(x) - a = 0 using Roo…

---

## [Should Julia migrate from C to Zig? And Julia users that need C code with Julia?](https://discourse.julialang.org/t/should-julia-migrate-from-c-to-zig-and-julia-users-that-need-c-code-with-julia/87942)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 6\
**Last updated:** [September 29, 2022, 9:37am UTC](https://discourse.julialang.org/t/should-julia-migrate-from-c-to-zig-and-julia-users-that-need-c-code-with-julia/87942 "2022-09-29T09:37:31Z")

</div>

Yes, Zig hasn’t hit 1.0, but is usable. Zig supports all platforms Julia supports (all Julia tier 1 platforms are also tier 1 in Zig). Use Zig as a zero-dependency, drop-in C/C++ compiler that supports cross-compilati…

---

## [Is there a Julia library that can tidy html documents?](https://discourse.julialang.org/t/is-there-a-julia-library-that-can-tidy-html-documents/87970)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 0\
**Last updated:** [September 29, 2022, 8:44am UTC](https://discourse.julialang.org/t/is-there-a-julia-library-that-can-tidy-html-documents/87970 "2022-09-29T08:44:44Z")

</div>

I have Julia code that creates an html document, but this document is not valid. I can use the external program tidy to fix it, like this: ufechner@ubuntu:~/repos/LogFiles/data/2022-09-28$ tidy -m summary.html line 3 c…

---

## [How to get the parameter of a parameteric type wihtout looking at the fields](https://discourse.julialang.org/t/how-to-get-the-parameter-of-a-parameteric-type-wihtout-looking-at-the-fields/87967)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 0\
**Last updated:** [September 29, 2022, 8:13am UTC](https://discourse.julialang.org/t/how-to-get-the-parameter-of-a-parameteric-type-wihtout-looking-at-the-fields/87967 "2022-09-29T08:13:23Z")

</div>

I want to retrieve the parameter of a parametric type of an object. There are already several discussion on this, here or on SO, but I don’t want to look up at the object fields, as this would be application-specific, i…

---

## [Makie outline 3e](https://discourse.julialang.org/t/makie-outline-3e/87694)

<div class="topic-metadata">

**Author:** [@FedeClaudi](https://discourse.julialang.org/u/FedeClaudi)\
**Replies:** 6\
**Last updated:** [September 29, 2022, 6:46am UTC](https://discourse.julialang.org/t/makie-outline-3e/87694 "2022-09-29T06:46:05Z")

</div>

makie expert, need your help again. Is there away to obtain an “outline” effect like this? Specifically, in drawing a torus as a surface I’d like the outer edge and the inner “hole” to have an outline, similar to…

---

## [About the additional memory allocation that appears in the OMEinsum package](https://discourse.julialang.org/t/about-the-additional-memory-allocation-that-appears-in-the-omeinsum-package/87938)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 2\
**Last updated:** [September 29, 2022, 2:40am UTC](https://discourse.julialang.org/t/about-the-additional-memory-allocation-that-appears-in-the-omeinsum-package/87938 "2022-09-29T02:40:20Z")

</div>

julia\> using OMEinsum julia\> a=rand(1024,1024); julia\> b=rand(1024,1024,2); julia\> using BenchmarkTools julia\> @btime ein"xy,yzw-\>xzw"(a,b); 23.790 ms (77 allocations: 16.00 MiB) julia\> @btime ein"yx,yzw-\>xzw"(a,b…

---

## [Using LLVM intrinsic functions inside \`llvmcall\`](https://discourse.julialang.org/t/using-llvm-intrinsic-functions-inside-llvmcall/87955)

<div class="topic-metadata">

**Author:** [@matthias314](https://discourse.julialang.org/u/matthias314)\
**Replies:** 6\
**Last updated:** [September 28, 2022, 11:16pm UTC](https://discourse.julialang.org/t/using-llvm-intrinsic-functions-inside-llvmcall/87955 "2022-09-28T23:16:19Z")

</div>

I’m playing around with llvmcall. I can use LLVM IR instructions (like add), but I cannot get intrinsic functions (like @llvm.abs.i32) to work. From the post Debugging float SIMD Intrinsics via llvmcall I get the impress…

---

## [Matrix-vector product faster than matrix addition?](https://discourse.julialang.org/t/matrix-vector-product-faster-than-matrix-addition/87954)

<div class="topic-metadata">

**Author:** [@goerz](https://discourse.julialang.org/u/goerz)\
**Replies:** 5\
**Last updated:** [September 28, 2022, 11:04pm UTC](https://discourse.julialang.org/t/matrix-vector-product-faster-than-matrix-addition/87954 "2022-09-28T23:04:51Z")

</div>

I’m running some benchmarks, and to my surprize I’m finding adding two matrices much slower than a matrix-vector multiplication. The relevant benchmark code is this (see link for context): function benchmark\_mv\_vs\_mpm()…

---

## [Git-tree-sha1 for Artifacts.toml](https://discourse.julialang.org/t/git-tree-sha1-for-artifacts-toml/43879)

<div class="topic-metadata">

**Author:** [@NicholasWMRitchie](https://discourse.julialang.org/u/NicholasWMRitchie)\
**Replies:** 6\
**Last updated:** [September 28, 2022, 10:53pm UTC](https://discourse.julialang.org/t/git-tree-sha1-for-artifacts-toml/43879 "2022-09-28T22:53:54Z")

</div>

How is the git-tree-sha1 supposed to be calculated for artifacts? The instructions in UsingArtifacts don’t seem to produce the correct hash when the file I’m downloading is a “tar.gz” (either when I download the individ…

---

## [Why no Float type alias?](https://discourse.julialang.org/t/why-no-float-type-alias/87947)

<div class="topic-metadata">

**Author:** [@Nathan\_Boyer](https://discourse.julialang.org/u/Nathan_Boyer)\
**Replies:** 10\
**Last updated:** [September 28, 2022, 9:56pm UTC](https://discourse.julialang.org/t/why-no-float-type-alias/87947 "2022-09-28T21:56:31Z")

</div>

Why doesn’t Float alias to the machine bit size like Int? julia\> Int Int64 julia\> Float ERROR: UndefVarError: Float not defined

---

## [Is combinedims optimized for StaticArrays?](https://discourse.julialang.org/t/is-combinedims-optimized-for-staticarrays/87929)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 1\
**Last updated:** [September 28, 2022, 6:04pm UTC](https://discourse.julialang.org/t/is-combinedims-optimized-for-staticarrays/87929 "2022-09-28T18:04:33Z")

</div>

In other words, does it reallocate or does it use reinterpret?

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

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