# General Usage

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

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

**Page:** 807

---

## [How to parse the string entries read from a file into their struct / types?](https://discourse.julialang.org/t/how-to-parse-the-string-entries-read-from-a-file-into-their-struct-types/31909)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 5\
**Last updated:** [December 9, 2019, 2:46pm UTC](https://discourse.julialang.org/t/how-to-parse-the-string-entries-read-from-a-file-into-their-struct-types/31909 "2019-12-09T14:46:03Z")

</div>

I was reading a text file, which has the following columns: startTimes, startLocs, planedRouteNds, edgesDists, edgesTravelTimes, dists, durationTimes, and eventCtgrs. Each one of them has a different type. For example, s…

---

## [Replace missing with 0.0 in dataframe](https://discourse.julialang.org/t/replace-missing-with-0-0-in-dataframe/32029)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 10\
**Last updated:** [December 9, 2019, 2:35pm UTC](https://discourse.julialang.org/t/replace-missing-with-0-0-in-dataframe/32029 "2019-12-09T14:35:29Z")

</div>

I am trying to replace missing values in Float coluns with 0.0. My starting point: for col in names(df) df\[ismissing.(df\[col\]), col\] = 0.0 end While this works, it has two weak points: a. it doesn’t check the typ…

---

## [IOError: unlink: resource busy or locked (EBUSY) in Windows](https://discourse.julialang.org/t/ioerror-unlink-resource-busy-or-locked-ebusy-in-windows/32045)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 1\
**Last updated:** [December 9, 2019, 1:05pm UTC](https://discourse.julialang.org/t/ioerror-unlink-resource-busy-or-locked-ebusy-in-windows/32045 "2019-12-09T13:05:09Z")

</div>

Hi! I need help. I am trying to copy a file but I am seeing this error only in Windows (only with Julia \>= v.1.2.0): Include Pretty Table to file: Error During Test at C:\\projects\\prettytables-jl\\test\\general.jl:12 Got…

---

## [How to specify that a function which has several (but a limited amount) of possible types as inputs and outputs?](https://discourse.julialang.org/t/how-to-specify-that-a-function-which-has-several-but-a-limited-amount-of-possible-types-as-inputs-and-outputs/32041)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 2\
**Last updated:** [December 9, 2019, 11:02am UTC](https://discourse.julialang.org/t/how-to-specify-that-a-function-which-has-several-but-a-limited-amount-of-possible-types-as-inputs-and-outputs/32041 "2019-12-09T11:02:04Z")

</div>

My code for formulating a specific JuMP optimisation model has started getting quite slow, and I would like to start optimising it by specifying types. One of the main functions I call just searches through two dictiona…

---

## [Problems with Gettext and Formatting on Master](https://discourse.julialang.org/t/problems-with-gettext-and-formatting-on-master/32037)

<div class="topic-metadata">

**Author:** [@Colin\_Beckingham](https://discourse.julialang.org/u/Colin_Beckingham)\
**Replies:** 2\
**Last updated:** [December 9, 2019, 10:43am UTC](https://discourse.julialang.org/t/problems-with-gettext-and-formatting-on-master/32037 "2019-12-09T10:43:53Z")

</div>

I reported an issue with testing ImageView which apparently has been fixed but for me it persists. After a complete reinstall of master Version 1.4.0-DEV.564 (2019-12-08) I tried again but still the same problems. Drilli…

---

## [How can I create a function type with custom Input and Output type](https://discourse.julialang.org/t/how-can-i-create-a-function-type-with-custom-input-and-output-type/31719)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 9\
**Last updated:** [December 9, 2019, 4:24am UTC](https://discourse.julialang.org/t/how-can-i-create-a-function-type-with-custom-input-and-output-type/31719 "2019-12-09T04:24:05Z")

</div>

– advanced question – Let’s say, I have a Vector{Int} and would like to transform it into a Vector{Float64}. One super generic way to do it is to use the hidden return\_type function Core.Compiler.return\_type. Namely wi…

---

## [Basic Performance Analysis Package](https://discourse.julialang.org/t/basic-performance-analysis-package/32032)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 3\
**Last updated:** [December 9, 2019, 12:57am UTC](https://discourse.julialang.org/t/basic-performance-analysis-package/32032 "2019-12-09T00:57:35Z")

</div>

I was wondering if there is a package to test my code to point out the common pitfalls that slows down my code? Like type instability and boxing and unboxing and etc??? Thanks

---

## [Repeating a for loop sequence](https://discourse.julialang.org/t/repeating-a-for-loop-sequence/32008)

<div class="topic-metadata">

**Author:** [@WEEZEERAE](https://discourse.julialang.org/u/WEEZEERAE)\
**Replies:** 5\
**Last updated:** [December 8, 2019, 9:49pm UTC](https://discourse.julialang.org/t/repeating-a-for-loop-sequence/32008 "2019-12-08T21:49:29Z")

</div>

Hey people, I basically want to include an if condition into my for loop, which repeats the loop with the previews iteration variable, if the condition hasn’t been satisfied. In this case there are a few things to cons…

---

## [PackageCompiler: LLVM ERROR](https://discourse.julialang.org/t/packagecompiler-llvm-error/32016)

<div class="topic-metadata">

**Author:** [@rssdev10](https://discourse.julialang.org/u/rssdev10)\
**Replies:** 1\
**Last updated:** [December 8, 2019, 9:08pm UTC](https://discourse.julialang.org/t/packagecompiler-llvm-error/32016 "2019-12-08T21:08:03Z")

</div>

Hi, I’m getting the following error while compiling my package: ptrtoint not supported for non-integral pointers inttoptr not supported for non-integral pointers ptrtoint not supported for non-integral pointers inttoptr…

---

## [Axpby! and 0\*NaN](https://discourse.julialang.org/t/axpby-and-0-nan/32014)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 2\
**Last updated:** [December 8, 2019, 7:32pm UTC](https://discourse.julialang.org/t/axpby-and-0-nan/32014 "2019-12-08T19:32:36Z")

</div>

There might be some inconsistencies regarding 0\*NaN: if one has p = 0\*NaN, then p is also NaN (ok, treating this as julia convention), however, using LinearAlgebra x = rand(2,2) y = rand(2,2) y\[1,1\] = NaN axpby!(.3, x,…

---

## [How to store the set of needed packages in git](https://discourse.julialang.org/t/how-to-store-the-set-of-needed-packages-in-git/31975)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 20\
**Last updated:** [December 8, 2019, 7:43am UTC](https://discourse.julialang.org/t/how-to-store-the-set-of-needed-packages-in-git/31975 "2019-12-08T07:43:08Z")

</div>

I know the possibility to “instantiate” a folder/project to load all the correct package versions, that are needed. But how can I do the opposite, store a set of packages in a file that I can commit to git? Uwe

---

## [Create Sparse Array without Copying](https://discourse.julialang.org/t/create-sparse-array-without-copying/31984)

<div class="topic-metadata">

**Author:** [@Paul\_McVay](https://discourse.julialang.org/u/Paul_McVay)\
**Replies:** 5\
**Last updated:** [December 8, 2019, 7:40am UTC](https://discourse.julialang.org/t/create-sparse-array-without-copying/31984 "2019-12-08T07:40:02Z")

</div>

I have the row vector, column vector and the value vectors of a sparse matrix and would like to create a sparse matrix with them without copying the vectors because the vectors already take up 59% of my systems memory. I…

---

## [Tables package for fast grouping and filtering?](https://discourse.julialang.org/t/tables-package-for-fast-grouping-and-filtering/31950)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 18\
**Last updated:** [December 8, 2019, 6:40am UTC](https://discourse.julialang.org/t/tables-package-for-fast-grouping-and-filtering/31950 "2019-12-08T06:40:10Z")

</div>

I already use Julia for much of my simulation and model calibration work, but am considering using it for some of the more basic data preparation I do. This work is primarly filtering, grouping, and applying time series…

---

## [sum(Array{Bool,1}) vs sum(Array(Int8,1})](https://discourse.julialang.org/t/sum-array-bool-1-vs-sum-array-int8-1/31353)

<div class="topic-metadata">

**Author:** [@recri](https://discourse.julialang.org/u/recri)\
**Replies:** 6\
**Last updated:** [December 8, 2019, 3:43am UTC](https://discourse.julialang.org/t/sum-array-bool-1-vs-sum-array-int8-1/31353 "2019-12-08T03:43:56Z")

</div>

I was reviewing old discussions around efficiency and I noticed that summing an array of Bool is still slower (julia-1.3.0-rc5) than summing the same array of values as Int8, which is puzzling since it seems it should in…

---

## [Representing c unions and packed types](https://discourse.julialang.org/t/representing-c-unions-and-packed-types/31993)

<div class="topic-metadata">

**Author:** [@cshenton](https://discourse.julialang.org/u/cshenton)\
**Replies:** 0\
**Last updated:** [December 8, 2019, 12:32am UTC](https://discourse.julialang.org/t/representing-c-unions-and-packed-types/31993 "2019-12-08T00:32:47Z")

</div>

I’m currently writing language bindings for OpenVR to integrate with the Julia game engine I’m building. I’ve run into two challenges: The API uses (quite large) union types for its event system The API uses pragma pa…

---

## [Creating an i/o pipeline which feeds a while loop using multiple cores](https://discourse.julialang.org/t/creating-an-i-o-pipeline-which-feeds-a-while-loop-using-multiple-cores/31931)

<div class="topic-metadata">

**Author:** [@anon97116444](https://discourse.julialang.org/u/anon97116444)\
**Replies:** 6\
**Last updated:** [December 8, 2019, 12:18am UTC](https://discourse.julialang.org/t/creating-an-i-o-pipeline-which-feeds-a-while-loop-using-multiple-cores/31931 "2019-12-08T00:18:45Z")

</div>

no code written YET but getting there. So I am having a little performance anxiety and I think it’s because I’m not seeing the big picture yet. Could someone point me at ANY Julia modules I should look at for the follow…

---

## [Having trouble pushing to an array of arrays](https://discourse.julialang.org/t/having-trouble-pushing-to-an-array-of-arrays/31971)

<div class="topic-metadata">

**Author:** [@fibonatic](https://discourse.julialang.org/u/fibonatic)\
**Replies:** 7\
**Last updated:** [December 7, 2019, 6:39pm UTC](https://discourse.julialang.org/t/having-trouble-pushing-to-an-array-of-arrays/31971 "2019-12-07T18:39:56Z")

</div>

I am trying to fill in an array of arrays using push. If I manually initialize the array of arrays pushing works, but it doesn’t if I try to initialize using fill. For example manually initializing test = \[Int\[\], Int\[\]\]…

---

## [Help with strings!](https://discourse.julialang.org/t/help-with-strings/31979)

<div class="topic-metadata">

**Author:** [@PseudoCodeNerd](https://discourse.julialang.org/u/PseudoCodeNerd)\
**Replies:** 3\
**Last updated:** [December 7, 2019, 6:28pm UTC](https://discourse.julialang.org/t/help-with-strings/31979 "2019-12-07T18:28:59Z")

</div>

Hello there people at Julia ! I’m a high-school student and recently I’ve been stuck with this problem in Julia. I want to get the first characters of the words in a long sentence (after splitting from the blank) and c…

---

## [How to change =\> to another symbol?](https://discourse.julialang.org/t/how-to-change-to-another-symbol/31981)

<div class="topic-metadata">

**Author:** [@gevis](https://discourse.julialang.org/u/gevis)\
**Replies:** 2\
**Last updated:** [December 7, 2019, 5:33pm UTC](https://discourse.julialang.org/t/how-to-change-to-another-symbol/31981 "2019-12-07T17:33:18Z")

</div>

Is any way to change =\> as in Dict(“A”=\>1, “B”=\>2) to a single symbol in Julia? For example, to :, →, or |.

---

## [MCMC of mixture model using Mamba](https://discourse.julialang.org/t/mcmc-of-mixture-model-using-mamba/31125)

<div class="topic-metadata">

**Author:** [@SSU](https://discourse.julialang.org/u/SSU)\
**Replies:** 8\
**Last updated:** [December 7, 2019, 10:47am UTC](https://discourse.julialang.org/t/mcmc-of-mixture-model-using-mamba/31125 "2019-12-07T10:47:15Z")

</div>

I am trying to fit my experimental data( ~40k circular data, \[-\\pi, +\\pi\], bimodal) with mixture of von mises distribution using Mamba. I want to predict the parameters(\\mu, \\kappa, weights) of the data. Problem The fo…

---

## [Is there a function to extract the y-channel (=luminance) of an image in julia?](https://discourse.julialang.org/t/is-there-a-function-to-extract-the-y-channel-luminance-of-an-image-in-julia/31936)

<div class="topic-metadata">

**Author:** [@patdax](https://discourse.julialang.org/u/patdax)\
**Replies:** 2\
**Last updated:** [December 6, 2019, 5:40pm UTC](https://discourse.julialang.org/t/is-there-a-function-to-extract-the-y-channel-luminance-of-an-image-in-julia/31936 "2019-12-06T17:40:10Z")

</div>

I am trying to extract the y channel of a rgb image and asking myself if there are some packages available for that?

---

## [Retrieve OnlineStat.Series() statistics](https://discourse.julialang.org/t/retrieve-onlinestat-series-statistics/31901)

<div class="topic-metadata">

**Author:** [@Dario\_Sarra](https://discourse.julialang.org/u/Dario_Sarra)\
**Replies:** 5\
**Last updated:** [December 6, 2019, 2:22pm UTC](https://discourse.julialang.org/t/retrieve-onlinestat-series-statistics/31901 "2019-12-06T14:22:23Z")

</div>

I can’t understand from the docs how can I retrieve a result from a series. Specifically, if I follow the example y = rand(1000) s = Series(Mean(), Variance()) fit!(s, y) And after I want to apply std() to the resultin…

---

## [Country Codes](https://discourse.julialang.org/t/country-codes/4010)

<div class="topic-metadata">

**Author:** [@wibble](https://discourse.julialang.org/u/wibble)\
**Replies:** 6\
**Last updated:** [December 6, 2019, 11:49am UTC](https://discourse.julialang.org/t/country-codes/4010 "2019-12-06T11:49:45Z")

</div>

Hey All, Just wondering if there’s an existing package that would provide a Dict mapping ISO country codes (Alpha-2 or Alpha-3) to country names and possibly ISO numeric codes as well. Thanks!

---

## [Setfield! allocates memory when setting Float64 values](https://discourse.julialang.org/t/setfield-allocates-memory-when-setting-float64-values/31811)

<div class="topic-metadata">

**Author:** [@MartinOtter](https://discourse.julialang.org/u/MartinOtter)\
**Replies:** 4\
**Last updated:** [December 6, 2019, 11:09am UTC](https://discourse.julialang.org/t/setfield-allocates-memory-when-setting-float64-values/31811 "2019-12-06T11:09:28Z")

</div>

The task is to copy all elements of a vector (x::Vector{Float64}) into a hierarchical data structure many times. Hereby the mapping is fixed at the beginning. For example x\[3\] is always copied to a.b.c.d. Intuitively, it…

---

## [I am stuck at "Please Authenticate"](https://discourse.julialang.org/t/i-am-stuck-at-please-authenticate/26313)

<div class="topic-metadata">

**Author:** [@CUHKSZzxy](https://discourse.julialang.org/u/CUHKSZzxy)\
**Replies:** 7\
**Last updated:** [December 5, 2019, 7:56pm UTC](https://discourse.julialang.org/t/i-am-stuck-at-please-authenticate/26313 "2019-12-05T19:56:01Z")

</div>

I am a macbook user, since the JuliaBox is extremely slow, so I am trying to use the Jupyter notebook based on my own computer. However, when I am running the following code, something went wrong. using Pkg Pkg.add(“Im…

---

## [Linear algebra/algorithm: possible speed up for summing up matrices commutators](https://discourse.julialang.org/t/linear-algebra-algorithm-possible-speed-up-for-summing-up-matrices-commutators/31912)

<div class="topic-metadata">

**Author:** [@Egwene\_al\_Vere](https://discourse.julialang.org/u/Egwene_al_Vere)\
**Replies:** 1\
**Last updated:** [December 5, 2019, 5:52pm UTC](https://discourse.julialang.org/t/linear-algebra-algorithm-possible-speed-up-for-summing-up-matrices-commutators/31912 "2019-12-05T17:52:29Z")

</div>

With matrix commutator \[A,B\] \\equiv AB-BA, consider the sum of \\sum\_{i=1}^k \[MF\_i, F\_{k-i+1}\], where M and F\_{j} are known matrices. I’m using something like this that allocate in advance: using LinearAlgebra using Benc…

---

## [Controlling Artifacts download, hash, and environment in 1.3](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868)

<div class="topic-metadata">

**Author:** [@crinders](https://discourse.julialang.org/u/crinders)\
**Replies:** 9\
**Last updated:** [December 5, 2019, 5:37pm UTC](https://discourse.julialang.org/t/controlling-artifacts-download-hash-and-environment-in-1-3/31868 "2019-12-05T17:37:59Z")

</div>

I compiled release-1.3.1.-pre and ran julia\> \]up with the unsatisfying result: Updating registry at \`~/.julia/registries/General\` Updating git-repo \`https://github.com/JuliaRegistries/General.git\` Resolving packa…

---

## [Module loading on workers](https://discourse.julialang.org/t/module-loading-on-workers/31814)

<div class="topic-metadata">

**Author:** [@pfarndt](https://discourse.julialang.org/u/pfarndt)\
**Replies:** 4\
**Last updated:** [December 5, 2019, 5:34pm UTC](https://discourse.julialang.org/t/module-loading-on-workers/31814 "2019-12-05T17:34:57Z")

</div>

Through some trials and errors I realized that modules, which are loaded with using, are also loaded on the already existing workers. Therefore the following code runs without an error: using Distributed addprocs(2) us…

---

## [Switching from Jupyter to a proper IDE](https://discourse.julialang.org/t/switching-from-jupyter-to-a-proper-ide/31648)

<div class="topic-metadata">

**Author:** [@aplavin](https://discourse.julialang.org/u/aplavin)\
**Replies:** 24\
**Last updated:** [December 5, 2019, 5:00pm UTC](https://discourse.julialang.org/t/switching-from-jupyter-to-a-proper-ide/31648 "2019-12-05T17:00:41Z")

</div>

Hi! I’m using JupyterLab for the majority of my work in Julia, and it is definitely lacking in capabilities of IDEs like Juno and Julia plugin for VSCode - like debugging, variable inspection, and so on. Even autoindent …

---

## [Cross-platform unpacking of tar archive](https://discourse.julialang.org/t/cross-platform-unpacking-of-tar-archive/31459)

<div class="topic-metadata">

**Author:** [@NiclasMattsson](https://discourse.julialang.org/u/NiclasMattsson)\
**Replies:** 9\
**Last updated:** [December 5, 2019, 4:55pm UTC](https://discourse.julialang.org/t/cross-platform-unpacking-of-tar-archive/31459 "2019-12-05T16:55:17Z")

</div>

I need to unpack uncompressed .tar archives from within Julia and have it work on all platforms. Maybe a clue: there seems to be some code for this here within Pkg.PlatformEngines but I couldn’t figure out how to access…

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

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