# General Usage

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

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

**Page:** 459

---

## [GMRES (krylovkit) info.residual](https://discourse.julialang.org/t/gmres-krylovkit-info-residual/79860)

<div class="topic-metadata">

**Author:** [@Srikumar](https://discourse.julialang.org/u/Srikumar)\
**Replies:** 0\
**Last updated:** [April 22, 2022, 6:12pm UTC](https://discourse.julialang.org/t/gmres-krylovkit-info-residual/79860 "2022-04-22T18:12:54Z")

</div>

I find that the norm(info.residual) that GMRES prints at each step (inside a single iteration) is different from the actual residual norm ||(b-Ax)|| that one computes with the current approximate x manually. Are these 2 …

---

## [MLJ compain TypeError: non-boolean (Nothing) used in boolean context](https://discourse.julialang.org/t/mlj-compain-typeerror-non-boolean-nothing-used-in-boolean-context/79844)

<div class="topic-metadata">

**Author:** [@tiZ](https://discourse.julialang.org/u/tiZ)\
**Replies:** 0\
**Last updated:** [April 22, 2022, 2:17pm UTC](https://discourse.julialang.org/t/mlj-compain-typeerror-non-boolean-nothing-used-in-boolean-context/79844 "2022-04-22T14:17:27Z")

</div>

Hi, I have trouble in understand the error while I do the model evaluate in MLJ package. I could run succussful with Accuracy or MulticlassFScore measures, but if I add the confusion\_matrix measure as below, it will …

---

## [Is Julia integral calculation not as fast as MATLAB?](https://discourse.julialang.org/t/is-julia-integral-calculation-not-as-fast-as-matlab/79824)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 20\
**Last updated:** [April 22, 2022, 2:08pm UTC](https://discourse.julialang.org/t/is-julia-integral-calculation-not-as-fast-as-matlab/79824 "2022-04-22T14:08:34Z")

</div>

I found it was slow when I used QuadGK.jl to do integral calculation. Then I used MATLAB to make a comparison and found that Julia integral was slower than MATLAB. Here are my comparisons: julia\> using QuadGK julia\> f(…

---

## [Avoid printout to REPL/console of running a command](https://discourse.julialang.org/t/avoid-printout-to-repl-console-of-running-a-command/79843)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 1\
**Last updated:** [April 22, 2022, 1:54pm UTC](https://discourse.julialang.org/t/avoid-printout-to-repl-console-of-running-a-command/79843 "2022-04-22T13:54:28Z")

</div>

I am on Windows and vs code. The snippet below prints a ton of verbose mixtex code to the console. I thought read would circumvent this, but that is not the case. Any ideas how I can disable this? I am looking for a …

---

## [Speed up for-loop with multithreading](https://discourse.julialang.org/t/speed-up-for-loop-with-multithreading/79823)

<div class="topic-metadata">

**Author:** [@Himbeersternchen](https://discourse.julialang.org/u/Himbeersternchen)\
**Replies:** 10\
**Last updated:** [April 22, 2022, 1:32pm UTC](https://discourse.julialang.org/t/speed-up-for-loop-with-multithreading/79823 "2022-04-22T13:32:50Z")

</div>

Hi Guys, I’m trying to speed up my for-loop with multithreading like following (test3.jl code): time0 = @elapsed begin n = 250 a1 = Array{Array{Float64, 1}, 1}(undef, n) Threads.@threads for i in 1:n …

---

## [Create a custom Random.Sampler or Matrix sampler via Distribution.Sampleable](https://discourse.julialang.org/t/create-a-custom-random-sampler-or-matrix-sampler-via-distribution-sampleable/79834)

<div class="topic-metadata">

**Author:** [@dmetivie](https://discourse.julialang.org/u/dmetivie)\
**Replies:** 0\
**Last updated:** [April 22, 2022, 12:30pm UTC](https://discourse.julialang.org/t/create-a-custom-random-sampler-or-matrix-sampler-via-distribution-sampleable/79834 "2022-04-22T12:30:14Z")

</div>

I am trying to define rand methods to “randomize” points x represented in a matrix (n, s) (n is the number of point and s is the dimension). I could directly define function rand(RM::RandomizationMethod) x = RM.x …

---

## [State of gRPC in Julia](https://discourse.julialang.org/t/state-of-grpc-in-julia/79790)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 2\
**Last updated:** [April 22, 2022, 6:28am UTC](https://discourse.julialang.org/t/state-of-grpc-in-julia/79790 "2022-04-22T06:28:00Z")

</div>

Hi all :slight\_smile: I was looking at the gRPC package https://github.com/JuliaComputing/gRPCClient.jl and was wondering how it’s works and what the general status is. Any experiences or tutorials for that package? …

---

## [Strange behavior of plot](https://discourse.julialang.org/t/strange-behavior-of-plot/79803)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [April 22, 2022, 2:47am UTC](https://discourse.julialang.org/t/strange-behavior-of-plot/79803 "2022-04-22T02:47:10Z")

</div>

I noticed a very strange behavior of comment strings followed by the semi-colon. Consider the simple program: using Plots plot(1:10, 1:10, c=:blue) # This will create a plot as expected. However, if I change the last l…

---

## [Current state of Julia Probabilistic Programming Languages and functionalities](https://discourse.julialang.org/t/current-state-of-julia-probabilistic-programming-languages-and-functionalities/78711)

<div class="topic-metadata">

**Author:** [@00krishna](https://discourse.julialang.org/u/00krishna)\
**Replies:** 9\
**Last updated:** [April 22, 2022, 2:33am UTC](https://discourse.julialang.org/t/current-state-of-julia-probabilistic-programming-languages-and-functionalities/78711 "2022-04-22T02:33:17Z")

</div>

Hey folks. I was looking over the various Julia probabilistic programming languages and was trying to reconcile the features of each. Unfortunately I did not get very far. But I was wondering if anyone can point me to a …

---

## [Dynamic tick labels](https://discourse.julialang.org/t/dynamic-tick-labels/79802)

<div class="topic-metadata">

**Author:** [@chadagreene](https://discourse.julialang.org/u/chadagreene)\
**Replies:** 2\
**Last updated:** [April 21, 2022, 10:34pm UTC](https://discourse.julialang.org/t/dynamic-tick-labels/79802 "2022-04-21T22:34:31Z")

</div>

I have a simple plot like this: using Plots plot(sind.(1:360)) It looks good by default, but when I use the pan and zoom tools to explore the plot, the x and y tick labels don’t automatically update with the changing …

---

## [Fastest way to fill a Sparse Matrix?](https://discourse.julialang.org/t/fastest-way-to-fill-a-sparse-matrix/79795)

<div class="topic-metadata">

**Author:** [@Alejandro\_Quiaro\_San](https://discourse.julialang.org/u/Alejandro_Quiaro_San)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 9:29pm UTC](https://discourse.julialang.org/t/fastest-way-to-fill-a-sparse-matrix/79795 "2022-04-21T21:29:05Z")

</div>

Hello guys, I am wondering which should be the right strategy to fill values in a big sparse matrix. I have a variable L, which is an n x m matrix, and is sparse. An outer loop runs on the row index, and just a few valu…

---

## [Zygote dozens\* of times slower than manually written function](https://discourse.julialang.org/t/zygote-dozens-of-times-slower-than-manually-written-function/79748)

<div class="topic-metadata">

**Author:** [@Gabrielmlando](https://discourse.julialang.org/u/Gabrielmlando)\
**Replies:** 17\
**Last updated:** [April 21, 2022, 9:25pm UTC](https://discourse.julialang.org/t/zygote-dozens-of-times-slower-than-manually-written-function/79748 "2022-04-21T21:25:48Z")

</div>

I am trying to use Zygote in order to avoid the need of manually passing gradients/Hessians. I started by the simplest possible example for my applications, namely a hydrogen atom. The Hamiltonian and initial point are d…

---

## [Bayes\_rule\_discrete.ipynb demo in ForneyLab](https://discourse.julialang.org/t/bayes-rule-discrete-ipynb-demo-in-forneylab/79758)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 9:23pm UTC](https://discourse.julialang.org/t/bayes-rule-discrete-ipynb-demo-in-forneylab/79758 "2022-04-21T21:23:17Z")

</div>

Hi, I am relatively new to ForneyLab and am trying it again after a year-long break using Julia 1.7 and ForneyLab 0.11.4 . While most of the demos provided run fine, the simplest demo of all, Bayes-rule\_discrete.ipynb g…

---

## [Unexpected \`sizeof\` struct with long StaticArrays](https://discourse.julialang.org/t/unexpected-sizeof-struct-with-long-staticarrays/79797)

<div class="topic-metadata">

**Author:** [@cchderrick](https://discourse.julialang.org/u/cchderrick)\
**Replies:** 1\
**Last updated:** [April 21, 2022, 7:21pm UTC](https://discourse.julialang.org/t/unexpected-sizeof-struct-with-long-staticarrays/79797 "2022-04-21T19:21:06Z")

</div>

Consider this: using StaticArrays struct Dummy B::SVector{34,UInt8} end @assert sizeof(Dummy) == sum(sizeof.(fieldtypes(Dummy))) struct Dummy32 A::Float32 B::SVector{32,UInt8} end @assert sizeof(Dummy32) =…

---

## [Use of Lazy arrays](https://discourse.julialang.org/t/use-of-lazy-arrays/79779)

<div class="topic-metadata">

**Author:** [@Siempie](https://discourse.julialang.org/u/Siempie)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 4:36pm UTC](https://discourse.julialang.org/t/use-of-lazy-arrays/79779 "2022-04-21T16:36:49Z")

</div>

Hi, I am looking into the use of lazy evaluation and lazy arrays in Julia. For example the package LazyArrays.jl. However i am not quite sure if i understand the benefits of lazy evaluation correctly. In my understandi…

---

## [Efficient serialization across system images](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781)

<div class="topic-metadata">

**Author:** [@sstroemer](https://discourse.julialang.org/u/sstroemer)\
**Replies:** 2\
**Last updated:** [April 21, 2022, 4:28pm UTC](https://discourse.julialang.org/t/efficient-serialization-across-system-images/79781 "2022-04-21T16:28:16Z")

</div>

I’ve got a dictionary containing only String keys mapping to Numbers. This is the result of a computation that runs on a server. Since I make use of PyJulia to initiate the computation from a Python app, I’m using a cust…

---

## [How do I define a custom Action in Javis.jl?](https://discourse.julialang.org/t/how-do-i-define-a-custom-action-in-javis-jl/79791)

<div class="topic-metadata">

**Author:** [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)\
**Replies:** 0\
**Last updated:** [April 21, 2022, 2:36pm UTC](https://discourse.julialang.org/t/how-do-i-define-a-custom-action-in-javis-jl/79791 "2022-04-21T14:36:23Z")

</div>

Hello So I’m trying to define a custom animation in Javis. My code is - using Javis using Animations using Colors function ground(args...) background("black") sethue("white") end rotate\_anim = Animation( …

---

## [Open a file and never close it](https://discourse.julialang.org/t/open-a-file-and-never-close-it/19091)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 4\
**Last updated:** [April 21, 2022, 11:52am UTC](https://discourse.julialang.org/t/open-a-file-and-never-close-it/19091 "2022-04-21T11:52:17Z")

</div>

I know this is considered bad style, but I would like to better understand why. What happens if one opens a file and never closes it? function sloppy() open("some\_file", "w") nothing end sloppy() Will the GC …

---

## [Put!(remotechannel, x) causes no error but an infinite run time](https://discourse.julialang.org/t/put-remotechannel-x-causes-no-error-but-an-infinite-run-time/79770)

<div class="topic-metadata">

**Author:** [@Himbeersternchen](https://discourse.julialang.org/u/Himbeersternchen)\
**Replies:** 3\
**Last updated:** [April 21, 2022, 10:48am UTC](https://discourse.julialang.org/t/put-remotechannel-x-causes-no-error-but-an-infinite-run-time/79770 "2022-04-21T10:48:11Z")

</div>

Hi Everyone, i m trying to use RemoteChannel in Julia: julia -p 2 x = RemoteChannel(()-\>Channel{Array{Float64,2}}(1)) a = \[1 2 3 4; 5 6 7 8\] put!(x,a) ran perfect. But the maximal length of channel x is 1. So i expe…

---

## [Fast offset matrix subtraction](https://discourse.julialang.org/t/fast-offset-matrix-subtraction/79731)

<div class="topic-metadata">

**Author:** [@this\_josh](https://discourse.julialang.org/u/this_josh)\
**Replies:** 5\
**Last updated:** [April 21, 2022, 7:34am UTC](https://discourse.julialang.org/t/fast-offset-matrix-subtraction/79731 "2022-04-21T07:34:54Z")

</div>

I have a matrix h \\in \\mathbb{R}^{n\_n \\times n\_t} where n\_n is the number of sensors and n\_t is the number of hours in a day. I want to understand the variation between each timestamp for each sensor (note times roll ove…

---

## [Converting abstract types](https://discourse.julialang.org/t/converting-abstract-types/79763)

<div class="topic-metadata">

**Author:** [@tictaccat](https://discourse.julialang.org/u/tictaccat)\
**Replies:** 1\
**Last updated:** [April 21, 2022, 5:13am UTC](https://discourse.julialang.org/t/converting-abstract-types/79763 "2022-04-21T05:13:25Z")

</div>

Suppose I have an abstract type A{V} and two structs B{V} and C{V}, for example abstract type A{V} end struct B{V} \<: A{V} x::V end struct C{V} \<: A{V} x::V end Now suppose I have a function f that accepts A{V}.…

---

## [Getting ChainRules to work with custom Dense and Chain regularization functions](https://discourse.julialang.org/t/getting-chainrules-to-work-with-custom-dense-and-chain-regularization-functions/79334)

<div class="topic-metadata">

**Author:** [@user22](https://discourse.julialang.org/u/user22)\
**Replies:** 2\
**Last updated:** [April 20, 2022, 7:46pm UTC](https://discourse.julialang.org/t/getting-chainrules-to-work-with-custom-dense-and-chain-regularization-functions/79334 "2022-04-20T19:46:45Z")

</div>

I have encountered a few issues when trying to implement a regularizer function and its pullback in ChainRules to a mildly customized Flux Dense layer and Chain. For simplicity and testing purposes, I just wrote a basic …

---

## [Reality check: How useful exactly are SuiteSparse and LDLFactorizations' LDLT?](https://discourse.julialang.org/t/reality-check-how-useful-exactly-are-suitesparse-and-ldlfactorizations-ldlt/79607)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 11\
**Last updated:** [April 20, 2022, 5:57pm UTC](https://discourse.julialang.org/t/reality-check-how-useful-exactly-are-suitesparse-and-ldlfactorizations-ldlt/79607 "2022-04-20T17:57:37Z")

</div>

https://github.com/JuliaSmoothOptimizers/LDLFactorizations.jl/issues/101 I realize that calling for a native implementation of a multi-frontal or supernodal factorization is a tall order: people spend decades of their …

---

## [Segfault when invoking Julia callback function from C](https://discourse.julialang.org/t/segfault-when-invoking-julia-callback-function-from-c/79541)

<div class="topic-metadata">

**Author:** [@Octogonapus](https://discourse.julialang.org/u/Octogonapus)\
**Replies:** 10\
**Last updated:** [April 20, 2022, 3:51pm UTC](https://discourse.julialang.org/t/segfault-when-invoking-julia-callback-function-from-c/79541 "2022-04-20T15:51:50Z")

</div>

I am trying to pass a Julia function to a C library (aws-c-mqtt) which will use it as a callback when an asynchronous event occurs. I am running in to trouble because some of the parameters passed to this callback appear…

---

## [Unicode in command line](https://discourse.julialang.org/t/unicode-in-command-line/79735)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 4\
**Last updated:** [April 20, 2022, 1:02pm UTC](https://discourse.julialang.org/t/unicode-in-command-line/79735 "2022-04-20T13:02:10Z")

</div>

Hello, When I use UnicodePlots in the command prompt opened by executing julia.exe (1.7.2, windows 10), I get this I was wondering if this is normal or if there’s a configuration somewhere that can enable unicode cha…

---

## [What is the interface for abstract types in Base?](https://discourse.julialang.org/t/what-is-the-interface-for-abstract-types-in-base/79729)

<div class="topic-metadata">

**Author:** [@melonedo](https://discourse.julialang.org/u/melonedo)\
**Replies:** 2\
**Last updated:** [April 20, 2022, 11:14am UTC](https://discourse.julialang.org/t/what-is-the-interface-for-abstract-types-in-base/79729 "2022-04-20T11:14:23Z")

</div>

Julia has a well-defined interface for AbstractArray related in the documentation, however, I have difficulty finding interface for: AbstractString: displaying it requires ncodeunits(s::SomeString), iterate(s::SomeStr…

---

## [Is it suggested to write functions for ::IO?](https://discourse.julialang.org/t/is-it-suggested-to-write-functions-for-io/79718)

<div class="topic-metadata">

**Author:** [@Rratic](https://discourse.julialang.org/u/Rratic)\
**Replies:** 6\
**Last updated:** [April 20, 2022, 9:38am UTC](https://discourse.julialang.org/t/is-it-suggested-to-write-functions-for-io/79718 "2022-04-20T09:38:55Z")

</div>

I found that some of the functions in Base are written like (::IO,::Any), and then uses sprint to wrap it so that it can return a string. For the following code: function A(io::IO) print(io,"foo") end A()=sprint(A) B()…

---

## [List Comprehension and Map](https://discourse.julialang.org/t/list-comprehension-and-map/79502)

<div class="topic-metadata">

**Author:** [@bmit](https://discourse.julialang.org/u/bmit)\
**Replies:** 8\
**Last updated:** [April 20, 2022, 9:21am UTC](https://discourse.julialang.org/t/list-comprehension-and-map/79502 "2022-04-20T09:21:12Z")

</div>

I know there are a number of topics already open on this subject, but I haven’t found this specific pattern yet. I think I’m look for the map do equivalent of conditional array comprehension. Here’s a small example and …

---

## [Correct process to use julia code from C# or VB .NET](https://discourse.julialang.org/t/correct-process-to-use-julia-code-from-c-or-vb-net/58018)

<div class="topic-metadata">

**Author:** [@BambOoxX](https://discourse.julialang.org/u/BambOoxX)\
**Replies:** 28\
**Last updated:** [April 20, 2022, 8:36am UTC](https://discourse.julialang.org/t/correct-process-to-use-julia-code-from-c-or-vb-net/58018 "2022-04-20T08:36:42Z")

</div>

I am currently working on a projet involving julia as a base language for mathematical computations, and .NET (C# or VB) for the GUI part. I want to emphasize the fact that I am quite new to dll handling, julia and .NET…

---

## [What is empty index notation?](https://discourse.julialang.org/t/what-is-empty-index-notation/79676)

<div class="topic-metadata">

**Author:** [@Katamari](https://discourse.julialang.org/u/Katamari)\
**Replies:** 8\
**Last updated:** [April 20, 2022, 7:08am UTC](https://discourse.julialang.org/t/what-is-empty-index-notation/79676 "2022-04-20T07:08:19Z")

</div>

I saw the following notation in the documentation of Makie. x\[\] = 3.34 https://makie.juliaplots.org/stable/documentation/nodes/index.html#the\_observable\_structure What is this syntax?

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

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