# General Usage

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

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

**Page:** 925

---

## [Split a zip](https://discourse.julialang.org/t/split-a-zip/16853)

<div class="topic-metadata">

**Author:** [@mschauer](https://discourse.julialang.org/u/mschauer)\
**Replies:** 1\
**Last updated:** [October 27, 2018, 9:45am UTC](https://discourse.julialang.org/t/split-a-zip/16853 "2018-10-27T09:45:26Z")

</div>

Zip is its own inverse but not a very useful one. Is there a good replacement for collect(zip(itr...)) for iterators of tuples?

---

## [Building julia 1.0 for windows](https://discourse.julialang.org/t/building-julia-1-0-for-windows/15897)

<div class="topic-metadata">

**Author:** [@oheil](https://discourse.julialang.org/u/oheil)\
**Replies:** 7\
**Last updated:** [October 26, 2018, 8:53pm UTC](https://discourse.julialang.org/t/building-julia-1-0-for-windows/15897 "2018-10-26T20:53:02Z")

</div>

I am not able to build julia 1.0 for windows following the Cygwin-to-MinGW cross-compiling build procedure described here: https://github.com/JuliaLang/julia/blob/master/README.windows.md The following linker error is …

---

## [Custom likelihoods in Turing.jl](https://discourse.julialang.org/t/custom-likelihoods-in-turing-jl/16818)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 15\
**Last updated:** [October 26, 2018, 7:32pm UTC](https://discourse.julialang.org/t/custom-likelihoods-in-turing-jl/16818 "2018-10-26T19:32:41Z")

</div>

Hi all- I have two related questions. First, how do I implement a custom likelihood in turing.jl? Unfortunately, I was unable to implement a simple example based on the documentation, which is probably impeding my abili…

---

## [Cannot convert JLD.AssociativeWrapper to Dict](https://discourse.julialang.org/t/cannot-convert-jld-associativewrapper-to-dict/16835)

<div class="topic-metadata">

**Author:** [@kilgoretrout](https://discourse.julialang.org/u/kilgoretrout)\
**Replies:** 0\
**Last updated:** [October 26, 2018, 6:45pm UTC](https://discourse.julialang.org/t/cannot-convert-jld-associativewrapper-to-dict/16835 "2018-10-26T18:45:27Z")

</div>

New to julia so might be missing some basic things. I’m trying to make the current version of the JLD package work with some older code I have and running into a type issue. The older code works with some older version …

---

## [Wrap a POD type in arrays Efficiently](https://discourse.julialang.org/t/wrap-a-pod-type-in-arrays-efficiently/16833)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 1\
**Last updated:** [October 26, 2018, 6:45pm UTC](https://discourse.julialang.org/t/wrap-a-pod-type-in-arrays-efficiently/16833 "2018-10-26T18:45:30Z")

</div>

I’m trying to add a tag to an Integer which is either 0 or 1 (it will used for indexing, so I’m not using Booleans), which will looks like: struct Bit{T \<: Integer} value::T end However, this approach will suffer w…

---

## [Status of Distances.jl](https://discourse.julialang.org/t/status-of-distances-jl/16789)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 6\
**Last updated:** [October 26, 2018, 3:55pm UTC](https://discourse.julialang.org/t/status-of-distances-jl/16789 "2018-10-26T15:55:05Z")

</div>

Is the package supposed to work on Julia v1? I see a commit about support for v0.7 but I get an error: julia\> movies\[1,:\] 9-element Array{Any,1}: "Moonlight (2016)" 0 0 0 1 0 0 0 0 julia\> nemo 9-element Array…

---

## [Include\_string vs getfield](https://discourse.julialang.org/t/include-string-vs-getfield/16814)

<div class="topic-metadata">

**Author:** [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Replies:** 7\
**Last updated:** [October 26, 2018, 3:11pm UTC](https://discourse.julialang.org/t/include-string-vs-getfield/16814 "2018-10-26T15:11:53Z")

</div>

I used to use include\_string to call a function with the name defined by the string. But it seems like a hack, doesn’t it? Now getfield appears more sensible, doesn’t it? But I don’t know what behind these two functio…

---

## [Put vector of vector into vector of vector without for loop](https://discourse.julialang.org/t/put-vector-of-vector-into-vector-of-vector-without-for-loop/16826)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 4\
**Last updated:** [October 26, 2018, 3:10pm UTC](https://discourse.julialang.org/t/put-vector-of-vector-into-vector-of-vector-without-for-loop/16826 "2018-10-26T15:10:33Z")

</div>

Consider the following minimal example: A = \[Vector{Int}(undef, 5) for i = 1:4\] a = \[zeros(Int, 2) for i = 1:4\] I’d like to put a into the first 2 inner indices of A without a for loop. Is that possible? Something lik…

---

## [Performance of Memory Mapped Arrays (vs. JLD2)](https://discourse.julialang.org/t/performance-of-memory-mapped-arrays-vs-jld2/16810)

<div class="topic-metadata">

**Author:** [@colddaysend](https://discourse.julialang.org/u/colddaysend)\
**Replies:** 2\
**Last updated:** [October 26, 2018, 9:21am UTC](https://discourse.julialang.org/t/performance-of-memory-mapped-arrays-vs-jld2/16810 "2018-10-26T09:21:04Z")

</div>

I need to generate a very large matrix (too big for memory), so I’m using memory mapped arrays. I’m trying to benchmark the code and understand some of the variation in run times. Right now, I’m looking at the time it t…

---

## [How to efficiently transform vector of structures?](https://discourse.julialang.org/t/how-to-efficiently-transform-vector-of-structures/16816)

<div class="topic-metadata">

**Author:** [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Replies:** 5\
**Last updated:** [October 26, 2018, 10:30am UTC](https://discourse.julialang.org/t/how-to-efficiently-transform-vector-of-structures/16816 "2018-10-26T10:30:20Z")

</div>

How to efficiently transform vector of structures without unnecessary allocation? We have two structures: struct ApiData name::String reload::Vector{ApiReload} values::Vector{Float64} end struct ApiReload statu…

---

## [Is there any magic with T](https://discourse.julialang.org/t/is-there-any-magic-with-t/16811)

<div class="topic-metadata">

**Author:** [@LeoK987](https://discourse.julialang.org/u/LeoK987)\
**Replies:** 1\
**Last updated:** [October 26, 2018, 12:30am UTC](https://discourse.julialang.org/t/is-there-any-magic-with-t/16811 "2018-10-26T00:30:48Z")

</div>

when defining a parametric something? I see symbols like T1, T2, etc got used. But can one use any other symbols?

---

## [Error when trying to install JuMP](https://discourse.julialang.org/t/error-when-trying-to-install-jump/16808)

<div class="topic-metadata">

**Author:** [@OvidiusCicero](https://discourse.julialang.org/u/OvidiusCicero)\
**Replies:** 8\
**Last updated:** [October 26, 2018, 12:29am UTC](https://discourse.julialang.org/t/error-when-trying-to-install-jump/16808 "2018-10-26T00:29:12Z")

</div>

Hi there I have a Julia 1.0.1 on a windows machine. When installing JuMP I get the following error v1.0) pkg\> add JuMP Resolving package versions... ERROR: Unsatisfiable requirements detected for package JuMP \[4076af6…

---

## [Packaging best practices for adding dependencies](https://discourse.julialang.org/t/packaging-best-practices-for-adding-dependencies/16793)

<div class="topic-metadata">

**Author:** [@sam1](https://discourse.julialang.org/u/sam1)\
**Replies:** 1\
**Last updated:** [October 26, 2018, 12:07am UTC](https://discourse.julialang.org/t/packaging-best-practices-for-adding-dependencies/16793 "2018-10-26T00:07:03Z")

</div>

Hi, I’m wondering whether it’s necessary or desirable to add dependencies which are in the standard library? The example in the docs shows adding Random to a project.toml but is this necessary? Couldn’t you just add a…

---

## [Module basics](https://discourse.julialang.org/t/module-basics/16770)

<div class="topic-metadata">

**Author:** [@Vic](https://discourse.julialang.org/u/Vic)\
**Replies:** 13\
**Last updated:** [October 25, 2018, 10:52pm UTC](https://discourse.julialang.org/t/module-basics/16770 "2018-10-25T22:52:27Z")

</div>

I’m reading the docs, and I get that module is for definitions. I want to make sure I understood: Can you also have expressions on RHS of assignment? like x=2+3 and y=x-2 ? No loops or other statements ? Because this M…

---

## [Viewing the Notebooks Locally](https://discourse.julialang.org/t/viewing-the-notebooks-locally/16574)

<div class="topic-metadata">

**Author:** [@HerAdri](https://discourse.julialang.org/u/HerAdri)\
**Replies:** 14\
**Last updated:** [October 25, 2018, 8:28pm UTC](https://discourse.julialang.org/t/viewing-the-notebooks-locally/16574 "2018-10-25T20:28:40Z")

</div>

To view the notebooks locally and interact with the contents, use the following commands (requires IJulia): given in the following link Pkg.clone(“GitHub - SciML/SciMLTutorials.jl: Tutorials for doing scientific machin…

---

## [Segfault trying to call Logger.global\_logger](https://discourse.julialang.org/t/segfault-trying-to-call-logger-global-logger/16787)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 0\
**Last updated:** [October 25, 2018, 3:23pm UTC](https://discourse.julialang.org/t/segfault-trying-to-call-logger-global-logger/16787 "2018-10-25T15:23:56Z")

</div>

I’m trying to define a custom logging format to print timestamps and I’m running into a segfault. Probably part of it is just using some anti-pattern that I should avoid using but the segfault probably also shouldn’t hap…

---

## [Live Plotting Best Practices?](https://discourse.julialang.org/t/live-plotting-best-practices/16571)

<div class="topic-metadata">

**Author:** [@standarddeviant](https://discourse.julialang.org/u/standarddeviant)\
**Replies:** 5\
**Last updated:** [October 25, 2018, 1:16pm UTC](https://discourse.julialang.org/t/live-plotting-best-practices/16571 "2018-10-25T13:16:51Z")

</div>

I have a project where I’m receiving time domain data in packets, that I’d like to plot live. After looking at some options, I decided to go with plain GR.jl. My simulation of MVP code is at the end of my post. To run…

---

## [Strange output using SymPy](https://discourse.julialang.org/t/strange-output-using-sympy/16678)

<div class="topic-metadata">

**Author:** [@yordiak](https://discourse.julialang.org/u/yordiak)\
**Replies:** 5\
**Last updated:** [October 25, 2018, 9:21am UTC](https://discourse.julialang.org/t/strange-output-using-sympy/16678 "2018-10-25T09:21:26Z")

</div>

Declaration: Not sure if this the right topic I am experiencing the following bug (MWE): using SymPy x=Sym("x") @vars a f(a)=a\*x f(2) It prints a “strange” box between “2” and “x” I am using Julia 1.0.1 on windows …

---

## [Gibbs sampler works in R doesn't in Julia (full Julia code provided) please help](https://discourse.julialang.org/t/gibbs-sampler-works-in-r-doesnt-in-julia-full-julia-code-provided-please-help/16544)

<div class="topic-metadata">

**Author:** [@spinkney](https://discourse.julialang.org/u/spinkney)\
**Replies:** 22\
**Last updated:** [October 25, 2018, 7:55am UTC](https://discourse.julialang.org/t/gibbs-sampler-works-in-r-doesnt-in-julia-full-julia-code-provided-please-help/16544 "2018-10-25T07:55:00Z")

</div>

Hi Everyone, I’m a director of data science and I’m checking out Julia as a tool for my group to use. I chose an example from the Computer Age Statistical Inference on population mixtures with gene data. The particular …

---

## [String slicing](https://discourse.julialang.org/t/string-slicing/16765)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 3\
**Last updated:** [October 25, 2018, 3:03am UTC](https://discourse.julialang.org/t/string-slicing/16765 "2018-10-25T03:03:56Z")

</div>

I know that a lot has been written about string slicing safely with UTF-8 strings that will contain multiple code points per printable character. We have thisind, prevind, nextind and searching as ways to get valid indi…

---

## [Explicit Inversion of a random matrix performs the same as Symmetric & SPD](https://discourse.julialang.org/t/explicit-inversion-of-a-random-matrix-performs-the-same-as-symmetric-spd/16732)

<div class="topic-metadata">

**Author:** [@cpsarras](https://discourse.julialang.org/u/cpsarras)\
**Replies:** 6\
**Last updated:** [October 25, 2018, 1:43am UTC](https://discourse.julialang.org/t/explicit-inversion-of-a-random-matrix-performs-the-same-as-symmetric-spd/16732 "2018-10-25T01:43:18Z")

</div>

Hi all, so I was testing how Julia (1.1.0-DEV.452) handles Matrices with different kinds of properties (Symmetric, SPD, UpperTriangular etc.) and how much faster certain operations (i.e. inv(A)) perform based on those p…

---

## [Weird type errors when manipulating arrays of functions](https://discourse.julialang.org/t/weird-type-errors-when-manipulating-arrays-of-functions/16709)

<div class="topic-metadata">

**Author:** [@jonathan-laurent](https://discourse.julialang.org/u/jonathan-laurent)\
**Replies:** 8\
**Last updated:** [October 24, 2018, 4:40pm UTC](https://discourse.julialang.org/t/weird-type-errors-when-manipulating-arrays-of-functions/16709 "2018-10-24T16:40:57Z")

</div>

Here are four expressions that I expect to evaluate to \[sin, sin ∘ sin\]: accumulate(∘, \[sin, sin\]) #1 accumulate(∘, \[x -\> sin(x), x -\> sin(x)\]) #2 accumulate(∘, \[sin for i=1:2\]) #3 ac…

---

## [What happened to Base.colon?](https://discourse.julialang.org/t/what-happened-to-base-colon/16513)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 22\
**Last updated:** [October 24, 2018, 3:34pm UTC](https://discourse.julialang.org/t/what-happened-to-base-colon/16513 "2018-10-24T15:34:35Z")

</div>

It was working with 0.6 ?

---

## [Functions and code\_warntype](https://discourse.julialang.org/t/functions-and-code-warntype/16734)

<div class="topic-metadata">

**Author:** [@gdkrmr](https://discourse.julialang.org/u/gdkrmr)\
**Replies:** 2\
**Last updated:** [October 24, 2018, 1:31pm UTC](https://discourse.julialang.org/t/functions-and-code-warntype/16734 "2018-10-24T13:31:45Z")

</div>

I am puzzled how functions are handled by type inference. There doesn’t seem to be a type Function{InputType, ReturnType} to help type inference, instead there is a typeof(f) Type. Why is that? I am happy if you point me…

---

## [Issue with using @show in generated functions](https://discourse.julialang.org/t/issue-with-using-show-in-generated-functions/16721)

<div class="topic-metadata">

**Author:** [@aashish01](https://discourse.julialang.org/u/aashish01)\
**Replies:** 1\
**Last updated:** [October 24, 2018, 9:23am UTC](https://discourse.julialang.org/t/issue-with-using-show-in-generated-functions/16721 "2018-10-24T09:23:43Z")

</div>

I had written a generated function of the following form and used @show to see the final code being generated. @generated function deserialize!(buffer, ::TypeHolder{T}) where T \<: NSE\_composites ops = \[:(retval.$f =…

---

## [Scope of "struct" and "macro"](https://discourse.julialang.org/t/scope-of-struct-and-macro/16714)

<div class="topic-metadata">

**Author:** [@Vic](https://discourse.julialang.org/u/Vic)\
**Replies:** 2\
**Last updated:** [October 24, 2018, 2:41am UTC](https://discourse.julialang.org/t/scope-of-struct-and-macro/16714 "2018-10-24T02:41:06Z")

</div>

In the tree of scopes at Scope of Variables · The Julia Language , in branch 5, what means “don’t allow nesting” ? That “struct” and “macro” don’t allow nesting of other scope blocks inside them?

---

## [Errors when trying the new package manager (0.7)](https://discourse.julialang.org/t/errors-when-trying-the-new-package-manager-0-7/11123)

<div class="topic-metadata">

**Author:** [@mauro3](https://discourse.julialang.org/u/mauro3)\
**Replies:** 7\
**Last updated:** [October 24, 2018, 12:34am UTC](https://discourse.julialang.org/t/errors-when-trying-the-new-package-manager-0-7/11123 "2018-10-24T00:34:36Z")

</div>

I’m trying out the new package manager, but get stuck following the docs here: https://docs.julialang.org/en/latest/stdlib/Pkg.html#Adding-packages-to-the-project-1 julia\> import HelloWorld julia\> HelloWorld.greet() He…

---

## [How to support \`view\` in Flux.Tracker?](https://discourse.julialang.org/t/how-to-support-view-in-flux-tracker/16711)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 1\
**Last updated:** [October 23, 2018, 11:04pm UTC](https://discourse.julialang.org/t/how-to-support-view-in-flux-tracker/16711 "2018-10-23T23:04:12Z")

</div>

I have a batched gemm and batched tr: https://github.com/Roger-luo/Batched.jl/blob/master/src/gemm.jl Now I want to implement the gradient as: using Flux.Tracker using Flux.Tracker: TrackedArray, track, @grad, data usi…

---

## [Pandas.jl hangs sometimes with query function](https://discourse.julialang.org/t/pandas-jl-hangs-sometimes-with-query-function/16696)

<div class="topic-metadata">

**Author:** [@acastaneda](https://discourse.julialang.org/u/acastaneda)\
**Replies:** 1\
**Last updated:** [October 23, 2018, 7:47pm UTC](https://discourse.julialang.org/t/pandas-jl-hangs-sometimes-with-query-function/16696 "2018-10-23T19:47:58Z")

</div>

Hi, I’m developing an algorithm using Pandas.jl (V0.6.3) to process small dataframes (max 422 rows, 2 columns). The algorithm was working last week without problems. However, this week it hangs when calling query functi…

---

## [Can't find overloaded parse() method](https://discourse.julialang.org/t/cant-find-overloaded-parse-method/16697)

<div class="topic-metadata">

**Author:** [@kilgoretrout](https://discourse.julialang.org/u/kilgoretrout)\
**Replies:** 2\
**Last updated:** [October 23, 2018, 5:27pm UTC](https://discourse.julialang.org/t/cant-find-overloaded-parse-method/16697 "2018-10-23T17:27:05Z")

</div>

I’m trying to use a package AutoEnvs which uses the AutomotiveDrivingModels package but when I run using AutoEnvs I get this error MethodError: no method matching parse(::Type{AutomotiveDrivingModels.LaneConnection},…

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

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