# General Usage

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

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

**Page:** 858

---

## [Retrieving the filename from a GtkFileChooserDialog](https://discourse.julialang.org/t/retrieving-the-filename-from-a-gtkfilechooserdialog/25337)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 1\
**Last updated:** [June 16, 2019, 11:08pm UTC](https://discourse.julialang.org/t/retrieving-the-filename-from-a-gtkfilechooserdialog/25337 "2019-06-16T23:08:55Z")

</div>

I’m looking to get the filename from a GtkFileChooserDialog and I feel like I’m close but I can’t figure out what I’m missing. I’ve read over: And that helped, but I’m getting: ERROR: LoadError: MethodError: no meth…

---

## [Very strange performance issue of a simple code](https://discourse.julialang.org/t/very-strange-performance-issue-of-a-simple-code/25347)

<div class="topic-metadata">

**Author:** [@Dandan](https://discourse.julialang.org/u/Dandan)\
**Replies:** 4\
**Last updated:** [June 16, 2019, 8:55pm UTC](https://discourse.julialang.org/t/very-strange-performance-issue-of-a-simple-code/25347 "2019-06-16T20:55:08Z")

</div>

I’ve just spot a very strange behavior of this simple Julia code function solve\_inner(N) invs = ones(Int32, N) for q=1:N invs\[q\] = 0 end function inner(n) return 0 end function wrapper(n) …

---

## [Question about methods defined for supertypes](https://discourse.julialang.org/t/question-about-methods-defined-for-supertypes/25343)

<div class="topic-metadata">

**Author:** [@phrmoy](https://discourse.julialang.org/u/phrmoy)\
**Replies:** 19\
**Last updated:** [June 16, 2019, 4:43pm UTC](https://discourse.julialang.org/t/question-about-methods-defined-for-supertypes/25343 "2019-06-16T16:43:28Z")

</div>

I am still new to Julia (about a year in and I am only starting to get it), so please bear with me. So I was wondering what I could do with the type Base.KeySet which has supertype AbstractSet{K} where K. Currently, met…

---

## [An assert statement makes my code run faster](https://discourse.julialang.org/t/an-assert-statement-makes-my-code-run-faster/25334)

<div class="topic-metadata">

**Author:** [@s-baumann](https://discourse.julialang.org/u/s-baumann)\
**Replies:** 5\
**Last updated:** [June 16, 2019, 1:09pm UTC](https://discourse.julialang.org/t/an-assert-statement-makes-my-code-run-faster/25334 "2019-06-16T13:09:07Z")

</div>

For a case below I get a faster result when I include an assert statement in my code. I include the functions with 5 runs of each case (not including the timing for the first compilation run) function with\_assert(f::Int…

---

## [Easiest way to turn a substring into a string?](https://discourse.julialang.org/t/easiest-way-to-turn-a-substring-into-a-string/25336)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 4\
**Last updated:** [June 16, 2019, 8:26am UTC](https://discourse.julialang.org/t/easiest-way-to-turn-a-substring-into-a-string/25336 "2019-06-16T08:26:28Z")

</div>

Sometimes I’m dealing with a function that only wants a String and not an AbstractString. // this usually occurs if you use someone else’s code and you have a SubString Is there a surefire way to convert a SubString t…

---

## [How to solve DDE with different constant lags](https://discourse.julialang.org/t/how-to-solve-dde-with-different-constant-lags/25330)

<div class="topic-metadata">

**Author:** [@zekeriya.sari](https://discourse.julialang.org/u/zekeriya.sari)\
**Replies:** 2\
**Last updated:** [June 15, 2019, 10:01pm UTC](https://discourse.julialang.org/t/how-to-solve-dde-with-different-constant-lags/25330 "2019-06-15T22:01:57Z")

</div>

I am trying to solve the following delay differential equation using DifferentialEquations.jl. \\dot{y\_1}(t) = y\_1(t - 1)\\\\ \\dot{y\_2}(t) = y\_1(t - 1) + y\_2(t - 0.2)\\\\ \\dot{y\_3}(t) = y\_2(t) The history function for t \\…

---

## [Problem porting SFML.jl to Julia 1.1](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029)

<div class="topic-metadata">

**Author:** [@dmolina](https://discourse.julialang.org/u/dmolina)\
**Replies:** 16\
**Last updated:** [June 15, 2019, 6:11pm UTC](https://discourse.julialang.org/t/problem-porting-sfml-jl-to-julia-1-1/20029 "2019-06-15T18:11:42Z")

</div>

I was very interested in porting SFML.jl (from nice work of zyedidia, https://github.com/zyedidia/SFML.jl) to current Julia, because it is not working for Julia 0.7 (and I like to use SFML in my programming introductor…

---

## [Maximum BLAS threads number](https://discourse.julialang.org/t/maximum-blas-threads-number/25320)

<div class="topic-metadata">

**Author:** [@shipengcheng1230](https://discourse.julialang.org/u/shipengcheng1230)\
**Replies:** 2\
**Last updated:** [June 15, 2019, 1:03am UTC](https://discourse.julialang.org/t/maximum-blas-threads-number/25320 "2019-06-15T01:03:53Z")

</div>

Hi, consider the following example: julia\> versioninfo() Julia Version 1.1.1 Commit 55e36cc308 (2019-05-16 04:10 UTC) Platform Info: OS: Linux (x86\_64-pc-linux-gnu) CPU: Intel(R) Xeon(R) Gold 6136 CPU @ 3.00GHz WO…

---

## [Makie.jl: How to plot a 3D sphere?](https://discourse.julialang.org/t/makie-jl-how-to-plot-a-3d-sphere/25302)

<div class="topic-metadata">

**Author:** [@machakann](https://discourse.julialang.org/u/machakann)\
**Replies:** 6\
**Last updated:** [June 15, 2019, 12:57am UTC](https://discourse.julialang.org/t/makie-jl-how-to-plot-a-3d-sphere/25302 "2019-06-15T00:57:56Z")

</div>

Hi, I just started to learn Makie.jl package and am facing a problem. I would like to make a 3D plot with scatter() function. When I tried to plot two spheres, I got what I expected. using Makie x = \[0, 1\] y = \[0, 1\] z…

---

## [Trying to understand memory usage](https://discourse.julialang.org/t/trying-to-understand-memory-usage/25316)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [June 14, 2019, 9:52pm UTC](https://discourse.julialang.org/t/trying-to-understand-memory-usage/25316 "2019-06-14T21:52:22Z")

</div>

I’m trying to understand memory usage and efficient coding of functions in Julia. Based on: using LinearAlgebra using BenchmarkTools consider the following 3 illustrative functions \[illustrating ideas; not the ones I w…

---

## [Improving performance of tensor contractions](https://discourse.julialang.org/t/improving-performance-of-tensor-contractions/25180)

<div class="topic-metadata">

**Author:** [@alvrg](https://discourse.julialang.org/u/alvrg)\
**Replies:** 7\
**Last updated:** [June 14, 2019, 9:18pm UTC](https://discourse.julialang.org/t/improving-performance-of-tensor-contractions/25180 "2019-06-14T21:18:40Z")

</div>

Hi all, I want to build a function that takes several tensors, contracts them, and outputs a tensor as a final result. I was using TensorOperations.jl as a draft, but I felt I could improve the performance making the co…

---

## [Functions copyto! and splat don't work with arrays with #undef 'values'](https://discourse.julialang.org/t/functions-copyto-and-splat-dont-work-with-arrays-with-undef-values/25322)

<div class="topic-metadata">

**Author:** [@Codyk12](https://discourse.julialang.org/u/Codyk12)\
**Replies:** 4\
**Last updated:** [June 14, 2019, 8:46pm UTC](https://discourse.julialang.org/t/functions-copyto-and-splat-dont-work-with-arrays-with-undef-values/25322 "2019-06-14T20:46:43Z")

</div>

The copyto!() function and splat(…) are unable to handle arrays with uninitialized values. Is this supposed to not work or reasons I’m not seeing, or should this be fixable? Here is an example: julia\> a = Array{String…

---

## [What do people use to make widgets?](https://discourse.julialang.org/t/what-do-people-use-to-make-widgets/25321)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 0\
**Last updated:** [June 14, 2019, 8:10pm UTC](https://discourse.julialang.org/t/what-do-people-use-to-make-widgets/25321 "2019-06-14T20:10:28Z")

</div>

Hi all, I made tetris last year and was interested in making a new video game widget. Does anyone know the current state of the widget ecosystem? What packages would be conducive to developing a javascript/css/html bas…

---

## [Reinterpret as a complex struct](https://discourse.julialang.org/t/reinterpret-as-a-complex-struct/24784)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 11\
**Last updated:** [June 14, 2019, 3:41pm UTC](https://discourse.julialang.org/t/reinterpret-as-a-complex-struct/24784 "2019-06-14T15:41:50Z")

</div>

Hi! There is a dataset loaded by a 3rd-party library in the form of a raw float array. I want to view this data as a vector of structs A, each having layout like this: \<F32\>\<F32\>\<F32\>(B\*8\*60\*3\*4)\<F32\>, i.e. three floats,…

---

## [Advice for building nested objects](https://discourse.julialang.org/t/advice-for-building-nested-objects/25269)

<div class="topic-metadata">

**Author:** [@Julia\_coder](https://discourse.julialang.org/u/Julia_coder)\
**Replies:** 2\
**Last updated:** [June 14, 2019, 2:42pm UTC](https://discourse.julialang.org/t/advice-for-building-nested-objects/25269 "2019-06-14T14:42:49Z")

</div>

Hello, I am looking for some advice on how to set up nested objects in Julia. For example, if I wanted to create “schoolchildren” (with variables “age”, “testGrade”,“favouriteSubject”) which are then grouped into “class…

---

## [Calling dll funtions](https://discourse.julialang.org/t/calling-dll-funtions/25301)

<div class="topic-metadata">

**Author:** [@rjsharp](https://discourse.julialang.org/u/rjsharp)\
**Replies:** 1\
**Last updated:** [June 14, 2019, 1:00pm UTC](https://discourse.julialang.org/t/calling-dll-funtions/25301 "2019-06-14T13:00:35Z")

</div>

Hello, I decided to learn Julia in order to automate some data analysis and some experiments in the Lab, still, I am struggling with some simple things… I am trying to call a couple of functions of a DLL file in order t…

---

## [@kwdef not working for parametric struct](https://discourse.julialang.org/t/kwdef-not-working-for-parametric-struct/25286)

<div class="topic-metadata">

**Author:** [@phrmoy](https://discourse.julialang.org/u/phrmoy)\
**Replies:** 5\
**Last updated:** [June 14, 2019, 8:57am UTC](https://discourse.julialang.org/t/kwdef-not-working-for-parametric-struct/25286 "2019-06-14T08:57:43Z")

</div>

Hi there, I am super excited about @kwdef being added to Base. I believe it’s a great feature to make the code more robust. With that said, I can’t seem to get it to work with a parametric struct: @kwdef struct A{T} …

---

## [ImageView/Gtk Unstable Results](https://discourse.julialang.org/t/imageview-gtk-unstable-results/25267)

<div class="topic-metadata">

**Author:** [@rand5](https://discourse.julialang.org/u/rand5)\
**Replies:** 1\
**Last updated:** [June 13, 2019, 8:26pm UTC](https://discourse.julialang.org/t/imageview-gtk-unstable-results/25267 "2019-06-13T20:26:59Z")

</div>

I’m working on some code using ImageView to show an image in a Gtk window and grab the (x,y) coordinate where the user clicks within the window. I based it on the Calling imshow from a script file section of the ImageVie…

---

## [Are there any fundamental parts of Julia's design or implementation that could limit its performance?](https://discourse.julialang.org/t/are-there-any-fundamental-parts-of-julias-design-or-implementation-that-could-limit-its-performance/25256)

<div class="topic-metadata">

**Author:** [@jackf](https://discourse.julialang.org/u/jackf)\
**Replies:** 6\
**Last updated:** [June 13, 2019, 7:07pm UTC](https://discourse.julialang.org/t/are-there-any-fundamental-parts-of-julias-design-or-implementation-that-could-limit-its-performance/25256 "2019-06-13T19:07:26Z")

</div>

Consider two programs, one written in Julia and one in, say, C++. The Julia program is well written: no type instabilities, not too many allocations, bounds checks disabled, etc. The two programs are structurally similar…

---

## [Is there something equivalent to setInterval() in JS? but in Julia? ](https://discourse.julialang.org/t/is-there-something-equivalent-to-setinterval-in-js-but-in-julia/15577)

<div class="topic-metadata">

**Author:** [@TheOnlyArtz](https://discourse.julialang.org/u/TheOnlyArtz)\
**Replies:** 5\
**Last updated:** [June 13, 2019, 5:12pm UTC](https://discourse.julialang.org/t/is-there-something-equivalent-to-setinterval-in-js-but-in-julia/15577 "2019-06-13T17:12:02Z")

</div>

Is there something equivalent to setInterval() in JS? but in Julia?

---

## [Tricky "too many parameters for type" error](https://discourse.julialang.org/t/tricky-too-many-parameters-for-type-error/25182)

<div class="topic-metadata">

**Author:** [@fverdugo](https://discourse.julialang.org/u/fverdugo)\
**Replies:** 12\
**Last updated:** [June 13, 2019, 2:38pm UTC](https://discourse.julialang.org/t/tricky-too-many-parameters-for-type-error/25182 "2019-06-13T14:38:24Z")

</div>

Dear Julia community, I get a “too many parameters for type” error that I cannot really understand. Luckily, I have been able (after some effort) to isolate the issue to a very small reproducer: module AAA abstract t…

---

## [How to export functions from an array in a module?](https://discourse.julialang.org/t/how-to-export-functions-from-an-array-in-a-module/25234)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 6\
**Last updated:** [June 13, 2019, 2:29pm UTC](https://discourse.julialang.org/t/how-to-export-functions-from-an-array-in-a-module/25234 "2019-06-13T14:29:11Z")

</div>

I am trying to do something like this julia\> module t a(x)=4 b(x)=x for f in \[a,b\] export f end end ERROR: syntax: malformed "export" statement Stacktrace: \[1\] top-level scope …

---

## [Name of julia source file?](https://discourse.julialang.org/t/name-of-julia-source-file/25246)

<div class="topic-metadata">

**Author:** [@DavidR](https://discourse.julialang.org/u/DavidR)\
**Replies:** 3\
**Last updated:** [June 13, 2019, 2:15pm UTC](https://discourse.julialang.org/t/name-of-julia-source-file/25246 "2019-06-13T14:15:56Z")

</div>

How can I obtain the name of the current (or main/top) julia source file, from within the code?

---

## [Vectorized sprintf](https://discourse.julialang.org/t/vectorized-sprintf/25248)

<div class="topic-metadata">

**Author:** [@lbilli](https://discourse.julialang.org/u/lbilli)\
**Replies:** 1\
**Last updated:** [June 13, 2019, 1:52pm UTC](https://discourse.julialang.org/t/vectorized-sprintf/25248 "2019-06-13T13:52:43Z")

</div>

What would be a Julia equivalent of the following R one liner? f \<- function(fmt, ...) paste(sprintf(fmt, ...), collapse=", ") f("%d %s", 1:3, LETTERS\[1:3\]) "1 A, 2 B, 3 C" I tried looping around Julia’s @sprintf but,…

---

## [How to use @debug](https://discourse.julialang.org/t/how-to-use-debug/25237)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 0\
**Last updated:** [June 13, 2019, 10:06am UTC](https://discourse.julialang.org/t/how-to-use-debug/25237 "2019-06-13T10:06:30Z")

</div>

julia\> ENV\["JULIA\_DEBUG"\]="all" "all" julia\> @debug for i=1:6 println("haha") end haha haha haha haha haha haha ┌ Error: Exception while generating log record in module Main at none:1 │ …

---

## [Read/write compressed files in julia 0.7](https://discourse.julialang.org/t/read-write-compressed-files-in-julia-0-7/24791)

<div class="topic-metadata">

**Author:** [@Herb](https://discourse.julialang.org/u/Herb)\
**Replies:** 3\
**Last updated:** [June 13, 2019, 4:51am UTC](https://discourse.julialang.org/t/read-write-compressed-files-in-julia-0-7/24791 "2019-06-13T04:51:37Z")

</div>

I’ve written extensive code in julia 0.6.3 using GZip to read and write compressed files. julia 0.7 doesn’t understand GZip. What am I doing wrong?

---

## [Getting Error to load dataset in Julia v1.1.1](https://discourse.julialang.org/t/getting-error-to-load-dataset-in-julia-v1-1-1/25202)

<div class="topic-metadata">

**Author:** [@shahriariit](https://discourse.julialang.org/u/shahriariit)\
**Replies:** 1\
**Last updated:** [June 12, 2019, 10:09pm UTC](https://discourse.julialang.org/t/getting-error-to-load-dataset-in-julia-v1-1-1/25202 "2019-06-12T22:09:34Z")

</div>

I try to load following code using DataFrames, Query, CSV, JLD2, StatsBase, MLLabelUtils, Random include("chp3\_functions.jl") Random.seed!(24908) ## Types for the files columns IntOrMiss = Union{Int64,Missing} FltOrMis…

---

## [Parsing Float32 literals](https://discourse.julialang.org/t/parsing-float32-literals/25204)

<div class="topic-metadata">

**Author:** [@DNF](https://discourse.julialang.org/u/DNF)\
**Replies:** 3\
**Last updated:** [June 12, 2019, 8:19pm UTC](https://discourse.julialang.org/t/parsing-float32-literals/25204 "2019-06-12T20:19:12Z")

</div>

This caught me by surprise: julia\> parse(Float32, "1.0f0") ERROR: ArgumentError: cannot parse "1.0f0" as Float32 Float32 seems special julia\> x = UInt8(1) 0x01 julia\> parse(typeof(x), repr(x)) 0x01 julia\> x = UInt16…

---

## [What show function is called in the REPL?](https://discourse.julialang.org/t/what-show-function-is-called-in-the-repl/3262)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 8\
**Last updated:** [June 12, 2019, 7:25pm UTC](https://discourse.julialang.org/t/what-show-function-is-called-in-the-repl/3262 "2019-06-12T19:25:01Z")

</div>

I assumed it was just show but at least for arrays something else is going on: julia\> rand(3,3) 3×3 Array{Float64,2}: 0.945084 0.86556 0.727404 0.128891 0.180756 0.228008 0.0498265 0.639407 0.20455 julia\> …

---

## [Is a .osm file of size 668.7 MB too big for the following operations?](https://discourse.julialang.org/t/is-a-osm-file-of-size-668-7-mb-too-big-for-the-following-operations/25146)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 23\
**Last updated:** [June 12, 2019, 7:20pm UTC](https://discourse.julialang.org/t/is-a-osm-file-of-size-668-7-mb-too-big-for-the-following-operations/25146 "2019-06-12T19:20:57Z")

</div>

Hi, I was trying the following code, but with no lucks. It seems like my computer has no responses. The code: \> using OpenStreetMapX \> mx = get\_map\_data("test/data/reno\_east3.osm",use\_cache=false); \> using Random \> Ran…

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

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