# General Usage

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

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

**Page:** 873

---

## [Gtk and Cairo Working?](https://discourse.julialang.org/t/gtk-and-cairo-working/23332)

<div class="topic-metadata">

**Author:** [@RichardAnaya](https://discourse.julialang.org/u/RichardAnaya)\
**Replies:** 14\
**Last updated:** [April 24, 2019, 1:30pm UTC](https://discourse.julialang.org/t/gtk-and-cairo-working/23332 "2019-04-24T13:30:46Z")

</div>

I’ve been having difficulty getting basic drawing going with Cairo and Gtk. The examples don’t seem to be working due to a type issue with what Gtk returns as a context and what Cairo expects. using Gtk, Graphics c = Gt…

---

## [Help with numerical accuracy when solving a system of 300 ODE's using DifferentialEquations.jl](https://discourse.julialang.org/t/help-with-numerical-accuracy-when-solving-a-system-of-300-odes-using-differentialequations-jl/23468)

<div class="topic-metadata">

**Author:** [@luis\_munoz](https://discourse.julialang.org/u/luis_munoz)\
**Replies:** 1\
**Last updated:** [April 24, 2019, 12:04pm UTC](https://discourse.julialang.org/t/help-with-numerical-accuracy-when-solving-a-system-of-300-odes-using-differentialequations-jl/23468 "2019-04-24T12:04:12Z")

</div>

Hello, I have difficulties to accurately solve my stiff ODE system which contains 300 nonlinear differential equations representing the motion (position, velocity and state) of 100 inter-connected blocks. A basic workin…

---

## [Implementing a zero width type for IntervalSets](https://discourse.julialang.org/t/implementing-a-zero-width-type-for-intervalsets/23444)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 7\
**Last updated:** [April 24, 2019, 9:22am UTC](https://discourse.julialang.org/t/implementing-a-zero-width-type-for-intervalsets/23444 "2019-04-24T09:22:05Z")

</div>

This is about using the foundations of IntervalSets.jl for my own purposes. I’d like to be able to dispatch on sets that have zero width (i.e. sets whose end points are identical) differently than on sets with a width l…

---

## [Problem with plotting ‘scatter3d’ for data with an element number greater than some specific number](https://discourse.julialang.org/t/problem-with-plotting-scatter3d-for-data-with-an-element-number-greater-than-some-specific-number/14621)

<div class="topic-metadata">

**Author:** [@AlinJulia](https://discourse.julialang.org/u/AlinJulia)\
**Replies:** 6\
**Last updated:** [April 24, 2019, 1:11am UTC](https://discourse.julialang.org/t/problem-with-plotting-scatter3d-for-data-with-an-element-number-greater-than-some-specific-number/14621 "2019-04-24T01:11:01Z")

</div>

I’m exploring ‘Julia v1’ and I run into a problem regarding the ‘scatter3d’ plotting of my data. Interestingly, I don’t get any plot, when I increase the element (column) number over a threshold number 8517. I am wonderi…

---

## [Two issues related to \`ccall\`](https://discourse.julialang.org/t/two-issues-related-to-ccall/23388)

<div class="topic-metadata">

**Author:** [@cuihantao](https://discourse.julialang.org/u/cuihantao)\
**Replies:** 9\
**Last updated:** [April 23, 2019, 7:07pm UTC](https://discourse.julialang.org/t/two-issues-related-to-ccall/23388 "2019-04-23T19:07:31Z")

</div>

Hi there, This is a follow-up of Issue #27477. Running Julia 1.1.0 on darwin64. module B using Cairo lib\_path = Cairo.\_jl\_libcairo test() = ccall((:cairo\_version\_string, lib\_path)…

---

## [Printing the body of a defined function](https://discourse.julialang.org/t/printing-the-body-of-a-defined-function/23439)

<div class="topic-metadata">

**Author:** [@srb](https://discourse.julialang.org/u/srb)\
**Replies:** 2\
**Last updated:** [April 23, 2019, 4:09pm UTC](https://discourse.julialang.org/t/printing-the-body-of-a-defined-function/23439 "2019-04-23T16:09:29Z")

</div>

If I define a function as follows: f(x,y) = x^2 + y Is there a way that I acces the body of the function without evaluating it? As in, I would like to do print(f) and for it to show "x^2 + y"

---

## [Multiple loops](https://discourse.julialang.org/t/multiple-loops/23422)

<div class="topic-metadata">

**Author:** [@Baicai\_Xiao](https://discourse.julialang.org/u/Baicai_Xiao)\
**Replies:** 9\
**Last updated:** [April 23, 2019, 3:52pm UTC](https://discourse.julialang.org/t/multiple-loops/23422 "2019-04-23T15:52:09Z")

</div>

Hello, I tried to write some code on multiple but unknown number of loops. But didn’t find ways to do it. Can someone give me a hint? Thanks in advanced. Suppose I have an array a = \[2,3,4,5\] I want to write a loop t…

---

## [Removing small elements from a sparse matrix](https://discourse.julialang.org/t/removing-small-elements-from-a-sparse-matrix/23405)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 10\
**Last updated:** [April 23, 2019, 2:31pm UTC](https://discourse.julialang.org/t/removing-small-elements-from-a-sparse-matrix/23405 "2019-04-23T14:31:29Z")

</div>

Hi, I am interested in removing entries in a sparse (SparseMatrixCSC{Float64,Int64}) matrix which are very small, for example, less than 1E-16 in absolute value. Often in the middle of operations with sparse matrices, th…

---

## [Request: Help with NLE System - variable number of equations](https://discourse.julialang.org/t/request-help-with-nle-system-variable-number-of-equations/23446)

<div class="topic-metadata">

**Author:** [@Ulrich](https://discourse.julialang.org/u/Ulrich)\
**Replies:** 0\
**Last updated:** [April 23, 2019, 2:31pm UTC](https://discourse.julialang.org/t/request-help-with-nle-system-variable-number-of-equations/23446 "2019-04-23T14:31:14Z")

</div>

Hello, I am trying to write a program for the Calculation of Vapor Liquid Equilibrium by using energy and mass balances. I am currently using NLsolve.jl. My problem is that I want the system of equations to be created …

---

## [Multiple dispatch in an inner method](https://discourse.julialang.org/t/multiple-dispatch-in-an-inner-method/23434)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 3\
**Last updated:** [April 23, 2019, 1:05pm UTC](https://discourse.julialang.org/t/multiple-dispatch-in-an-inner-method/23434 "2019-04-23T13:05:18Z")

</div>

I seem to need to use multiple dispatch in an inner constructor. I’ve never needed it before, nor can I find any information about it in the docs, thought I’d ask here. Is there any particular problem or aspect I need to…

---

## [Providing length info to filters](https://discourse.julialang.org/t/providing-length-info-to-filters/23406)

<div class="topic-metadata">

**Author:** [@ksamtsak](https://discourse.julialang.org/u/ksamtsak)\
**Replies:** 3\
**Last updated:** [April 23, 2019, 10:50am UTC](https://discourse.julialang.org/t/providing-length-info-to-filters/23406 "2019-04-23T10:50:18Z")

</div>

Iterator filters don’t know the length of their output by default. However, there are cases where the program logic makes the length of the output known. How can we provide this info to improve the performance of subsequ…

---

## [Limits of type inference](https://discourse.julialang.org/t/limits-of-type-inference/22868)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 6\
**Last updated:** [April 23, 2019, 8:10am UTC](https://discourse.julialang.org/t/limits-of-type-inference/22868 "2019-04-23T08:10:42Z")

</div>

Hi julia developers, just stumbled upon a limitation in typeinference and minified it to the following example. The example is actually quite similar to my real usecase, where I like to define a generic map for multipl…

---

## [Unnecessary compilation happening on every call](https://discourse.julialang.org/t/unnecessary-compilation-happening-on-every-call/17558)

<div class="topic-metadata">

**Author:** [@lwabeke](https://discourse.julialang.org/u/lwabeke)\
**Replies:** 15\
**Last updated:** [April 23, 2019, 8:03am UTC](https://discourse.julialang.org/t/unnecessary-compilation-happening-on-every-call/17558 "2019-04-23T08:03:54Z")

</div>

I seem to have a case where the function gets compiled on almost every call. This is annoyingly slow. julia\> notice(logger, "Before call"); qlp\_run() \[2018-11-15 16:13:13 | notice | root\]: Before call \[2018-11-15 16:14:…

---

## [Plot a raster matrix with national borders from a shape file?](https://discourse.julialang.org/t/plot-a-raster-matrix-with-national-borders-from-a-shape-file/23258)

<div class="topic-metadata">

**Author:** [@Raf](https://discourse.julialang.org/u/Raf)\
**Replies:** 1\
**Last updated:** [April 23, 2019, 5:11am UTC](https://discourse.julialang.org/t/plot-a-raster-matrix-with-national-borders-from-a-shape-file/23258 "2019-04-23T05:11:20Z")

</div>

I have a matrix of raster data, the original NetCDF file with projection data etc, and a shape file. Is there an easy way to accurately plot the matrix as a heatmap with a border supplied by the shapefile?

---

## [Segmentation fault when extending occursin to handle missing values](https://discourse.julialang.org/t/segmentation-fault-when-extending-occursin-to-handle-missing-values/23421)

<div class="topic-metadata">

**Author:** [@kmundnic](https://discourse.julialang.org/u/kmundnic)\
**Replies:** 1\
**Last updated:** [April 23, 2019, 2:01am UTC](https://discourse.julialang.org/t/segmentation-fault-when-extending-occursin-to-handle-missing-values/23421 "2019-04-23T02:01:27Z")

</div>

Minimal working example (for both v1.0.3 and v1.1.0): import Base: occursin function occursin(needle::String, haystack::Union{String,Missing}) if !ismissing(haystack) return occursin(needle, haystack) else …

---

## [Uni-directional communication in ElasticManager?](https://discourse.julialang.org/t/uni-directional-communication-in-elasticmanager/23418)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 0\
**Last updated:** [April 22, 2019, 7:41pm UTC](https://discourse.julialang.org/t/uni-directional-communication-in-elasticmanager/23418 "2019-04-22T19:41:35Z")

</div>

I posted this at Uni-directional communication in ElasticManager? · Issue #113 · JuliaParallel/ClusterManagers.jl · GitHub but that repo is pretty quiet plus I think there’s a wider audience here with Julia Distributed k…

---

## [How to get a markdown repr of an object? (MIME type fallbacks)](https://discourse.julialang.org/t/how-to-get-a-markdown-repr-of-an-object-mime-type-fallbacks/23242)

<div class="topic-metadata">

**Author:** [@oxinabox](https://discourse.julialang.org/u/oxinabox)\
**Replies:** 5\
**Last updated:** [April 22, 2019, 3:14pm UTC](https://discourse.julialang.org/t/how-to-get-a-markdown-repr-of-an-object-mime-type-fallbacks/23242 "2019-04-22T15:14:20Z")

</div>

repr takes a mimetype arguement. Sometimes, it is evan used. e.g. julia\> repr("text/html",Docs.html"\<b\>foo\</b\>") "\<b\>foo\</b\>" julia\> repr("text/markdown", "foo") "foo" Mostly though it is not: julia\> repr("text/mar…

---

## [Error in command line arg --project with "~"](https://discourse.julialang.org/t/error-in-command-line-arg-project-with/23307)

<div class="topic-metadata">

**Author:** [@v-i-s-h](https://discourse.julialang.org/u/v-i-s-h)\
**Replies:** 12\
**Last updated:** [April 22, 2019, 1:50pm UTC](https://discourse.julialang.org/t/error-in-command-line-arg-project-with/23307 "2019-04-22T13:50:36Z")

</div>

I was testing a package and want to set the package as my project directory for test. When I pass my relative path ~/.julia/dev/Gym/ as --project=, the following error occurs. vish@eliteone:~/.julia/dev/Gym$ julia --pr…

---

## [Luxor and the Juno plots panel](https://discourse.julialang.org/t/luxor-and-the-juno-plots-panel/23397)

<div class="topic-metadata">

**Author:** [@harisf](https://discourse.julialang.org/u/harisf)\
**Replies:** 4\
**Last updated:** [April 22, 2019, 12:21pm UTC](https://discourse.julialang.org/t/luxor-and-the-juno-plots-panel/23397 "2019-04-22T12:21:34Z")

</div>

I ran into a minor annoyance while using Luxor.jl to draw simple shapes: the drawing doesn’t show centered in the Juno plots panel, but is “zoomed in”. So when I run @svg begin juliacircles() end I have to scroll …

---

## [Hosting Web Apps in Julia](https://discourse.julialang.org/t/hosting-web-apps-in-julia/1063)

<div class="topic-metadata">

**Author:** [@ChrisRackauckas](https://discourse.julialang.org/u/ChrisRackauckas)\
**Replies:** 61\
**Last updated:** [April 22, 2019, 4:22am UTC](https://discourse.julialang.org/t/hosting-web-apps-in-julia/1063 "2019-04-22T04:22:28Z")

</div>

Hey, I am curious as to the current state of web apps in Julia. I have already started playing around with Escher.jl, and was wondering if it would be possible to host such creations online. Does anyone know if this is p…

---

## [Julia 1.0.2, EMERGECONFLICT with pkg update](https://discourse.julialang.org/t/julia-1-0-2-emergeconflict-with-pkg-update/23383)

<div class="topic-metadata">

**Author:** [@ko56](https://discourse.julialang.org/u/ko56)\
**Replies:** 1\
**Last updated:** [April 22, 2019, 12:57am UTC](https://discourse.julialang.org/t/julia-1-0-2-emergeconflict-with-pkg-update/23383 "2019-04-22T00:57:52Z")

</div>

This error started happening to me this morning. Does anyone have any ideas about how to fix it? Thanks. \_ \_ \_ ()\_ | Documentation: https://docs.julialang.org () | () () | \_ \_ | | \_\_ …

---

## [Method forwarding macro](https://discourse.julialang.org/t/method-forwarding-macro/23355)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 8\
**Last updated:** [April 21, 2019, 8:40pm UTC](https://discourse.julialang.org/t/method-forwarding-macro/23355 "2019-04-21T20:40:54Z")

</div>

MacroTools.jl defines a @forward macro but it’s in the examples folder. Lazy.jl exports its own version of the same macro but it’s not documented in the README. Come to think of it, while the @forward macro is quite us…

---

## [Do you need to root modules, functions and symbols?](https://discourse.julialang.org/t/do-you-need-to-root-modules-functions-and-symbols/23377)

<div class="topic-metadata">

**Author:** [@kim366](https://discourse.julialang.org/u/kim366)\
**Replies:** 2\
**Last updated:** [April 21, 2019, 7:07pm UTC](https://discourse.julialang.org/t/do-you-need-to-root-modules-functions-and-symbols/23377 "2019-04-21T19:07:11Z")

</div>

I have noticed that jl\_sym\_t values do not seem to be rooted anywhere in the source and just live for the duration of the program. I would suspect the same is true for functions and modules, is this correct? If so, is th…

---

## [Macro to deduce the filepath of the file that calls a specific function](https://discourse.julialang.org/t/macro-to-deduce-the-filepath-of-the-file-that-calls-a-specific-function/23371)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 6\
**Last updated:** [April 21, 2019, 6:26pm UTC](https://discourse.julialang.org/t/macro-to-deduce-the-filepath-of-the-file-that-calls-a-specific-function/23371 "2019-04-21T18:26:36Z")

</div>

I want to write a macro for the package DrWatson that does the following: I define a macro @m and a function f inside DrWatson. Now, when the function f is called in a script somewhere, I want to be able inside f to res…

---

## [Cairo.jl / Luxor.jl alternatives (segfaults)](https://discourse.julialang.org/t/cairo-jl-luxor-jl-alternatives-segfaults/21831)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 5\
**Last updated:** [April 21, 2019, 4:24pm UTC](https://discourse.julialang.org/t/cairo-jl-luxor-jl-alternatives-segfaults/21831 "2019-04-21T16:24:07Z")

</div>

I would like to create a meme generator API for a Julia blog post - and I wanted to use Luxor.jl for loading an image and adding some text on top of it. However Cairo.jl segfaults upon installation. Are there any other l…

---

## [Unconsistent range object behavior](https://discourse.julialang.org/t/unconsistent-range-object-behavior/23351)

<div class="topic-metadata">

**Author:** [@wizebt](https://discourse.julialang.org/u/wizebt)\
**Replies:** 3\
**Last updated:** [April 20, 2019, 7:53pm UTC](https://discourse.julialang.org/t/unconsistent-range-object-behavior/23351 "2019-04-20T19:53:43Z")

</div>

New to Julia migrating my code from Octave I encountered a very strange error. Same piece of code works fine when sequential julia\> include(“test.jl”) a\[y,x\]\[8 9 6 6 4; 4 7 2 5 3; 5 6 9 2 1; 5 3 4 3 3; 7 8 6 2 3\] 2:6 …

---

## [Crash when using \`@info\` during type conversion](https://discourse.julialang.org/t/crash-when-using-info-during-type-conversion/23354)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 2\
**Last updated:** [April 20, 2019, 6:26pm UTC](https://discourse.julialang.org/t/crash-when-using-info-during-type-conversion/23354 "2019-04-20T18:26:39Z")

</div>

MWE: julia\> abstract type S end julia\> struct S1 \<: S end julia\> struct S2 \<: S end julia\> s1 = S1() S1() julia\> @info(s1) \[ Info: S1() julia\> Base.convert(S2, x::S1) = begin @info(x); S2(); end julia\> struct Foo …

---

## [Allow foldr operation for Strings?](https://discourse.julialang.org/t/allow-foldr-operation-for-strings/23343)

<div class="topic-metadata">

**Author:** [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Replies:** 3\
**Last updated:** [April 20, 2019, 6:11pm UTC](https://discourse.julialang.org/t/allow-foldr-operation-for-strings/23343 "2019-04-20T18:11:04Z")

</div>

Currently, if users want to achieve foldr on a String, they have to choose one from the alternatives below as their workaround: collect the string and get a char array, and foldr among this array, causing redundant co…

---

## ["invalid assignment location" on function call returning view](https://discourse.julialang.org/t/invalid-assignment-location-on-function-call-returning-view/23346)

<div class="topic-metadata">

**Author:** [@grahamas](https://discourse.julialang.org/u/grahamas)\
**Replies:** 5\
**Last updated:** [April 20, 2019, 4:15pm UTC](https://discourse.julialang.org/t/invalid-assignment-location-on-function-call-returning-view/23346 "2019-04-20T16:15:22Z")

</div>

I get an error trying to assign to the view result of a function call directly, but not when assigning to that same view after saving it in a variable. I can’t figure out why. @generated function view\_slice\_last(arr::Ar…

---

## [Macro to generate do block](https://discourse.julialang.org/t/macro-to-generate-do-block/23324)

<div class="topic-metadata">

**Author:** [@MaxPauer](https://discourse.julialang.org/u/MaxPauer)\
**Replies:** 2\
**Last updated:** [April 20, 2019, 3:55pm UTC](https://discourse.julialang.org/t/macro-to-generate-do-block/23324 "2019-04-20T15:55:20Z")

</div>

I use a lot of code that looks like this foo(arg1, arg2) do bar bar.this = 5 bar.that = 6 end What I initially wanted to do is replace the repetitive "bar"s by defining macros for “this” and “that”, which seems e…

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

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