# General Usage

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

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

**Page:** 355

---

## [A macro for pretty geometric algebra equations?](https://discourse.julialang.org/t/a-macro-for-pretty-geometric-algebra-equations/91664)

<div class="topic-metadata">

**Author:** [@g2g](https://discourse.julialang.org/u/g2g)\
**Replies:** 15\
**Last updated:** [December 17, 2022, 1:21pm UTC](https://discourse.julialang.org/t/a-macro-for-pretty-geometric-algebra-equations/91664 "2022-12-17T13:21:32Z")

</div>

The following slide is from Steven De Keninck’s presentation at SIBGAPI, an international conference annually promoted by the Special Interest Group on Computer Graphics and Image Processing (CEGRAPI) of the Brazilian Co…

---

## [Obtaining the type of the state object returned by Iterate](https://discourse.julialang.org/t/obtaining-the-type-of-the-state-object-returned-by-iterate/59190)

<div class="topic-metadata">

**Author:** [@Olof\_Salberger](https://discourse.julialang.org/u/Olof_Salberger)\
**Replies:** 4\
**Last updated:** [December 17, 2022, 12:15pm UTC](https://discourse.julialang.org/t/obtaining-the-type-of-the-state-object-returned-by-iterate/59190 "2022-12-17T12:15:35Z")

</div>

An issue I’ve run into is that if you have a container type T, in general it isn’t possible to obtain the type of state returned by iterate in the same way as you can get eltype(T) since there is no (let’s call it iterat…

---

## [Pluto.jl webcam available?](https://discourse.julialang.org/t/pluto-jl-webcam-available/44077)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 4\
**Last updated:** [December 17, 2022, 11:22am UTC](https://discourse.julialang.org/t/pluto-jl-webcam-available/44077 "2022-12-17T11:22:35Z")

</div>

@fonsp I have just wtched the JuliaCon presentation. Great! Loved the ‘random’ Skype call. I should steal this idea. May I ask about the webcam interface? Is it possible to trial this now? Sorry to Mikolaj - your handl…

---

## [How to Fill Specific Range of a Function with Layouts?](https://discourse.julialang.org/t/how-to-fill-specific-range-of-a-function-with-layouts/91732)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 6\
**Last updated:** [December 17, 2022, 9:52am UTC](https://discourse.julialang.org/t/how-to-fill-specific-range-of-a-function-with-layouts/91732 "2022-12-17T09:52:10Z")

</div>

Hi all, I want to fill the area under the function from 0 to 2 \\pi, it can be done easily if I only have layout of 1 plot just use plot!. The guide only show this and not very useful: fillrange = 1, fillalpha …

---

## [Accessing multiple values of a dictionary](https://discourse.julialang.org/t/accessing-multiple-values-of-a-dictionary/8648)

<div class="topic-metadata">

**Author:** [@lucatrv](https://discourse.julialang.org/u/lucatrv)\
**Replies:** 5\
**Last updated:** [December 17, 2022, 9:23am UTC](https://discourse.julialang.org/t/accessing-multiple-values-of-a-dictionary/8648 "2022-12-17T09:23:21Z")

</div>

The only way I found to access multiple values of a dictionary is: get.(dictionary, \["a", "b", "c"\], 0) I propose the following syntax: dictionary.\["a", "b", "c"\]

---

## [Using Plots storing as pdf,but the graph has changed](https://discourse.julialang.org/t/using-plots-storing-as-pdf-but-the-graph-has-changed/91762)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 1\
**Last updated:** [December 17, 2022, 6:11am UTC](https://discourse.julialang.org/t/using-plots-storing-as-pdf-but-the-graph-has-changed/91762 "2022-12-17T06:11:05Z")

</div>

using DataFrames,Plots d1=DataFrame(x=\[-0.3,-0.5,-0.1,0.8,0.2,-0.15,-0.2,0.5,0.9,-0.03\],y=\[0.8,0.9,1,2,3,4,5,6,7,8\]) p=Plots.plot(d1\[:,:x\],d1\[:,:y\], seriestype=:scatter,markersize = 4, xlabe…

---

## [Slowdown with reinterpret](https://discourse.julialang.org/t/slowdown-with-reinterpret/91749)

<div class="topic-metadata">

**Author:** [@dgleich](https://discourse.julialang.org/u/dgleich)\
**Replies:** 3\
**Last updated:** [December 16, 2022, 7:06pm UTC](https://discourse.julialang.org/t/slowdown-with-reinterpret/91749 "2022-12-16T19:06:47Z")

</div>

I hope I can be forgiven for being surprised at the starkly difference between these implementations. using BenchmarkTools function myfunc1(n::Int) x = Vector{Int}(undef, 3\*n) for i in eachindex(x) x\[i\] = i en…

---

## [Accelerate computation of derivatives of vector field?](https://discourse.julialang.org/t/accelerate-computation-of-derivatives-of-vector-field/91314)

<div class="topic-metadata">

**Author:** [@Michael](https://discourse.julialang.org/u/Michael)\
**Replies:** 12\
**Last updated:** [December 16, 2022, 6:47pm UTC](https://discourse.julialang.org/t/accelerate-computation-of-derivatives-of-vector-field/91314 "2022-12-16T18:47:52Z")

</div>

Hi everyone! I am trying to compute Lie brackets of two vector fields let us say F0 and F1. They’re in dimension 6 and I need brackets until length 5 (thus, derivative up to order 5). Unfortunately this is extremely sl…

---

## [Try-catch statement really slow even if catch is never executed](https://discourse.julialang.org/t/try-catch-statement-really-slow-even-if-catch-is-never-executed/91744)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 9\
**Last updated:** [December 16, 2022, 4:08pm UTC](https://discourse.julialang.org/t/try-catch-statement-really-slow-even-if-catch-is-never-executed/91744 "2022-12-16T16:08:09Z")

</div>

Consider the following functions that add the elements of a vector: slow(v) = begin s = v |\> eltype |\> zero for ele in v try s += ele catch rethrow() end end …

---

## [ERROR: MethodError: no method matching lu!](https://discourse.julialang.org/t/error-methoderror-no-method-matching-lu/91618)

<div class="topic-metadata">

**Author:** [@Amro](https://discourse.julialang.org/u/Amro)\
**Replies:** 14\
**Last updated:** [December 16, 2022, 4:00pm UTC](https://discourse.julialang.org/t/error-methoderror-no-method-matching-lu/91618 "2022-12-16T16:00:57Z")

</div>

Could you please help me to solve the error in my MWE (A,b,p,q are snipped from real code)? The error says the problem is with typeof(A\[p,q\]\[1:6,1:6) however its type is SparseMatrixCSC{Float64, Int64}. using SparseArra…

---

## [Nonblocking recvfrom?](https://discourse.julialang.org/t/nonblocking-recvfrom/77740)

<div class="topic-metadata">

**Author:** [@Tine](https://discourse.julialang.org/u/Tine)\
**Replies:** 10\
**Last updated:** [December 16, 2022, 2:51pm UTC](https://discourse.julialang.org/t/nonblocking-recvfrom/77740 "2022-12-16T14:51:59Z")

</div>

Hi, Is it a non-blocking alternative to recvfrom() ? My application consist of two threads, where one of them is listening on a socket for incoming packets. The other thread then sends a signal to this thread after x s…

---

## [Concatenating matrices with an empty matrix](https://discourse.julialang.org/t/concatenating-matrices-with-an-empty-matrix/91737)

<div class="topic-metadata">

**Author:** [@geo1093](https://discourse.julialang.org/u/geo1093)\
**Replies:** 2\
**Last updated:** [December 16, 2022, 2:35pm UTC](https://discourse.julialang.org/t/concatenating-matrices-with-an-empty-matrix/91737 "2022-12-16T14:35:37Z")

</div>

Hi, I wish to construct a matrix whose blocks depend on (a lot of) conditions. Since I don’t know the final size of my A matrix at the beginning or the first block to start with, I intend to delare it empty and then add…

---

## [Julia in VScode SSH : I have no "julia.executablePath" in settings.json](https://discourse.julialang.org/t/julia-in-vscode-ssh-i-have-no-julia-executablepath-in-settings-json/91729)

<div class="topic-metadata">

**Author:** [@sim](https://discourse.julialang.org/u/sim)\
**Replies:** 4\
**Last updated:** [December 16, 2022, 1:26pm UTC](https://discourse.julialang.org/t/julia-in-vscode-ssh-i-have-no-julia-executablepath-in-settings-json/91729 "2022-12-16T13:26:26Z")

</div>

Hi, I want to use Julia on VSCode through the extension RemoteSSH. Julia is well installed on the remote machine and I know the path of the executable. When launching VSCode on the remote, I get the error message Could…

---

## [How to Save MP4 with CairoMakie?](https://discourse.julialang.org/t/how-to-save-mp4-with-cairomakie/91691)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 7\
**Last updated:** [December 16, 2022, 12:44pm UTC](https://discourse.julialang.org/t/how-to-save-mp4-with-cairomakie/91691 "2022-12-16T12:44:35Z")

</div>

Hi all, from this topic: I want to save the animation in mp4 format, but I do not know is my code right? especially the last line to call the function as well: using CairoMakie, Meshes function sierpinski() # c…

---

## [Parameters.jl strange values in struct coming from dict](https://discourse.julialang.org/t/parameters-jl-strange-values-in-struct-coming-from-dict/91728)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 2\
**Last updated:** [December 16, 2022, 11:14am UTC](https://discourse.julialang.org/t/parameters-jl-strange-values-in-struct-coming-from-dict/91728 "2022-12-16T11:14:23Z")

</div>

I have a struct which I’d like one of the field to come from a dict, so I wrote this code using Parameters # v0.12.3 const D1 = Dict( "a"=\>30, "b"=\>15, "c"=\>18, ) @with\_kw mutable struct Struct1 name::…

---

## [Optimize with Fminbox. Can't find the way how to put tolerance and number of iterations](https://discourse.julialang.org/t/optimize-with-fminbox-cant-find-the-way-how-to-put-tolerance-and-number-of-iterations/91720)

<div class="topic-metadata">

**Author:** [@BMval](https://discourse.julialang.org/u/BMval)\
**Replies:** 3\
**Last updated:** [December 16, 2022, 10:42am UTC](https://discourse.julialang.org/t/optimize-with-fminbox-cant-find-the-way-how-to-put-tolerance-and-number-of-iterations/91720 "2022-12-16T10:42:01Z")

</div>

I am sorry for simmple questions. opt = optimize(loss, \[0.01\],\[0.05\], \[0.02\],Fminbox(LBFGS())); How to put tolerance and number of iterations. parameters x\_tol, g\_tol don’t work. thank you in advance.

---

## [R function \`duplicated\`](https://discourse.julialang.org/t/r-function-duplicated/91707)

<div class="topic-metadata">

**Author:** [@\_stla](https://discourse.julialang.org/u/_stla)\
**Replies:** 14\
**Last updated:** [December 16, 2022, 7:02am UTC](https://discourse.julialang.org/t/r-function-duplicated/91707 "2022-12-16T07:02:16Z")

</div>

Hello, For a vector v, the R function duplicated works as follows. The vector duplicated(v) has the same length as v, and its i-th element is false if and only if v\[i\] is the first occurence of v\[i\] in v. For example du…

---

## [Defining a global variable in a nested quote](https://discourse.julialang.org/t/defining-a-global-variable-in-a-nested-quote/91724)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 1\
**Last updated:** [December 16, 2022, 3:53am UTC](https://discourse.julialang.org/t/defining-a-global-variable-in-a-nested-quote/91724 "2022-12-16T03:53:10Z")

</div>

Suppose we have the following code: foo() = begin var\_name = gensym() is\_init\_var\_name = gensym() quote const $is\_init\_var\_name = Ref{Bool}(false) set\_val(x) = begin if $is\_init…

---

## [Using DataDeps for multiple files in multiple subdirectories](https://discourse.julialang.org/t/using-datadeps-for-multiple-files-in-multiple-subdirectories/91307)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 6\
**Last updated:** [December 16, 2022, 12:56am UTC](https://discourse.julialang.org/t/using-datadeps-for-multiple-files-in-multiple-subdirectories/91307 "2022-12-16T00:56:11Z")

</div>

For my package, I want to download some data upon the user’s request and store them locally for future usage. A bit of research seems to indicate that DataDeps.jl by @oxinabox is the package to use, but I’m not sure if …

---

## [Performance optimization of a custom binning function](https://discourse.julialang.org/t/performance-optimization-of-a-custom-binning-function/91616)

<div class="topic-metadata">

**Author:** [@alex-s-gardner](https://discourse.julialang.org/u/alex-s-gardner)\
**Replies:** 43\
**Last updated:** [December 15, 2022, 11:08pm UTC](https://discourse.julialang.org/t/performance-optimization-of-a-custom-binning-function/91616 "2022-12-15T23:08:36Z")

</div>

I’m looking for feedback on how I might be able to further optimize the below bin function. There are a couple of coding patterns that I’m curious to get feedback on, specifically my approach to internal array initializa…

---

## [Are temporaries created in one line functions that return the result of a broadcasted function?](https://discourse.julialang.org/t/are-temporaries-created-in-one-line-functions-that-return-the-result-of-a-broadcasted-function/91701)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 9\
**Last updated:** [December 15, 2022, 9:30pm UTC](https://discourse.julialang.org/t/are-temporaries-created-in-one-line-functions-that-return-the-result-of-a-broadcasted-function/91701 "2022-12-15T21:30:56Z")

</div>

Suppose I have fm\_residuals(pc, F) = signed\_dist.(pc,Ref(F)) and tst .= fm\_residuals(pc,F) Will a temporary be created for the signed distances in the scope of fm\_residuals or will the result be directly written into…

---

## [Default \`==\` for struct and mutability](https://discourse.julialang.org/t/default-for-struct-and-mutability/91711)

<div class="topic-metadata">

**Author:** [@Cyril](https://discourse.julialang.org/u/Cyril)\
**Replies:** 2\
**Last updated:** [December 15, 2022, 9:17pm UTC](https://discourse.julialang.org/t/default-for-struct-and-mutability/91711 "2022-12-15T21:17:12Z")

</div>

Hello, I was trying to understand how the default == function for user defined struct is working. I know it recursively calls === on all fields. Thus, my assumption was that for struct containing only immutable fields, …

---

## [Parallelize groupby combine](https://discourse.julialang.org/t/parallelize-groupby-combine/91710)

<div class="topic-metadata">

**Author:** [@jar1](https://discourse.julialang.org/u/jar1)\
**Replies:** 2\
**Last updated:** [December 15, 2022, 8:05pm UTC](https://discourse.julialang.org/t/parallelize-groupby-combine/91710 "2022-12-15T20:05:39Z")

</div>

For transform(df, cols =\> ByRow(f)) I can parallelize by replacing ByRow with a parallel map . Is it possible to parallelize combine(groupby(df, cols), ...) ?

---

## [Tail-call recursion](https://discourse.julialang.org/t/tail-call-recursion/87847)

<div class="topic-metadata">

**Author:** [@gbellomia](https://discourse.julialang.org/u/gbellomia)\
**Replies:** 41\
**Last updated:** [December 15, 2022, 7:38pm UTC](https://discourse.julialang.org/t/tail-call-recursion/87847 "2022-12-15T19:38:26Z")

</div>

Does Julia have tail call elimination? And how good it is implemented? To clarify: it really is a design choice somehow, strongly functional oriented or pure functional languages normally are really good at this, as recu…

---

## [What's a good way to add method to \`Base.MainInclude.eval\`?](https://discourse.julialang.org/t/whats-a-good-way-to-add-method-to-base-maininclude-eval/91697)

<div class="topic-metadata">

**Author:** [@iago-lito](https://discourse.julialang.org/u/iago-lito)\
**Replies:** 1\
**Last updated:** [December 15, 2022, 7:34pm UTC](https://discourse.julialang.org/t/whats-a-good-way-to-add-method-to-base-maininclude-eval/91697 "2022-12-15T19:34:38Z")

</div>

My module provides utilities to generate optimized code based on user input. For instance, a generate function returns values of type Expr, that the user is responsible to evaluate whenever they need: code, data = gene…

---

## [Unreliable computations on GPU with Flux](https://discourse.julialang.org/t/unreliable-computations-on-gpu-with-flux/91696)

<div class="topic-metadata">

**Author:** [@Avec](https://discourse.julialang.org/u/Avec)\
**Replies:** 1\
**Last updated:** [December 15, 2022, 4:09pm UTC](https://discourse.julialang.org/t/unreliable-computations-on-gpu-with-flux/91696 "2022-12-15T16:09:04Z")

</div>

Hi all, I have a problem with optimization of convolutional neural networks on GPU. I would like to run a couple of experiments from the same initial values of network parameters, but for some reason, when it is run on G…

---

## [How to Obtain the Final Numerical Result if The Integral is in Gamma function?](https://discourse.julialang.org/t/how-to-obtain-the-final-numerical-result-if-the-integral-is-in-gamma-function/91699)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 3\
**Last updated:** [December 15, 2022, 2:19pm UTC](https://discourse.julialang.org/t/how-to-obtain-the-final-numerical-result-if-the-integral-is-in-gamma-function/91699 "2022-12-15T14:19:48Z")

</div>

Hi all, I compute using this code: using SymPy integrate(3+ sin(x^2), (x, 0, 2)) The answer is not a single number, but a fraction with Gamma function, which should be able to be computed with Julia, but I do not kno…

---

## [Problem with boundary conditions in Gridap and GridapGmsh](https://discourse.julialang.org/t/problem-with-boundary-conditions-in-gridap-and-gridapgmsh/89658)

<div class="topic-metadata">

**Author:** [@rouckas](https://discourse.julialang.org/u/rouckas)\
**Replies:** 1\
**Last updated:** [December 15, 2022, 1:39pm UTC](https://discourse.julialang.org/t/problem-with-boundary-conditions-in-gridap-and-gridapgmsh/89658 "2022-12-15T13:39:25Z")

</div>

Dear all, I am trying to solve some 2D electrostatic problem (Poisson Equation) using Gripap.jl and gmsh for mesh generation. I solve for the potential in space bounded by conductors, which have surface potentials presc…

---

## [Error precompiling Plots: RecipesBase.jl:607 needs to be placed at the top level, or use "eval"](https://discourse.julialang.org/t/error-precompiling-plots-recipesbase-jl-607-needs-to-be-placed-at-the-top-level-or-use-eval/91694)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 7\
**Last updated:** [December 15, 2022, 12:56pm UTC](https://discourse.julialang.org/t/error-precompiling-plots-recipesbase-jl-607-needs-to-be-placed-at-the-top-level-or-use-eval/91694 "2022-12-15T12:56:22Z")

</div>

Any hint on how to solve this precompilation problem? I’m using an environment and all the packages seem up to date. precompile Precompiling project... ✗ Plots 0 dependencies successfully precompiled in 2 seconds. 1…

---

## [Why I can't plot the integral function with SymPy and Plots?](https://discourse.julialang.org/t/why-i-cant-plot-the-integral-function-with-sympy-and-plots/91690)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 7\
**Last updated:** [December 15, 2022, 11:50am UTC](https://discourse.julialang.org/t/why-i-cant-plot-the-integral-function-with-sympy-and-plots/91690 "2022-12-15T11:50:50Z")

</div>

Hi all, I have this simple integral function: \\int (5 + \\sin \\ x)^{4} \\ dx and I want to plot the integral function above so I use this code: using SymPy, Plots f(x) = integrate((5 + sin(x))^4) plot(f) but it gets…

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

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