# General Usage

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

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

**Page:** 1008

---

## [Can the @unpack\_STRUCT macro in Parameters.jl be type stable?](https://discourse.julialang.org/t/can-the-unpack-struct-macro-in-parameters-jl-be-type-stable/7873)

<div class="topic-metadata">

**Author:** [@NickNack](https://discourse.julialang.org/u/NickNack)\
**Replies:** 3\
**Last updated:** [December 20, 2017, 11:12am UTC](https://discourse.julialang.org/t/can-the-unpack-struct-macro-in-parameters-jl-be-type-stable/7873 "2017-12-20T11:12:27Z")

</div>

I want to use the @unpack\_STRUCT macro in Parameters.jl to unpack all fields of a mutable struct, but I need it to be type stable. Here is an example: using Parameters, BenchmarkTools @with\_kw mutable struct S @deftype…

---

## [Sparse matrix-vector product: much more slow than Matlab](https://discourse.julialang.org/t/sparse-matrix-vector-product-much-more-slow-than-matlab/7840)

<div class="topic-metadata">

**Author:** [@hongyan](https://discourse.julialang.org/u/hongyan)\
**Replies:** 24\
**Last updated:** [December 20, 2017, 10:13am UTC](https://discourse.julialang.org/t/sparse-matrix-vector-product-much-more-slow-than-matlab/7840 "2017-12-20T10:13:56Z")

</div>

Hi guys, I’m very new in Julia and recently I’m doing some sparse matrix-vector calculations and want to transfer to Julia from Matlab. It turns out for the same codes, it takes Matlab about 2 seconds, but about 98 seco…

---

## [How do you clear cache from a \_\_precompile\_\_()?](https://discourse.julialang.org/t/how-do-you-clear-cache-from-a-precompile/7821)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [December 20, 2017, 6:56am UTC](https://discourse.julialang.org/t/how-do-you-clear-cache-from-a-precompile/7821 "2017-12-20T06:56:27Z")

</div>

Sometimes it’s difficult to debug a package that’s precompiled. What’s the most succinct way to clear its cache w/o just removing the package and reinstalling it? i.e. the following code doesn’t seem to clear everythin…

---

## [Display the functions, procedures and dependencies](https://discourse.julialang.org/t/display-the-functions-procedures-and-dependencies/7854)

<div class="topic-metadata">

**Author:** [@Balasubramanian\_Shar](https://discourse.julialang.org/u/Balasubramanian_Shar)\
**Replies:** 4\
**Last updated:** [December 20, 2017, 2:01am UTC](https://discourse.julialang.org/t/display-the-functions-procedures-and-dependencies/7854 "2017-12-20T02:01:12Z")

</div>

Hi, I am new to julia. I want to know is there any tool available to analyze the code and display the dependecies of functions, procedures, tables, api and external files? Also I want to know the possibility of using …

---

## [Julia cookbook still relevant? sample statistical analyses sessions?](https://discourse.julialang.org/t/julia-cookbook-still-relevant-sample-statistical-analyses-sessions/7823)

<div class="topic-metadata">

**Author:** [@ivo\_welch](https://discourse.julialang.org/u/ivo_welch)\
**Replies:** 3\
**Last updated:** [December 19, 2017, 10:45pm UTC](https://discourse.julialang.org/t/julia-cookbook-still-relevant-sample-statistical-analyses-sessions/7823 "2017-12-19T22:45:09Z")

</div>

\[1\] the coverage of julia’s cookbook by jalem rohit looks nice, but it is from mid-2016 and I know that julia has recently changed quite a bit. is it still recommendable? \[2\] I am looking for a variety of short statist…

---

## [Let expression and garbage collection](https://discourse.julialang.org/t/let-expression-and-garbage-collection/7804)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 2\
**Last updated:** [December 19, 2017, 8:48pm UTC](https://discourse.julialang.org/t/let-expression-and-garbage-collection/7804 "2017-12-19T20:48:52Z")

</div>

Not sure if this is a bug, or if I misunderstand something about let. But I think in the following snipped ret is unreachable, when gc() runs, yet it does not get collected. function f end let ret = \[\] finalize…

---

## [Error deleting file](https://discourse.julialang.org/t/error-deleting-file/7787)

<div class="topic-metadata">

**Author:** [@Jeremy](https://discourse.julialang.org/u/Jeremy)\
**Replies:** 6\
**Last updated:** [December 19, 2017, 3:57pm UTC](https://discourse.julialang.org/t/error-deleting-file/7787 "2017-12-19T15:57:13Z")

</div>

My code unzips a data file, loads it, and deletes the temporary file. It has worked fine in the past but now it fails on the line that deletes the file. It happens in a module I’m working on, ClimateDataIO.jl in ghg\_read…

---

## [Dispatch on AxisArrays with Unitful axis](https://discourse.julialang.org/t/dispatch-on-axisarrays-with-unitful-axis/7733)

<div class="topic-metadata">

**Author:** [@phlavenk](https://discourse.julialang.org/u/phlavenk)\
**Replies:** 2\
**Last updated:** [December 19, 2017, 8:35am UTC](https://discourse.julialang.org/t/dispatch-on-axisarrays-with-unitful-axis/7733 "2017-12-19T08:35:10Z")

</div>

Hello, I’m relying heavily on the use of Unitful units together with AxisArrays. when I try to dispatch on the specific AxisArray from the physics point of view, I end up writing a unreadable code full of where clauses,…

---

## [Using module does not work with SSH remote workers](https://discourse.julialang.org/t/using-module-does-not-work-with-ssh-remote-workers/7825)

<div class="topic-metadata">

**Author:** [@jebej](https://discourse.julialang.org/u/jebej)\
**Replies:** 11\
**Last updated:** [December 18, 2017, 6:36pm UTC](https://discourse.julialang.org/t/using-module-does-not-work-with-ssh-remote-workers/7825 "2017-12-18T18:36:36Z")

</div>

From what I understand, using Module should use the module available on the master process, and send it to the workers. However, it is not working for me: julia\> addprocs(\[("admin@some.server",4)\],exename="julia",dir="/…

---

## [How is reduce function initialized?](https://discourse.julialang.org/t/how-is-reduce-function-initialized/7832)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 5\
**Last updated:** [December 18, 2017, 11:17am UTC](https://discourse.julialang.org/t/how-is-reduce-function-initialized/7832 "2017-12-18T11:17:37Z")

</div>

Is this normal? julia\> a = reduce(0, 1:4) do x,y x += y \< -1 end 0 julia\> a = reduce(1:4) do x,y x += y \< -1 end 1 I’d expect both to result in zero.

---

## [SomeType{T} where T:\>SomeOtherType](https://discourse.julialang.org/t/sometype-t-where-t-someothertype/7815)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 3\
**Last updated:** [December 18, 2017, 10:17am UTC](https://discourse.julialang.org/t/sometype-t-where-t-someothertype/7815 "2017-12-18T10:17:16Z")

</div>

Is there good documentation about what this means: SomeType{T} where T:\>SomeOtherType and more generally: SomeType{T} where SomeOtherType\<:T\<:YetAnotherype I get this strange? result: julia\> Vector{Number}\<:Vector{T…

---

## [Mysterious error: undefined variable](https://discourse.julialang.org/t/mysterious-error-undefined-variable/7819)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 3\
**Last updated:** [December 18, 2017, 1:38am UTC](https://discourse.julialang.org/t/mysterious-error-undefined-variable/7819 "2017-12-18T01:38:09Z")

</div>

Below is a simple program to integrate acceleration and velocity via Forward Euler. I received an error message (below) that vel is undefined; I can’t figure out what is causing this. The program is OK if I initialize …

---

## [Regular Expressions - Can't Insert \\t in Replacement String](https://discourse.julialang.org/t/regular-expressions-cant-insert-t-in-replacement-string/7419)

<div class="topic-metadata">

**Author:** [@MLackner](https://discourse.julialang.org/u/MLackner)\
**Replies:** 9\
**Last updated:** [December 18, 2017, 1:04am UTC](https://discourse.julialang.org/t/regular-expressions-cant-insert-t-in-replacement-string/7419 "2017-12-18T01:04:40Z")

</div>

Hi! I’m not an expert in regular expressions and this seems like a trivial problem to me. Unfortunatley I couldn’t find anything by googling. Problem: I want to replace a \\s in a regular expression with \\t. This is wha…

---

## [Boot.jl – An attempt at loading folders](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 8\
**Last updated:** [December 17, 2017, 11:24pm UTC](https://discourse.julialang.org/t/boot-jl-an-attempt-at-loading-folders/7681 "2017-12-17T23:24:39Z")

</div>

Wrote a package after thinking about Packages, modules, and files. The main goal was: to ease the burden of loading files with robust recursive includes over package subdirectories Example from Readme Transform…

---

## [Option, Some , None vs Nullable](https://discourse.julialang.org/t/option-some-none-vs-nullable/7518)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 5\
**Last updated:** [December 17, 2017, 5:41am UTC](https://discourse.julialang.org/t/option-some-none-vs-nullable/7518 "2017-12-17T05:41:59Z")

</div>

Is there a package which gives Option, Some and None. And why does Julia prefer Nullable? Thanks

---

## [Casting a ReinterpretArray to Array without significant allocations](https://discourse.julialang.org/t/casting-a-reinterpretarray-to-array-without-significant-allocations/7808)

<div class="topic-metadata">

**Author:** [@mohamed82008](https://discourse.julialang.org/u/mohamed82008)\
**Replies:** 2\
**Last updated:** [December 17, 2017, 12:17am UTC](https://discourse.julialang.org/t/casting-a-reinterpretarray-to-array-without-significant-allocations/7808 "2017-12-17T00:17:18Z")

</div>

I noticed in v0.7 that if I want a Vector out of a reinterpret operation rather than a ReinterpretArray that using the Vector constructor to do the conversion comes with a significant allocation cost proportional to the …

---

## [Documentation for \`blasfunc\` and \`@blasfunc\`](https://discourse.julialang.org/t/documentation-for-blasfunc-and-blasfunc/7801)

<div class="topic-metadata">

**Author:** [@chobbes](https://discourse.julialang.org/u/chobbes)\
**Replies:** 4\
**Last updated:** [December 16, 2017, 11:11pm UTC](https://discourse.julialang.org/t/documentation-for-blasfunc-and-blasfunc/7801 "2017-12-16T23:11:57Z")

</div>

They both live in Base.BLAS. But I just couldn’t find the doc for either of them here or even the entire site of Julia Doc. Any pointer is much appreciated!!

---

## [Is there a way to minify Julia files?](https://discourse.julialang.org/t/is-there-a-way-to-minify-julia-files/7702)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 1\
**Last updated:** [December 16, 2017, 9:23pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-minify-julia-files/7702 "2017-12-16T21:23:44Z")

</div>

Let’s say you have a file like: # Common methods for all \`Values\` objects const ScalarValues{ dim,T,shape} = Union{ CellScalarValues{dim,T,shape},FaceScalarValues{dim,T,shape} } const VectorValues{ dim, T,sha…

---

## [Read a text file directly as vector of SVectors](https://discourse.julialang.org/t/read-a-text-file-directly-as-vector-of-svectors/7805)

<div class="topic-metadata">

**Author:** [@Datseris](https://discourse.julialang.org/u/Datseris)\
**Replies:** 6\
**Last updated:** [December 16, 2017, 1:11pm UTC](https://discourse.julialang.org/t/read-a-text-file-directly-as-vector-of-svectors/7805 "2017-12-16T13:11:25Z")

</div>

Here is my try: function read\_dataset(filename, V::Type{SVector{D, T}}, sep::Char = ',') where {D, T} data = SVector{D, T}\[\] open(filename) do io for ss in eachline(io) s = split(ss, sep) …

---

## [Performance with MongoDB ](https://discourse.julialang.org/t/performance-with-mongodb/7577)

<div class="topic-metadata">

**Author:** [@Massimo\_Redaelli](https://discourse.julialang.org/u/Massimo_Redaelli)\
**Replies:** 6\
**Last updated:** [December 15, 2017, 11:49pm UTC](https://discourse.julialang.org/t/performance-with-mongodb/7577 "2017-12-15T23:49:08Z")

</div>

I recently changed job and I am now working in a company doing data science stuff with heavy emphasis on geospatial timeseries. I work with two statisticians that have so far implemented everything in R, and occasionall…

---

## [Strange bug on v0.7 master, trying to display a \`Vector{Tuple{String, Vector{String}}}\`](https://discourse.julialang.org/t/strange-bug-on-v0-7-master-trying-to-display-a-vector-tuple-string-vector-string/7793)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 1\
**Last updated:** [December 15, 2017, 7:02pm UTC](https://discourse.julialang.org/t/strange-bug-on-v0-7-master-trying-to-display-a-vector-tuple-string-vector-string/7793 "2017-12-15T19:02:44Z")

</div>

julia\> books 13-element Array{Tuple{String,Array{String,1}},1}: Error showing value of type Array{Tuple{String,Array{String,1}},1}: ERROR: AssertionError: Array{String,1} is not a subtype of Tuple{String,Array{String,1}}…

---

## [Swap array contents?](https://discourse.julialang.org/t/swap-array-contents/7774)

<div class="topic-metadata">

**Author:** [@foobar\_lv2](https://discourse.julialang.org/u/foobar_lv2)\
**Replies:** 26\
**Last updated:** [December 15, 2017, 5:15pm UTC](https://discourse.julialang.org/t/swap-array-contents/7774 "2017-12-15T17:15:33Z")

</div>

I wanted to ask whether julia arrays support something like C++ vector swap. That is, swap!(A,B) should swap the contents of both arrays A,B, and throw if they don’t have the same type (essentially swap sizes and data-p…

---

## [Choice of font does not get saved in the figure](https://discourse.julialang.org/t/choice-of-font-does-not-get-saved-in-the-figure/7784)

<div class="topic-metadata">

**Author:** [@IljaK91](https://discourse.julialang.org/u/IljaK91)\
**Replies:** 2\
**Last updated:** [December 15, 2017, 1:24pm UTC](https://discourse.julialang.org/t/choice-of-font-does-not-get-saved-in-the-figure/7784 "2017-12-15T13:24:27Z")

</div>

I have the following code: using Plots plotlyjs() p1=plot(x, y, fill = (0, 0.5, :black), label="",lw=3, lc = :black, ylims=(0,730000), title = "Construction of new houses, 1991-2014", xtickfont = font(10, "…

---

## [What on earth does Any\[...\] do?](https://discourse.julialang.org/t/what-on-earth-does-any-do/7625)

<div class="topic-metadata">

**Author:** [@NickNack](https://discourse.julialang.org/u/NickNack)\
**Replies:** 8\
**Last updated:** [December 15, 2017, 4:55am UTC](https://discourse.julialang.org/t/what-on-earth-does-any-do/7625 "2017-12-15T04:55:37Z")

</div>

I’ve been using Julia nearly daily for about a year and thought I was fluent in the basics by now. Here’s an example that proves I was mistaken. (I believe that) The syntax T\[\] defines an array literal and casts the ele…

---

## [Is there a way to manually trigger a world\_age update?](https://discourse.julialang.org/t/is-there-a-way-to-manually-trigger-a-world-age-update/7776)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 1\
**Last updated:** [December 15, 2017, 3:14am UTC](https://discourse.julialang.org/t/is-there-a-way-to-manually-trigger-a-world-age-update/7776 "2017-12-15T03:14:41Z")

</div>

Just for reference, this is the kind of world age error you might get: The applicable method may be too new: running in world age 21937, while current world is 22335. The ways around it are: Base.invokelatest Core…

---

## [Why for loops don't return the last evaluated expression as their value?](https://discourse.julialang.org/t/why-for-loops-dont-return-the-last-evaluated-expression-as-their-value/7748)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 9\
**Last updated:** [December 14, 2017, 11:21pm UTC](https://discourse.julialang.org/t/why-for-loops-dont-return-the-last-evaluated-expression-as-their-value/7748 "2017-12-14T23:21:31Z")

</div>

I was wondering why for loops don’t return the last evaluated expression – similar to if statements, for example.

---

## [How to split out a piece of a package into a separate package](https://discourse.julialang.org/t/how-to-split-out-a-piece-of-a-package-into-a-separate-package/3010)

<div class="topic-metadata">

**Author:** [@dpsanders](https://discourse.julialang.org/u/dpsanders)\
**Replies:** 3\
**Last updated:** [December 14, 2017, 9:56pm UTC](https://discourse.julialang.org/t/how-to-split-out-a-piece-of-a-package-into-a-separate-package/3010 "2017-12-14T21:56:53Z")

</div>

I need to split out a piece of functionality into a separate package. What’s the best way to do this while preserving the git history? Since I know there are several success stories, I thought it would be useful to codi…

---

## [Disk backed Dict?](https://discourse.julialang.org/t/disk-backed-dict/7719)

<div class="topic-metadata">

**Author:** [@jw3126](https://discourse.julialang.org/u/jw3126)\
**Replies:** 10\
**Last updated:** [December 14, 2017, 1:29pm UTC](https://discourse.julialang.org/t/disk-backed-dict/7719 "2017-12-14T13:29:27Z")

</div>

Is there a disk backed Dict somewhere? I would like to be able to do the following: d = DiskBackedDict{K,V}(mypath)::Associative{K,V} # load or create new one if not existing x = d\[foo\] # this is as fast as an ordinary…

---

## [GtkReactive vs Gtk](https://discourse.julialang.org/t/gtkreactive-vs-gtk/7714)

<div class="topic-metadata">

**Author:** [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Replies:** 11\
**Last updated:** [December 14, 2017, 1:17pm UTC](https://discourse.julialang.org/t/gtkreactive-vs-gtk/7714 "2017-12-14T13:17:16Z")

</div>

Is there any direct benefit aside from cleanliness, by using GtkReactive.jl over Gtk.jl? I’m only using Signals to do the gui elements, the rest of my code does not use Reactive. For example, I made some scripting tools…

---

## [How to interpolate variables in Markdown file?](https://discourse.julialang.org/t/how-to-interpolate-variables-in-markdown-file/7750)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 7\
**Last updated:** [December 14, 2017, 1:11pm UTC](https://discourse.julialang.org/t/how-to-interpolate-variables-in-markdown-file/7750 "2017-12-14T13:11:49Z")

</div>

Say I have a file test.md which contains: Hello $user\_name Then in the REPL I do: julia\> user\_name = "John" julia\> Markdown.parse\_file("test.md") |\> Markdown.html This will render Hello user\_name instead of Hello Joh…

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

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