# General Usage

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

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

**Page:** 743

---

## [Use Logging to print a long list of variables in a single print block](https://discourse.julialang.org/t/use-logging-to-print-a-long-list-of-variables-in-a-single-print-block/40792)

<div class="topic-metadata">

**Author:** [@Salvatore\_Cosentino](https://discourse.julialang.org/u/Salvatore_Cosentino)\
**Replies:** 5\
**Last updated:** [June 10, 2020, 3:47am UTC](https://discourse.julialang.org/t/use-logging-to-print-a-long-list-of-variables-in-a-single-print-block/40792 "2020-06-10T03:47:21Z")

</div>

Hello everybody, It is the first time for me to write in this forum. I started using Julia recently, so I am sorry if my question might be very basic. I am using the Logging package to simplify debugging my code. In …

---

## [Break function on time limit](https://discourse.julialang.org/t/break-function-on-time-limit/7376)

<div class="topic-metadata">

**Author:** [@Wikunia](https://discourse.julialang.org/u/Wikunia)\
**Replies:** 22\
**Last updated:** [June 9, 2020, 11:34pm UTC](https://discourse.julialang.org/t/break-function-on-time-limit/7376 "2020-06-09T23:34:45Z")

</div>

Is there a way to break a function after a time limit? I don’t have any access to the function. FYI (if it helps) I want to break a JuMP solve after some seconds without knowing which solver performs the task. (the so…

---

## [Can't figure out why dynamic dispatch is occuring](https://discourse.julialang.org/t/cant-figure-out-why-dynamic-dispatch-is-occuring/41089)

<div class="topic-metadata">

**Author:** [@jlchan](https://discourse.julialang.org/u/jlchan)\
**Replies:** 6\
**Last updated:** [June 9, 2020, 7:34pm UTC](https://discourse.julialang.org/t/cant-figure-out-why-dynamic-dispatch-is-occuring/41089 "2020-06-09T19:34:42Z")

</div>

I’m trying to figure out why the profiler and @code\_warntype are picking up dynamic dispatch in the following MWE. The basic function applies matrix multiplications to each column of a matrix array and accumulates the re…

---

## [Why does precompilation take so long for this no-op module?](https://discourse.julialang.org/t/why-does-precompilation-take-so-long-for-this-no-op-module/41026)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 2\
**Last updated:** [June 9, 2020, 7:19pm UTC](https://discourse.julialang.org/t/why-does-precompilation-take-so-long-for-this-no-op-module/41026 "2020-06-09T19:19:36Z")

</div>

Suppose I have a basically empty package which depends on a “heavy” (i.e. slow to precompile/load) package. E.g. module Foo using Zygote end Why does precompiling my empty package (Julia 1.4.2) take significantly longe…

---

## [Workers do not show any IO when using a cluster](https://discourse.julialang.org/t/workers-do-not-show-any-io-when-using-a-cluster/40955)

<div class="topic-metadata">

**Author:** [@affans](https://discourse.julialang.org/u/affans)\
**Replies:** 6\
**Last updated:** [June 9, 2020, 6:39pm UTC](https://discourse.julialang.org/t/workers-do-not-show-any-io-when-using-a-cluster/40955 "2020-06-09T18:39:12Z")

</div>

See the following code that works as expected. julia\> addprocs(4); julia\> pmap(x -\> println(x), 1:8) From worker 3: 4 From worker 5: 1 From worker 5: 5 From worker 3: 6 From wo…

---

## [Suggestions needed: global binary optimization](https://discourse.julialang.org/t/suggestions-needed-global-binary-optimization/40952)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 8\
**Last updated:** [June 9, 2020, 3:31pm UTC](https://discourse.julialang.org/t/suggestions-needed-global-binary-optimization/40952 "2020-06-09T15:31:40Z")

</div>

The problem is very simple: x is a vector taking value from 0 or 1; S is a real symmetric matrix. The object is to minimize dot(x.+c, S, x.+c) with the constraint sum(x)=N, where N is an integer smaller than length(x) an…

---

## [A question about the "plot"](https://discourse.julialang.org/t/a-question-about-the-plot/41071)

<div class="topic-metadata">

**Author:** [@abcde](https://discourse.julialang.org/u/abcde)\
**Replies:** 3\
**Last updated:** [June 9, 2020, 3:00pm UTC](https://discourse.julialang.org/t/a-question-about-the-plot/41071 "2020-06-09T15:00:03Z")

</div>

using GR x=0:0.1:100 y=sin.(x) xlim=(\[0,120\]) ylim=(\[-1.5,1.5\]) plot(x,y) why does it wrong?thanks!

---

## [Compile R code directly to Julia native code](https://discourse.julialang.org/t/compile-r-code-directly-to-julia-native-code/41073)

<div class="topic-metadata">

**Author:** [@Ravinder\_Ram](https://discourse.julialang.org/u/Ravinder_Ram)\
**Replies:** 2\
**Last updated:** [June 9, 2020, 2:59pm UTC](https://discourse.julialang.org/t/compile-r-code-directly-to-julia-native-code/41073 "2020-06-09T14:59:46Z")

</div>

can i directly convert R code into julia intermediate/ native code?

---

## [Julia 1.4.2 fails to include Plots package](https://discourse.julialang.org/t/julia-1-4-2-fails-to-include-plots-package/40473)

<div class="topic-metadata">

**Author:** [@Adamszk](https://discourse.julialang.org/u/Adamszk)\
**Replies:** 6\
**Last updated:** [June 9, 2020, 2:47pm UTC](https://discourse.julialang.org/t/julia-1-4-2-fails-to-include-plots-package/40473 "2020-06-09T14:47:45Z")

</div>

Hi, I am trying to do simple plots in julia. I wrote, using Pkg Pkg.add(“Plots”) and it failed. It displayed some lenghty text about FFMEG artifacts in red colour. How do I fix it?

---

## [Ensuring Gtk.jl responsivity](https://discourse.julialang.org/t/ensuring-gtk-jl-responsivity/40710)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 8\
**Last updated:** [June 9, 2020, 10:02am UTC](https://discourse.julialang.org/t/ensuring-gtk-jl-responsivity/40710 "2020-06-09T10:02:16Z")

</div>

I’m writing a Gtk.jl application, and it’s easy to see that any time some time-consuming activity happens, such as running a long computation, this interferes with the UI responsivity. In especial, even updating a label …

---

## [Bounds error: attempt to access 21-element array](https://discourse.julialang.org/t/bounds-error-attempt-to-access-21-element-array/41050)

<div class="topic-metadata">

**Author:** [@Savvy21](https://discourse.julialang.org/u/Savvy21)\
**Replies:** 4\
**Last updated:** [June 9, 2020, 9:38am UTC](https://discourse.julialang.org/t/bounds-error-attempt-to-access-21-element-array/41050 "2020-06-09T09:38:43Z")

</div>

I am trying to get an output of the function in array form. #Additionally, I am unable to ask my questions nicely in the post, as in I am unable to write cells.

---

## [Random seed in multi-core parallel running](https://discourse.julialang.org/t/random-seed-in-multi-core-parallel-running/41017)

<div class="topic-metadata">

**Author:** [@Jing\_Zhang](https://discourse.julialang.org/u/Jing_Zhang)\
**Replies:** 3\
**Last updated:** [June 9, 2020, 2:41am UTC](https://discourse.julialang.org/t/random-seed-in-multi-core-parallel-running/41017 "2020-06-09T02:41:35Z")

</div>

Dear Julia Users, I was using @distributed to run 1000 replicates of simulations across 100 cores. How should I set the random seed across these cores to make simulation results reproducible? We need to make sure differ…

---

## [Simple 2nd Order Differential Equation syntax?](https://discourse.julialang.org/t/simple-2nd-order-differential-equation-syntax/41024)

<div class="topic-metadata">

**Author:** [@CosmoProf](https://discourse.julialang.org/u/CosmoProf)\
**Replies:** 16\
**Last updated:** [June 9, 2020, 1:24am UTC](https://discourse.julialang.org/t/simple-2nd-order-differential-equation-syntax/41024 "2020-06-09T01:24:31Z")

</div>

Hi, new to Julia; the instructions on how to use “SecondOrderODE” on the julia Diff Eq package website are very incomplete. What is wrong with the very simple program below? Thanks. BTW, I’m just trying to model the Sim…

---

## [Pass variables at command line](https://discourse.julialang.org/t/pass-variables-at-command-line/41025)

<div class="topic-metadata">

**Author:** [@dataSurfer](https://discourse.julialang.org/u/dataSurfer)\
**Replies:** 2\
**Last updated:** [June 9, 2020, 12:48am UTC](https://discourse.julialang.org/t/pass-variables-at-command-line/41025 "2020-06-09T00:48:10Z")

</div>

Is it possible to pass variables to a julia script at command line?

---

## [Import Board Package on Julia and use Infinity](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929)

<div class="topic-metadata">

**Author:** [@Moreno](https://discourse.julialang.org/u/Moreno)\
**Replies:** 6\
**Last updated:** [June 8, 2020, 11:16pm UTC](https://discourse.julialang.org/t/import-board-package-on-julia-and-use-infinity/40929 "2020-06-08T23:16:56Z")

</div>

Hi Guys, am new to Julia and am developing a Tic Tac Toe AI board game and i happen to have issues with importing board.I know in python it’s import board how do i do this in Julia?

---

## [How to change the type from MOIU.CachingOptimizer{MOI.AbstractOptimizer,...} to MOI.AbstractoOptimizer](https://discourse.julialang.org/t/how-to-change-the-type-from-moiu-cachingoptimizer-moi-abstractoptimizer-to-moi-abstractooptimizer/37179)

<div class="topic-metadata">

**Author:** [@sugyeong-jo](https://discourse.julialang.org/u/sugyeong-jo)\
**Replies:** 1\
**Last updated:** [June 8, 2020, 7:22pm UTC](https://discourse.julialang.org/t/how-to-change-the-type-from-moiu-cachingoptimizer-moi-abstractoptimizer-to-moi-abstractooptimizer/37179 "2020-06-08T19:22:03Z")

</div>

I want to make a solver looking for a feasibility solution. Therefore, I want to bring up the problem of mps format and treat constraints, variables, coefficients, etc. as follows. The structure I want is the same struc…

---

## [Getting a strange error when trying to join list of DataFrames, what could this be?](https://discourse.julialang.org/t/getting-a-strange-error-when-trying-to-join-list-of-dataframes-what-could-this-be/40997)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 6\
**Last updated:** [June 8, 2020, 4:49pm UTC](https://discourse.julialang.org/t/getting-a-strange-error-when-trying-to-join-list-of-dataframes-what-could-this-be/40997 "2020-06-08T16:49:38Z")

</div>

Hi how’s it going? I’m trying to join a list of DataFrames on a unique column, but it won’t even let me set a single one of those DataFrames to a variable and instead gives me this error. “AbstractDataFrame is not iter…

---

## [Invalid named tuple error](https://discourse.julialang.org/t/invalid-named-tuple-error/41000)

<div class="topic-metadata">

**Author:** [@Savvy21](https://discourse.julialang.org/u/Savvy21)\
**Replies:** 3\
**Last updated:** [June 8, 2020, 4:33pm UTC](https://discourse.julialang.org/t/invalid-named-tuple-error/41000 "2020-06-08T16:33:40Z")

</div>

Can anyone help me with this error, I am trying to get a plot here .

---

## [Type stable difference of tuples](https://discourse.julialang.org/t/type-stable-difference-of-tuples/3933)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 9\
**Last updated:** [June 8, 2020, 3:19pm UTC](https://discourse.julialang.org/t/type-stable-difference-of-tuples/3933 "2020-06-08T15:19:05Z")

</div>

Hello everyone, I am trying to figure out how to take the difference between two tuples of integers in a type-stable way, assuming that, if tuple a has length n, and tuple b has length m, then tuple c = setdiff(a,b) will…

---

## [Statistics.var wasting time calculating the mean?](https://discourse.julialang.org/t/statistics-var-wasting-time-calculating-the-mean/40944)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 8\
**Last updated:** [June 8, 2020, 2:22pm UTC](https://discourse.julialang.org/t/statistics-var-wasting-time-calculating-the-mean/40944 "2020-06-08T14:22:23Z")

</div>

I was trying to understand why Statistics.jl has both var and varm functions (since var already accepts a mean parameter). Doing @less var(\[1,2,3\]) I see: var(A::AbstractArray; corrected::Bool=true, mean=nothing, dims=:…

---

## [Memory error out of gc handles](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 4\
**Last updated:** [June 8, 2020, 2:14pm UTC](https://discourse.julialang.org/t/memory-error-out-of-gc-handles/40985 "2020-06-08T14:14:10Z")

</div>

I know I will be shown for a fool here… My laptop runs Windows 10 , Julia 1.5 32 gigabytesof RAM Using StaticArrays I cannot allocate a 100 by 100 array julia\> using StaticArrays julia\> @allocated A=@SMatrix zeros(…

---

## [Method specificity is acyclic, isn't it?](https://discourse.julialang.org/t/method-specificity-is-acyclic-isnt-it/38518)

<div class="topic-metadata">

**Author:** [@krstoff](https://discourse.julialang.org/u/krstoff)\
**Replies:** 1\
**Last updated:** [June 8, 2020, 4:04am UTC](https://discourse.julialang.org/t/method-specificity-is-acyclic-isnt-it/38518 "2020-06-08T04:04:13Z")

</div>

New user here. (How new? Try… yesterday.) Someone recommended me this talk from JuliaCon 2019 by Bezanson and I was a little spooked by a point made at 22:58. Here is his hypothetical type tree (with an ex…

---

## [Module loading \`import Module: foo\`](https://discourse.julialang.org/t/module-loading-import-module-foo/40957)

<div class="topic-metadata">

**Author:** [@jamblejoe](https://discourse.julialang.org/u/jamblejoe)\
**Replies:** 2\
**Last updated:** [June 8, 2020, 1:42pm UTC](https://discourse.julialang.org/t/module-loading-import-module-foo/40957 "2020-06-08T13:42:53Z")

</div>

Hi, I have a function e.g. solve in one of my modules and will use that module together with DifferentailEquations. The function in my module does something similar, that’s why the same name. To not override solve, I fi…

---

## [Recurrent precompilations](https://discourse.julialang.org/t/recurrent-precompilations/40948)

<div class="topic-metadata">

**Author:** [@aquarelle332](https://discourse.julialang.org/u/aquarelle332)\
**Replies:** 3\
**Last updated:** [June 8, 2020, 10:56am UTC](https://discourse.julialang.org/t/recurrent-precompilations/40948 "2020-06-08T10:56:23Z")

</div>

Kubuntu 18.04.4 LTS Julia 1.4.2 installed in /usr/local/julia-1.4.2 bashrc modified: PATH=/usr/local/julia-1.4.2/bin:$PATH $HOME/.julia contains: artifacts, compiled, conda, environments, logs, packages, prefs,…

---

## [How to discretize and solve a 3D Poisson Equation with Dirichlet boundary conditions owing to DiffEqOperators](https://discourse.julialang.org/t/how-to-discretize-and-solve-a-3d-poisson-equation-with-dirichlet-boundary-conditions-owing-to-diffeqoperators/40796)

<div class="topic-metadata">

**Author:** [@RenaudV](https://discourse.julialang.org/u/RenaudV)\
**Replies:** 2\
**Last updated:** [June 8, 2020, 6:37am UTC](https://discourse.julialang.org/t/how-to-discretize-and-solve-a-3d-poisson-equation-with-dirichlet-boundary-conditions-owing-to-diffeqoperators/40796 "2020-06-08T06:37:14Z")

</div>

I love the following example of solving a 1D Poisson equation with DiffEqOperators. However , I struggle to do the analog 3D example. Can somebody indicate me the right steps? The 1D formulation is: using DiffEqOperat…

---

## [Zygote and StructArrays](https://discourse.julialang.org/t/zygote-and-structarrays/35537)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 6\
**Last updated:** [June 7, 2020, 11:50pm UTC](https://discourse.julialang.org/t/zygote-and-structarrays/35537 "2020-06-07T23:50:27Z")

</div>

It seems Flux.@functor does not get along with StructArrays? using StructArrays, Flux struct A{SA} s::SA end struct Point x::Float64 y::Float64 end Flux.@functor A Flux.@functor Point a = A(StructArray((Point(i,2…

---

## [Improving a Program Implementing findall Function](https://discourse.julialang.org/t/improving-a-program-implementing-findall-function/40938)

<div class="topic-metadata">

**Author:** [@johnrickmanz](https://discourse.julialang.org/u/johnrickmanz)\
**Replies:** 1\
**Last updated:** [June 7, 2020, 6:29pm UTC](https://discourse.julialang.org/t/improving-a-program-implementing-findall-function/40938 "2020-06-07T18:29:00Z")

</div>

I recently seen topics here that says the findall function is quite slow and I think so too most likely if I am dealing with large number of elements say hundreds of thousands or more. An example of what I want is as fol…

---

## [Emacs evaluating code in Weave / jmd files?](https://discourse.julialang.org/t/emacs-evaluating-code-in-weave-jmd-files/40849)

<div class="topic-metadata">

**Author:** [@dlakelan](https://discourse.julialang.org/u/dlakelan)\
**Replies:** 2\
**Last updated:** [June 7, 2020, 5:17pm UTC](https://discourse.julialang.org/t/emacs-evaluating-code-in-weave-jmd-files/40849 "2020-06-07T17:17:30Z")

</div>

I’m writing documents using Weave, which is working great. Of course, I can easily with a single command, convert my document to a Notebook: notebook("..."); However, I work in Emacs, and it’d be great to be able to mo…

---

## [Best Julia Computer Graphics in Jupyter?](https://discourse.julialang.org/t/best-julia-computer-graphics-in-jupyter/40873)

<div class="topic-metadata">

**Author:** [@Jojo\_Dad](https://discourse.julialang.org/u/Jojo_Dad)\
**Replies:** 11\
**Last updated:** [June 7, 2020, 2:19pm UTC](https://discourse.julialang.org/t/best-julia-computer-graphics-in-jupyter/40873 "2020-06-07T14:19:50Z")

</div>

I want to teach a mechanics class using Julia. What’s the best Julia Computer Graphics Package that works in Jupyter?

---

## [GLIBCXX\_3.4.26 not found in RCall](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 16\
**Last updated:** [June 7, 2020, 11:15am UTC](https://discourse.julialang.org/t/glibcxx-3-4-26-not-found-in-rcall/29113 "2020-06-07T11:15:52Z")

</div>

(Also posted on slack#statistics) If anyone has time to look at what must be a basic issue on my side, I’ve posted an issue on RCall.jl that is a show stopper for me: https://github.com/JuliaInterop/RCall.jl/issues/339 …

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

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