# General Usage

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

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

**Page:** 160

---

## [Plotting a mark in gr()](https://discourse.julialang.org/t/plotting-a-mark-in-gr/115642)

<div class="topic-metadata">

**Author:** [@angeloaliano1](https://discourse.julialang.org/u/angeloaliano1)\
**Replies:** 1\
**Last updated:** [June 14, 2024, 2:42pm UTC](https://discourse.julialang.org/t/plotting-a-mark-in-gr/115642 "2024-06-14T14:42:56Z")

</div>

Dear all, I have the simple code in to plot two set of points: using Plots gr(size = (1500, 1000),fmt=:png,ylims=(0,100), xlims=(0,100)) as = rand(1:100,100,2) scatter(as\[1:50,1\], as\[1:50,2\],mc=:blue,ms=8,msw=0,marker…

---

## [Calling database functions when using Octo.jl](https://discourse.julialang.org/t/calling-database-functions-when-using-octo-jl/114044)

<div class="topic-metadata">

**Author:** [@suvayu](https://discourse.julialang.org/u/suvayu)\
**Replies:** 5\
**Last updated:** [June 13, 2024, 7:18pm UTC](https://discourse.julialang.org/t/calling-database-functions-when-using-octo-jl/114044 "2024-06-13T19:18:14Z")

</div>

I’m trying out Octo.jl with DuckDB. I managed to connect to an existing file and query a table there. julia\> import DataFrames as DF; julia\> using Octo.Adapters.DuckDB julia\> con = Repo.connect(adapter=Octo.Adapters.D…

---

## [Latex matrix in Makie](https://discourse.julialang.org/t/latex-matrix-in-makie/115608)

<div class="topic-metadata">

**Author:** [@VictorSeven](https://discourse.julialang.org/u/VictorSeven)\
**Replies:** 3\
**Last updated:** [June 14, 2024, 2:05pm UTC](https://discourse.julialang.org/t/latex-matrix-in-makie/115608 "2024-06-14T14:05:14Z")

</div>

Hi, I’m trying to show a matrix in Makie, via text!. Latex in general works well, but when I try to plot the matrix text!(ax, pos; text=L"\\begin{pmatrix} 1 & 2 \\\\ 3 & 4\\end{pmatrix}") I receive an error ERROR: LoadEr…

---

## [How to detect/avoid type piracy?](https://discourse.julialang.org/t/how-to-detect-avoid-type-piracy/114588)

<div class="topic-metadata">

**Author:** [@vvbond](https://discourse.julialang.org/u/vvbond)\
**Replies:** 77\
**Last updated:** [June 14, 2024, 9:32am UTC](https://discourse.julialang.org/t/how-to-detect-avoid-type-piracy/114588 "2024-06-14T09:32:29Z")

</div>

Ouch, it seems I’ve been bitten by the correctness issue in its following manifestation: My package overloads the Base.split() for (::AbstractVector, ::Integer). Unit tests pass, scripts/REPL work correctly. However, …

---

## [Trying PackageCompiler.jl lib example on Python](https://discourse.julialang.org/t/trying-packagecompiler-jl-lib-example-on-python/115492)

<div class="topic-metadata">

**Author:** [@el-analista](https://discourse.julialang.org/u/el-analista)\
**Replies:** 5\
**Last updated:** [June 14, 2024, 2:33am UTC](https://discourse.julialang.org/t/trying-packagecompiler-jl-lib-example-on-python/115492 "2024-06-14T02:33:38Z")

</div>

Hey there, I am testing PackageCompiler with the examples in the repo. I am able to compile the library correctly following the documentation but then when I try to use it in Python with the following code I just get s…

---

## [\`if foo isa Foo{K} where K; @show K; end\`: \`K\` not defined](https://discourse.julialang.org/t/if-foo-isa-foo-k-where-k-show-k-end-k-not-defined/115572)

<div class="topic-metadata">

**Author:** [@maxkapur](https://discourse.julialang.org/u/maxkapur)\
**Replies:** 3\
**Last updated:** [June 13, 2024, 10:23pm UTC](https://discourse.julialang.org/t/if-foo-isa-foo-k-where-k-show-k-end-k-not-defined/115572 "2024-06-13T22:23:24Z")

</div>

Is there a good way to make type parameters from the where keyword accessible in an if statement, the way we can with function signatures? \_ \_ \_ \_(\_)\_ | Documentation: https://docs.julialang…

---

## [How to define the product of n functions](https://discourse.julialang.org/t/how-to-define-the-product-of-n-functions/115615)

<div class="topic-metadata">

**Author:** [@empet](https://discourse.julialang.org/u/empet)\
**Replies:** 2\
**Last updated:** [June 13, 2024, 7:09pm UTC](https://discourse.julialang.org/t/how-to-define-the-product-of-n-functions/115615 "2024-06-13T19:09:54Z")

</div>

I want to define the product of n complex functions: B(z)=\\displaystyle\\prod\_{k=1}^n\\frac{z-p\_k}{1-\\overline{p}\_kz}, where p\_k are n complex numbers of modulus \<1. I calculated a vector of partial products, and the fun…

---

## [Extract raster at points 2024](https://discourse.julialang.org/t/extract-raster-at-points-2024/115610)

<div class="topic-metadata">

**Author:** [@CompulsoryCoffee](https://discourse.julialang.org/u/CompulsoryCoffee)\
**Replies:** 1\
**Last updated:** [June 13, 2024, 5:42pm UTC](https://discourse.julialang.org/t/extract-raster-at-points-2024/115610 "2024-06-13T17:42:55Z")

</div>

Hi, Is there a way/package now which allows to extract the raster value at points for large dataset (10M points)? Thanks!

---

## [Accessing a vector of vector is slow](https://discourse.julialang.org/t/accessing-a-vector-of-vector-is-slow/115552)

<div class="topic-metadata">

**Author:** [@elbert5770](https://discourse.julialang.org/u/elbert5770)\
**Replies:** 6\
**Last updated:** [June 13, 2024, 3:06pm UTC](https://discourse.julialang.org/t/accessing-a-vector-of-vector-is-slow/115552 "2024-06-13T15:06:35Z")

</div>

This topic: How is memory allocated for a vector of structs? - General Usage / Performance - Julia Programming Language (julialang.org) made me wonder if a vector of vectors would be faster than a vector of struct for t…

---

## [Variable Scoping in Non-Interactive Context](https://discourse.julialang.org/t/variable-scoping-in-non-interactive-context/115603)

<div class="topic-metadata">

**Author:** [@astro-kevin](https://discourse.julialang.org/u/astro-kevin)\
**Replies:** 1\
**Last updated:** [June 13, 2024, 2:53pm UTC](https://discourse.julialang.org/t/variable-scoping-in-non-interactive-context/115603 "2024-06-13T14:53:56Z")

</div>

I’m trying to index a vector in a soft local variable scope, but I just can’t seem to do it. The code looks minimally something like this: in a file called testfile.jl struct TestStruct thing::Int64 end function Fo…

---

## [Use Julia to plot grouped bar chart](https://discourse.julialang.org/t/use-julia-to-plot-grouped-bar-chart/115554)

<div class="topic-metadata">

**Author:** [@Z\_M](https://discourse.julialang.org/u/Z_M)\
**Replies:** 4\
**Last updated:** [June 13, 2024, 12:16pm UTC](https://discourse.julialang.org/t/use-julia-to-plot-grouped-bar-chart/115554 "2024-06-13T12:16:06Z")

</div>

Hi guys! I want to know how to use Julia to plot a bar chart like the following picture. Specifically, each X-axis label corresponds to two or more columns. Thank you very much!

---

## [Run multiple python instances with pycall in different threads](https://discourse.julialang.org/t/run-multiple-python-instances-with-pycall-in-different-threads/78399)

<div class="topic-metadata">

**Author:** [@Tyde](https://discourse.julialang.org/u/Tyde)\
**Replies:** 6\
**Last updated:** [June 13, 2024, 7:06am UTC](https://discourse.julialang.org/t/run-multiple-python-instances-with-pycall-in-different-threads/78399 "2024-06-13T07:06:11Z")

</div>

Hi, I have a project where I need to call python code via PyCall.jl. This python code itself does interact with a third-party library (In this case I use pyspice the control the simulation of multiple circuits). To incr…

---

## [For \`x::Vector{Char}\`, which should I use \`string(x...)\` or \`join(x)\`?](https://discourse.julialang.org/t/for-x-vector-char-which-should-i-use-string-x-or-join-x/115469)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 6\
**Last updated:** [June 13, 2024, 7:01am UTC](https://discourse.julialang.org/t/for-x-vector-char-which-should-i-use-string-x-or-join-x/115469 "2024-06-13T07:01:25Z")

</div>

I have a black box variable x::Vector{Char} which satisfies length(x) \< 20 (actually, it is not a black box because it is open source, but I do not understand how it behaves yet because I have not read the implementation…

---

## [Unable to launch julia 1.6 - SSL and glibc issues](https://discourse.julialang.org/t/unable-to-launch-julia-1-6-ssl-and-glibc-issues/60488)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 17\
**Last updated:** [June 12, 2024, 8:42pm UTC](https://discourse.julialang.org/t/unable-to-launch-julia-1-6-ssl-and-glibc-issues/60488 "2024-06-12T20:42:11Z")

</div>

I recently installed Julia 1.6 on a CentOS 7 cluster, but am unable to run it. \[affans@hpc ~\]$ julia ERROR: Unable to load dependent library /home/affans/julia-1.6.1/bin/../lib/julia/libjulia-internal.so.1 Message:/usr/…

---

## [@test\_logs and the VSCode Testing pane](https://discourse.julialang.org/t/test-logs-and-the-vscode-testing-pane/115569)

<div class="topic-metadata">

**Author:** [@Ken\_Williams](https://discourse.julialang.org/u/Ken_Williams)\
**Replies:** 0\
**Last updated:** [June 12, 2024, 5:47pm UTC](https://discourse.julialang.org/t/test-logs-and-the-vscode-testing-pane/115569 "2024-06-12T17:47:38Z")

</div>

I’m using @test\_logs to verify that a certain warning message is issued under certain conditions. This seems to work fine when running via \]test, but when I run by hitting the green “play” triangle in the VSCode Testing…

---

## [How to tell if invalidations are worth fixing?](https://discourse.julialang.org/t/how-to-tell-if-invalidations-are-worth-fixing/61950)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 4\
**Last updated:** [June 12, 2024, 9:39am UTC](https://discourse.julialang.org/t/how-to-tell-if-invalidations-are-worth-fixing/61950 "2024-06-12T09:39:44Z")

</div>

I can use SnoopCompile to detect invalidations. and the manual talks about how to fix them by modifying the code that gets invalidated. But it is also possible to fix it sometimes by modifying the code that causes the …

---

## [Advice for Higher Order Functions on Tuples](https://discourse.julialang.org/t/advice-for-higher-order-functions-on-tuples/115509)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 6\
**Last updated:** [June 12, 2024, 6:55am UTC](https://discourse.julialang.org/t/advice-for-higher-order-functions-on-tuples/115509 "2024-06-12T06:55:50Z")

</div>

I have a package where I’m operating on lists of types, and I need everything to compile away. I have succeeded in doing so by using these two functions: using Tricks """ Utility function which generates a list of expr…

---

## [About storing the results of Iterators.product into an array efficiently?](https://discourse.julialang.org/t/about-storing-the-results-of-iterators-product-into-an-array-efficiently/115504)

<div class="topic-metadata">

**Author:** [@HMegh](https://discourse.julialang.org/u/HMegh)\
**Replies:** 8\
**Last updated:** [June 12, 2024, 6:02am UTC](https://discourse.julialang.org/t/about-storing-the-results-of-iterators-product-into-an-array-efficiently/115504 "2024-06-12T06:02:09Z")

</div>

I have a finite set represented as a vector V::Vector{T} and I am trying to compute the power of this set V^d=V\\times V\\times \\cdots \\times V. That is, the Cartesian product of V with itself d-times, which is a finite se…

---

## [Write a formatted backtrace to IOBuffer](https://discourse.julialang.org/t/write-a-formatted-backtrace-to-iobuffer/115516)

<div class="topic-metadata">

**Author:** [@mrufsvold](https://discourse.julialang.org/u/mrufsvold)\
**Replies:** 2\
**Last updated:** [June 11, 2024, 11:19pm UTC](https://discourse.julialang.org/t/write-a-formatted-backtrace-to-iobuffer/115516 "2024-06-11T23:19:34Z")

</div>

I want to catch an error, construct the backtrace that would normally be written to the REPL, and add it to a JSON blob instead. However, I can’t seem to get simple logger to write to an IOBuffer. MWE: julia\> ch1 = Cha…

---

## [Using a lock array to prevent multi thread corruption](https://discourse.julialang.org/t/using-a-lock-array-to-prevent-multi-thread-corruption/115485)

<div class="topic-metadata">

**Author:** [@CodeGodz](https://discourse.julialang.org/u/CodeGodz)\
**Replies:** 2\
**Last updated:** [June 11, 2024, 10:38pm UTC](https://discourse.julialang.org/t/using-a-lock-array-to-prevent-multi-thread-corruption/115485 "2024-06-11T22:38:15Z")

</div>

I was reading through @Dan’s answer here to lock a struct using a spinlock. Lets say we are in a situation where we have a struct that in its entirety needs to be updated. Could we use something like: struct Entry v…

---

## [First class "from end" indices into array](https://discourse.julialang.org/t/first-class-from-end-indices-into-array/115455)

<div class="topic-metadata">

**Author:** [@shamazmazum](https://discourse.julialang.org/u/shamazmazum)\
**Replies:** 12\
**Last updated:** [June 11, 2024, 10:06pm UTC](https://discourse.julialang.org/t/first-class-from-end-indices-into-array/115455 "2024-06-11T22:06:45Z")

</div>

Is there any way to make a first class index that points to an element from the end of an array? So it can be e.g. assigned to a variable. For example, in python I can do idx1 = 0 idx2 = -1 a = \[1,2,3,4,5\] a\[idx1\] # Giv…

---

## [Complex event graph processor](https://discourse.julialang.org/t/complex-event-graph-processor/115520)

<div class="topic-metadata">

**Author:** [@roh\_codeur](https://discourse.julialang.org/u/roh_codeur)\
**Replies:** 0\
**Last updated:** [June 11, 2024, 9:52pm UTC](https://discourse.julialang.org/t/complex-event-graph-processor/115520 "2024-06-11T21:52:00Z")

</div>

Hi is anyone aware of a Complex Event Processor for realtime events in Julia? Python appears to have one: Ta!

---

## [Distributed performance depends on the number of workers?](https://discourse.julialang.org/t/distributed-performance-depends-on-the-number-of-workers/115514)

<div class="topic-metadata">

**Author:** [@greivin](https://discourse.julialang.org/u/greivin)\
**Replies:** 0\
**Last updated:** [June 11, 2024, 9:01pm UTC](https://discourse.julialang.org/t/distributed-performance-depends-on-the-number-of-workers/115514 "2024-06-11T21:01:09Z")

</div>

I’m executing a code that solves a linear system (Ax = b) for a fixed matrix A, and for several vectors b\_i here i runs from 1 to N. I set N to match the number of available cores in my system, therefore I’ll be solving …

---

## [Modify the julia launcher in vscode](https://discourse.julialang.org/t/modify-the-julia-launcher-in-vscode/115505)

<div class="topic-metadata">

**Author:** [@ahazra](https://discourse.julialang.org/u/ahazra)\
**Replies:** 0\
**Last updated:** [June 11, 2024, 6:16pm UTC](https://discourse.julialang.org/t/modify-the-julia-launcher-in-vscode/115505 "2024-06-11T18:16:48Z")

</div>

With julia v1.10.4 and suitesparse v5.0.0 (on Ubuntu Linux LTS 22.04), everytime julia runs, it shows the following error: exception = │ could not load symbol “SuiteSparse\_config\_malloc\_func\_set”: │ /usr/lib/x8…

---

## [Type event on GtkWindow](https://discourse.julialang.org/t/type-event-on-gtkwindow/115475)

<div class="topic-metadata">

**Author:** [@jojo75](https://discourse.julialang.org/u/jojo75)\
**Replies:** 1\
**Last updated:** [June 11, 2024, 4:18pm UTC](https://discourse.julialang.org/t/type-event-on-gtkwindow/115475 "2024-06-11T16:18:43Z")

</div>

Hello, From this code using Gtk signal\_connect(my\_window , :window\_state\_event) do w , x println("type of x ", typeof(x) ) println(“wind activate\_focus x :”,x) end I have always the same response whatever the st…

---

## [Julia for Real-Time processing on embedded platforms](https://discourse.julialang.org/t/julia-for-real-time-processing-on-embedded-platforms/95925)

<div class="topic-metadata">

**Author:** [@jpreisig](https://discourse.julialang.org/u/jpreisig)\
**Replies:** 13\
**Last updated:** [June 11, 2024, 4:15pm UTC](https://discourse.julialang.org/t/julia-for-real-time-processing-on-embedded-platforms/95925 "2024-06-11T16:15:52Z")

</div>

I have seen a lot of older (order 2019) posts about Julia not being suitable for real-time implementations on embedded platforms. Wondering about the current state of thinking on this. I realize the embedded means diff…

---

## [Code in the documentation is not working](https://discourse.julialang.org/t/code-in-the-documentation-is-not-working/115474)

<div class="topic-metadata">

**Author:** [@Manasa\_S](https://discourse.julialang.org/u/Manasa_S)\
**Replies:** 5\
**Last updated:** [June 11, 2024, 2:56pm UTC](https://discourse.julialang.org/t/code-in-the-documentation-is-not-working/115474 "2024-06-11T14:56:09Z")

</div>

using CairoMakie using StableRNGs points = \[(0.0, 0.0), (2.0, 0.0), (1.0, 2.0)\] tri = triangulate(points) fig, ax, sc = triplot(tri) fig add\_point!(tri, 1.0, 0.5) fig, ax, sc = triplot(tri) fig add\_point!(tri, 0.0, 1.…

---

## [Return type of readline function](https://discourse.julialang.org/t/return-type-of-readline-function/115437)

<div class="topic-metadata">

**Author:** [@EarlMilktea](https://discourse.julialang.org/u/EarlMilktea)\
**Replies:** 3\
**Last updated:** [June 11, 2024, 1:04pm UTC](https://discourse.julialang.org/t/return-type-of-readline-function/115437 "2024-06-11T13:04:44Z")

</div>

Suppose you want to read from stdin: function main() println("Reading...") readline() end For this code, @code\_warntype says the return type is Any, even though it seems really unlikely to me that readline retu…

---

## [Changes to juliaup overnight?](https://discourse.julialang.org/t/changes-to-juliaup-overnight/115471)

<div class="topic-metadata">

**Author:** [@TimG](https://discourse.julialang.org/u/TimG)\
**Replies:** 2\
**Last updated:** [June 11, 2024, 11:36am UTC](https://discourse.julialang.org/t/changes-to-juliaup-overnight/115471 "2024-06-11T11:36:10Z")

</div>

Yesterday, I could use julia just fine. Today I cannot. Has something changed on the julia side or is it me or my IT department? On opening VS Code, I get the following: At the command prompt, I get: then, after…

---

## [CSV.jl: findmax and argmax are still broken, please help](https://discourse.julialang.org/t/csv-jl-findmax-and-argmax-are-still-broken-please-help/115366)

<div class="topic-metadata">

**Author:** [@mkitti](https://discourse.julialang.org/u/mkitti)\
**Replies:** 6\
**Last updated:** [June 11, 2024, 10:06am UTC](https://discourse.julialang.org/t/csv-jl-findmax-and-argmax-are-still-broken-please-help/115366 "2024-06-11T10:06:16Z")

</div>

findmax and argmax are still broken with CSV.jl, please help Test codeusing CSV using DataFrames using StableRNGs using Test function write\_data(dims::Dims{3} = (16, 2, 8)) rng = StableRNG(1230) data = rand(rng…

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

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