# General Usage

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

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

**Page:** 789

---

## [Debugging AoT compile errors](https://discourse.julialang.org/t/debugging-aot-compile-errors/20829)

<div class="topic-metadata">

**Author:** [@dhazeghi](https://discourse.julialang.org/u/dhazeghi)\
**Replies:** 2\
**Last updated:** [February 13, 2020, 12:06am UTC](https://discourse.julialang.org/t/debugging-aot-compile-errors/20829 "2020-02-13T00:06:26Z")

</div>

Hi folks, I’m running into some odd errors compiling code to binary (via PackageCompiler) with Julia 1.1. Same code worked fine on 0.6 and works when running normally (not compiling to binary) on 1.1. The errors are r…

---

## [JuMP vs SAS](https://discourse.julialang.org/t/jump-vs-sas/34520)

<div class="topic-metadata">

**Author:** [@Dominic\_Pazzula](https://discourse.julialang.org/u/Dominic_Pazzula)\
**Replies:** 10\
**Last updated:** [February 12, 2020, 9:58pm UTC](https://discourse.julialang.org/t/jump-vs-sas/34520 "2020-02-12T21:58:15Z")

</div>

New to Julia, so I apologize if this is simple… I am evaluating new technologies to potentially replace SAS for some decision support tools. One in particular is a non-linear optimization of decent (but not huge) size.…

---

## [Any examples of "package directories"](https://discourse.julialang.org/t/any-examples-of-package-directories/34532)

<div class="topic-metadata">

**Author:** [@DevJac](https://discourse.julialang.org/u/DevJac)\
**Replies:** 1\
**Last updated:** [February 12, 2020, 8:44pm UTC](https://discourse.julialang.org/t/any-examples-of-package-directories/34532 "2020-02-12T20:44:02Z")

</div>

I was reading Code Loading · The Julia Language , and it looks like just what I needed. If I understand correctly, a “package directory” is a directory of packages, and those “packages” can be as simple as a single Juli…

---

## [PackageCompiler v0.6.5 fails to compile local (non-registered) packages](https://discourse.julialang.org/t/packagecompiler-v0-6-5-fails-to-compile-local-non-registered-packages/34124)

<div class="topic-metadata">

**Author:** [@alkoedl](https://discourse.julialang.org/u/alkoedl)\
**Replies:** 2\
**Last updated:** [February 12, 2020, 8:33pm UTC](https://discourse.julialang.org/t/packagecompiler-v0-6-5-fails-to-compile-local-non-registered-packages/34124 "2020-02-12T20:33:00Z")

</div>

Hi, I have trouble compiling packages which are not registered, i.e. not in the central registry, with PackageCompiler v0.6.5. This is independent of whether the packages are added or dev’ed, whether they are added by p…

---

## [On the Computational Efficiency of SparseArrays](https://discourse.julialang.org/t/on-the-computational-efficiency-of-sparsearrays/34531)

<div class="topic-metadata">

**Author:** [@asavasci](https://discourse.julialang.org/u/asavasci)\
**Replies:** 4\
**Last updated:** [February 12, 2020, 7:27pm UTC](https://discourse.julialang.org/t/on-the-computational-efficiency-of-sparsearrays/34531 "2020-02-12T19:27:16Z")

</div>

I am getting much more averaged computation time by using sparse matrices structure. Is there something wrong on my code? I used a quick test script to test multiplication of both data structure. using SparseArrays, Sta…

---

## [Trouble with @eval with mixed variable scopes](https://discourse.julialang.org/t/trouble-with-eval-with-mixed-variable-scopes/34483)

<div class="topic-metadata">

**Author:** [@arik](https://discourse.julialang.org/u/arik)\
**Replies:** 7\
**Last updated:** [February 12, 2020, 5:17pm UTC](https://discourse.julialang.org/t/trouble-with-eval-with-mixed-variable-scopes/34483 "2020-02-12T17:17:52Z")

</div>

Hi there. I have found some behavior of the “@eval”-macro that I cant quite explain. So, as far as I understand it, “@eval expr” takes a segment of code, and evaluates it as if it had been written at that point in the s…

---

## [Range with extra end? Is posible?](https://discourse.julialang.org/t/range-with-extra-end-is-posible/34486)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 5\
**Last updated:** [February 12, 2020, 6:39pm UTC](https://discourse.julialang.org/t/range-with-extra-end-is-posible/34486 "2020-02-12T18:39:33Z")

</div>

How to create silimilar this vector range() julia\> \[1:10:40;45\] 5-element Array{Int64,1}: 1 11 21 31 45 I expect something like : collect(range( x,y,z,;?) 1 11 21 31 45 Thx, Paul

---

## [Symbolic algebra elaboration?](https://discourse.julialang.org/t/symbolic-algebra-elaboration/34414)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 10\
**Last updated:** [February 12, 2020, 4:17pm UTC](https://discourse.julialang.org/t/symbolic-algebra-elaboration/34414 "2020-02-12T16:17:05Z")

</div>

Hi all … My daughter is in the first scientific high school, here in Italy. Yesterday, we were to see the expansion of (x+y)^7 with tartaglia triangle method … very nice … but I’d like to use Julia to do other symbolic …

---

## [Are fields with structtypes to be avoided as well?](https://discourse.julialang.org/t/are-fields-with-structtypes-to-be-avoided-as-well/34515)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 3\
**Last updated:** [February 12, 2020, 3:11pm UTC](https://discourse.julialang.org/t/are-fields-with-structtypes-to-be-avoided-as-well/34515 "2020-02-12T15:11:01Z")

</div>

In the manual it is recommended to avoid abstract type fields: Performance Tips · The Julia Language. It is not precised if this is also the case for struct type. Example: julia\> struct Foo{T} x::T end julia\> isabstrac…

---

## [Parametric type with a constrained NamedTuple](https://discourse.julialang.org/t/parametric-type-with-a-constrained-namedtuple/34511)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 2\
**Last updated:** [February 12, 2020, 11:15am UTC](https://discourse.julialang.org/t/parametric-type-with-a-constrained-namedtuple/34511 "2020-02-12T11:15:07Z")

</div>

I would like to define a parametric type that constrains a NamedTuple to have values of a certain type, but I am running into a problem. I am not sure if it is a bug, and if there is a workaround (other than specifying t…

---

## [Programacion no lineal](https://discourse.julialang.org/t/programacion-no-lineal/34502)

<div class="topic-metadata">

**Author:** [@WellingtonPerez](https://discourse.julialang.org/u/WellingtonPerez)\
**Replies:** 3\
**Last updated:** [February 12, 2020, 8:37am UTC](https://discourse.julialang.org/t/programacion-no-lineal/34502 "2020-02-12T08:37:12Z")

</div>

estoy tratando de programar un ejercicio no lineal pero me sale el siguiente error LoadError: The solver does not support an objective function of type MathOptInterface.ScalarQuadraticFunction{Float64}.

---

## [Managing dependencies in packages](https://discourse.julialang.org/t/managing-dependencies-in-packages/34474)

<div class="topic-metadata">

**Author:** [@timueh](https://discourse.julialang.org/u/timueh)\
**Replies:** 1\
**Last updated:** [February 12, 2020, 8:30am UTC](https://discourse.julialang.org/t/managing-dependencies-in-packages/34474 "2020-02-12T08:30:25Z")

</div>

How do I account for package dependencies that vary depending on the Julia version when running CI via travis? My situation: The SpecialFunctions package in its latest version 0.10.0 requires Julia 1.3 or above. When wr…

---

## [Optimize performance comparison - Optim.jl vs Scipy](https://discourse.julialang.org/t/optimize-performance-comparison-optim-jl-vs-scipy/12588)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 15\
**Last updated:** [February 12, 2020, 5:10am UTC](https://discourse.julialang.org/t/optimize-performance-comparison-optim-jl-vs-scipy/12588 "2020-02-12T05:10:15Z")

</div>

I am just starting to learn about optimization. I picked up Optim.jl (great documentation, btw) and tried to do the same thing in Python. It seems that Rosenbrock function is what everyone uses as an example. Perhaps …

---

## [Can't capture the output of print() in a worker process](https://discourse.julialang.org/t/cant-capture-the-output-of-print-in-a-worker-process/34335)

<div class="topic-metadata">

**Author:** [@Alyosha](https://discourse.julialang.org/u/Alyosha)\
**Replies:** 2\
**Last updated:** [February 11, 2020, 10:44pm UTC](https://discourse.julialang.org/t/cant-capture-the-output-of-print-in-a-worker-process/34335 "2020-02-11T22:44:32Z")

</div>

Why is it that when I print() something in a worker process that doesn’t end with a newline char \\n, I don’t capture it in the stdout of the master process, but if I use println() I do? For example consider the followin…

---

## [I can't open the notebooks via IJulia](https://discourse.julialang.org/t/i-cant-open-the-notebooks-via-ijulia/34395)

<div class="topic-metadata">

**Author:** [@Pedro\_Luiz](https://discourse.julialang.org/u/Pedro_Luiz)\
**Replies:** 3\
**Last updated:** [February 10, 2020, 3:07pm UTC](https://discourse.julialang.org/t/i-cant-open-the-notebooks-via-ijulia/34395 "2020-02-10T15:07:04Z")

</div>

julia\> using IJulia julia\> notebook() \[ Info: running setenv(\`'C:\\Users\\Pedro Luiz\\.julia\\conda\\3\\Scripts\\jupyter.exe' notebook\`,\["PATH=C:\\\\Users\\\\Pedro Luiz\\\\.julia\\\\conda\\\\3\\\\Library\\\\bin;C:\\\\Users\\\\Pedro Luiz\\\\.julia…

---

## [Revise.jl with Parameters.jl erroneous "invalid redefinition of constant" in 1.3.1](https://discourse.julialang.org/t/revise-jl-with-parameters-jl-erroneous-invalid-redefinition-of-constant-in-1-3-1/34475)

<div class="topic-metadata">

**Author:** [@torgo](https://discourse.julialang.org/u/torgo)\
**Replies:** 3\
**Last updated:** [February 11, 2020, 6:07pm UTC](https://discourse.julialang.org/t/revise-jl-with-parameters-jl-erroneous-invalid-redefinition-of-constant-in-1-3-1/34475 "2020-02-11T18:07:56Z")

</div>

Here is a file called ReviseBehavior.jl module ReviseBehavior using Parameters @with\_kw struct MyStruct x::Array{\<:Real, 1} = \[.05\] end export MyStruct function foo() print("hello") end export foo end Here …

---

## [Help understanding CompatHelper error](https://discourse.julialang.org/t/help-understanding-compathelper-error/34369)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 7\
**Last updated:** [February 11, 2020, 4:01pm UTC](https://discourse.julialang.org/t/help-understanding-compathelper-error/34369 "2020-02-11T16:01:39Z")

</div>

A couple of days ago I begun getting errors from the CompatHelper Github action. For the life of me I can’t figure out how to fix it. Example of a failing job here: https://github.com/GenieFramework/Genie.jl/commit/c61…

---

## [Does inlining work when the function is passed as an argument?](https://discourse.julialang.org/t/does-inlining-work-when-the-function-is-passed-as-an-argument/34470)

<div class="topic-metadata">

**Author:** [@HenriDeh](https://discourse.julialang.org/u/HenriDeh)\
**Replies:** 2\
**Last updated:** [February 11, 2020, 3:55pm UTC](https://discourse.julialang.org/t/does-inlining-work-when-the-function-is-passed-as-an-argument/34470 "2020-02-11T15:55:40Z")

</div>

Just wondering. For example @inline function foo(x,y) @assert length(x) == length(y) x .+ y.\*rand(length(y)) end function apply\_function(x,y,f) f(x,y) end julia\> apply\_function(rand(10), rand(10), foo)

---

## [Draw text on Gtk canvas](https://discourse.julialang.org/t/draw-text-on-gtk-canvas/34462)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 4\
**Last updated:** [February 11, 2020, 3:19pm UTC](https://discourse.julialang.org/t/draw-text-on-gtk-canvas/34462 "2020-02-11T15:19:36Z")

</div>

I am trying to draw letters of a specific size, color, opacity, and location in a Gtk window. Here is an example of what the output might look like: example. I am able to draw rectangles with the following code: functi…

---

## [Problem evaluating symbol for macro inside function](https://discourse.julialang.org/t/problem-evaluating-symbol-for-macro-inside-function/30142)

<div class="topic-metadata">

**Author:** [@iloaiza](https://discourse.julialang.org/u/iloaiza)\
**Replies:** 4\
**Last updated:** [February 11, 2020, 2:37pm UTC](https://discourse.julialang.org/t/problem-evaluating-symbol-for-macro-inside-function/30142 "2020-02-11T14:37:18Z")

</div>

Hey! I have been trying to make a saving macro to simplify my life and skip having to do the full saving syntax while keeping track of what I’m saving where. To do this, I have started writing a module. The main macro is…

---

## [Unitful arguments to functions?](https://discourse.julialang.org/t/unitful-arguments-to-functions/34382)

<div class="topic-metadata">

**Author:** [@angelv](https://discourse.julialang.org/u/angelv)\
**Replies:** 6\
**Last updated:** [February 11, 2020, 2:03pm UTC](https://discourse.julialang.org/t/unitful-arguments-to-functions/34382 "2020-02-11T14:03:53Z")

</div>

Hi, just started using Unitful.jl, and it looks great. I wanted to define a function that takes, as a first argument, some length, and as second argument something inverse length. First one is no problem, but despite tr…

---

## [Difference between deepcopy() and deepcopy.() ? Do I have to broadcast deepcopy over lists?](https://discourse.julialang.org/t/difference-between-deepcopy-and-deepcopy-do-i-have-to-broadcast-deepcopy-over-lists/34460)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 3\
**Last updated:** [February 11, 2020, 10:55am UTC](https://discourse.julialang.org/t/difference-between-deepcopy-and-deepcopy-do-i-have-to-broadcast-deepcopy-over-lists/34460 "2020-02-11T10:55:49Z")

</div>

I have seen a behaviour that confused me a little bit. I have a list with structs (list\_of\_structs) and I selected specific indices of it with an integer array (idx\_array). When I then manipulate structs of the list\_of\_s…

---

## [Question about \`PackageCompiler.create\_sysimage\` parameters](https://discourse.julialang.org/t/question-about-packagecompiler-create-sysimage-parameters/34447)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 4\
**Last updated:** [February 11, 2020, 9:39am UTC](https://discourse.julialang.org/t/question-about-packagecompiler-create-sysimage-parameters/34447 "2020-02-11T09:39:08Z")

</div>

In particular, I want to understand what’s the difference between precompile\_execution\_file::Union{String, Vector{String}}: A file or list of files that contain code which precompilation statements should be reco…

---

## [How would I convert the key value pairs of an accumulator data structure to a dataframe](https://discourse.julialang.org/t/how-would-i-convert-the-key-value-pairs-of-an-accumulator-data-structure-to-a-dataframe/34438)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 1\
**Last updated:** [February 11, 2020, 7:58am UTC](https://discourse.julialang.org/t/how-would-i-convert-the-key-value-pairs-of-an-accumulator-data-structure-to-a-dataframe/34438 "2020-02-11T07:58:32Z")

</div>

Hi, I’m using the count function from the accumulator data structure from DataStructures.jl, and I’m getting exactly what I need, but I’m having a tough time extracting the values. I went to the source code and there ar…

---

## [Trouble with IJulia after upgrade to 1.3.1](https://discourse.julialang.org/t/trouble-with-ijulia-after-upgrade-to-1-3-1/34412)

<div class="topic-metadata">

**Author:** [@leiteiro](https://discourse.julialang.org/u/leiteiro)\
**Replies:** 8\
**Last updated:** [February 11, 2020, 6:40am UTC](https://discourse.julialang.org/t/trouble-with-ijulia-after-upgrade-to-1-3-1/34412 "2020-02-11T06:40:56Z")

</div>

After switching to Julia 1.3.1 IJulia does not work any more on my system. In the output below you can see what happened. The installation of Jupyter went well. But the call notebook() shows some info about the environm…

---

## [Performance gotcha in linear algebra lu()](https://discourse.julialang.org/t/performance-gotcha-in-linear-algebra-lu/18128)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 33\
**Last updated:** [February 11, 2020, 5:43am UTC](https://discourse.julialang.org/t/performance-gotcha-in-linear-algebra-lu/18128 "2020-02-11T05:43:02Z")

</div>

Curiosity killed the cat. I know. But I was curious: how would a naïve implementation of the LU factorization fare compared to what is built in and supported by BLAS 1, 2, 3? The result surprised me as I was able to beat…

---

## [ELI5: why is it not possible yet to create standalone binaries using Julia?](https://discourse.julialang.org/t/eli5-why-is-it-not-possible-yet-to-create-standalone-binaries-using-julia/34439)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 7\
**Last updated:** [February 11, 2020, 4:16am UTC](https://discourse.julialang.org/t/eli5-why-is-it-not-possible-yet-to-create-standalone-binaries-using-julia/34439 "2020-02-11T04:16:04Z")

</div>

Hi! My knowledge about compilers is very limited. I am wondering: since Julia creates machine code using LLVM, why I cannot compile standalone software? If I use PackageCompiler, for example, I can create a binary, but …

---

## [IJulia/Jupyter and Powershell](https://discourse.julialang.org/t/ijulia-jupyter-and-powershell/34434)

<div class="topic-metadata">

**Author:** [@David\_Ortley](https://discourse.julialang.org/u/David_Ortley)\
**Replies:** 1\
**Last updated:** [February 10, 2020, 9:18pm UTC](https://discourse.julialang.org/t/ijulia-jupyter-and-powershell/34434 "2020-02-10T21:18:44Z")

</div>

I’m trying to get Jupyter setup and running from the repl started in Powershell on Windows 10. While I finally was able to find the token by hunting for a jupyter executable in $HOME\\.julia\\conda\\3\\Scripts\\jupyter.exe, …

---

## [Is there a way cap memory usage to keep MyBinder from crashing?](https://discourse.julialang.org/t/is-there-a-way-cap-memory-usage-to-keep-mybinder-from-crashing/32325)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 1\
**Last updated:** [February 10, 2020, 7:14pm UTC](https://discourse.julialang.org/t/is-there-a-way-cap-memory-usage-to-keep-mybinder-from-crashing/32325 "2020-02-10T19:14:59Z")

</div>

MyBinder has a 2GB memory cap. I have a package which used to load fine on there, but recent compiler improvements in 1.3, which although they improve speed (thank you devs :pray:), it comes at the cost of more memory us…

---

## [How to find in Array of Pair?](https://discourse.julialang.org/t/how-to-find-in-array-of-pair/34426)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 1\
**Last updated:** [February 10, 2020, 6:16pm UTC](https://discourse.julialang.org/t/how-to-find-in-array-of-pair/34426 "2020-02-10T18:16:51Z")

</div>

Hot to find in head1 “Content-Type” ? ‘’’ julia\> head1 40-element Array{Pair{SubString{String},SubString{String}},1}: “Accept-Ranges” =\> “bytes” "Age" =\> "0" "Cache-C…

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

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