# General Usage

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

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

**Page:** 946

---

## [Workflow for developing application in new Pkg manager](https://discourse.julialang.org/t/workflow-for-developing-application-in-new-pkg-manager/13051)

<div class="topic-metadata">

**Author:** [@Stephen\_Vavasis](https://discourse.julialang.org/u/Stephen_Vavasis)\
**Replies:** 17\
**Last updated:** [August 31, 2018, 4:16am UTC](https://discourse.julialang.org/t/workflow-for-developing-application-in-new-pkg-manager/13051 "2018-08-31T04:16:35Z")

</div>

I’m happy to see that the documentation in the 0.7 manual for the new package manager is greatly expanded, but it’s still a bit thin in describing how to develop applications (as opposed to packages). I’d like to develo…

---

## [Question about transitioning to a Revise-based workflow](https://discourse.julialang.org/t/question-about-transitioning-to-a-revise-based-workflow/14273)

<div class="topic-metadata">

**Author:** [@omalled](https://discourse.julialang.org/u/omalled)\
**Replies:** 5\
**Last updated:** [August 30, 2018, 10:23pm UTC](https://discourse.julialang.org/t/question-about-transitioning-to-a-revise-based-workflow/14273 "2018-08-30T22:23:55Z")

</div>

I am making the move from 0.6 to 0.7 and transitioning from a reload("MyModule"); include("myscript.jl") workflow to a Revise-based workflow as recommended in the deprecation warning for reload. I am using the setup desc…

---

## [Why typeof is built-in?](https://discourse.julialang.org/t/why-typeof-is-built-in/14327)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 13\
**Last updated:** [August 30, 2018, 10:20pm UTC](https://discourse.julialang.org/t/why-typeof-is-built-in/14327 "2018-08-30T22:20:45Z")

</div>

One could define typeof(x::T) where T = T. So why is it built-in instead of coded in Julia?

---

## [Create a vector of SVectors from a Matrix](https://discourse.julialang.org/t/create-a-vector-of-svectors-from-a-matrix/14324)

<div class="topic-metadata">

**Author:** [@dmbates](https://discourse.julialang.org/u/dmbates)\
**Replies:** 7\
**Last updated:** [August 30, 2018, 9:02pm UTC](https://discourse.julialang.org/t/create-a-vector-of-svectors-from-a-matrix/14324 "2018-08-30T21:02:28Z")

</div>

In the MixedModels package one of the structs contains a short, wide matrix for which the primary usage is column-wise. (The struct is VectorFactorReTerm defined in src/modelterms.jl for those who want to play along at …

---

## [New Pkg - local packages / shared depot](https://discourse.julialang.org/t/new-pkg-local-packages-shared-depot/14249)

<div class="topic-metadata">

**Author:** [@madprogrammer](https://discourse.julialang.org/u/madprogrammer)\
**Replies:** 4\
**Last updated:** [August 30, 2018, 7:16pm UTC](https://discourse.julialang.org/t/new-pkg-local-packages-shared-depot/14249 "2018-08-30T19:16:26Z")

</div>

I have been testing Julia 1.0 for a while and have some questions about the new Pkg, regarding some features that would fit my needs considering some restrictions I need to work with. First of all, the new Pkg does not …

---

## [Working with channels](https://discourse.julialang.org/t/working-with-channels/14325)

<div class="topic-metadata">

**Author:** [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Replies:** 0\
**Last updated:** [August 30, 2018, 5:07pm UTC](https://discourse.julialang.org/t/working-with-channels/14325 "2018-08-30T17:07:37Z")

</div>

Here’s a question about Channels - I read @oxinabox great introductions to Channels, and I’m considering a use case for them. I have some code that randomizes a Matrix. There’s some preprocessing going on, and the matric…

---

## [FileIO in 0.7](https://discourse.julialang.org/t/fileio-in-0-7/14322)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 6\
**Last updated:** [August 30, 2018, 4:40pm UTC](https://discourse.julialang.org/t/fileio-in-0-7/14322 "2018-08-30T16:40:36Z")

</div>

In 0.7, if I call using FileIO, I get WARNING: using FileIO.info in module Main conflicts with an existing identifier. Has this been deprecated? Is there something I am supposed to be using instead?

---

## [How to ensure async subprocess ends with Julia?](https://discourse.julialang.org/t/how-to-ensure-async-subprocess-ends-with-julia/14317)

<div class="topic-metadata">

**Author:** [@sglyon](https://discourse.julialang.org/u/sglyon)\
**Replies:** 4\
**Last updated:** [August 30, 2018, 2:57pm UTC](https://discourse.julialang.org/t/how-to-ensure-async-subprocess-ends-with-julia/14317 "2018-08-30T14:57:25Z")

</div>

Suppose I do something like this proc = open(\`long\_running\_command\`) How can I ensure that the process exits when Julia does? If I just open it, the process will outlive Julia.

---

## [Overload show and keep default Juno rendering](https://discourse.julialang.org/t/overload-show-and-keep-default-juno-rendering/14312)

<div class="topic-metadata">

**Author:** [@saschatimme](https://discourse.julialang.org/u/saschatimme)\
**Replies:** 2\
**Last updated:** [August 30, 2018, 2:17pm UTC](https://discourse.julialang.org/t/overload-show-and-keep-default-juno-rendering/14312 "2018-08-30T14:17:50Z")

</div>

Assume I have custom type struct Foo x::Int end for which I want do define pretty printing. If I overload Base.show(io, x) Base.show(io::IO, foo::Foo) = print(io, "Foo with value $(foo.x)") everything works great…

---

## [Broadcasting structs as scalars](https://discourse.julialang.org/t/broadcasting-structs-as-scalars/14310)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 5\
**Last updated:** [August 30, 2018, 12:34pm UTC](https://discourse.julialang.org/t/broadcasting-structs-as-scalars/14310 "2018-08-30T12:34:16Z")

</div>

The following code used to work in Julia v0.6.4, but it is not working in Julia v1.0. struct Q x::Int end f(q::Q, x::Int) = q.x + x f.(Q(2), \[1,2,3\]) # ERROR: MethodError: no method matching length(::Q) What sho…

---

## [What is the library for arrays of strings?](https://discourse.julialang.org/t/what-is-the-library-for-arrays-of-strings/164)

<div class="topic-metadata">

**Author:** [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Replies:** 7\
**Last updated:** [August 30, 2018, 12:07pm UTC](https://discourse.julialang.org/t/what-is-the-library-for-arrays-of-strings/164 "2018-08-30T12:07:41Z")

</div>

I often look in the docs to see what methods are available for arrays of strings, but it doesn’t look like there is a lot. Can anyone direct me to where a useful standard library for strings exist? methodswith(Vector{Str…

---

## [Pkg polluting /tmp](https://discourse.julialang.org/t/pkg-polluting-tmp/14308)

<div class="topic-metadata">

**Author:** [@lbilli](https://discourse.julialang.org/u/lbilli)\
**Replies:** 2\
**Last updated:** [August 30, 2018, 11:56am UTC](https://discourse.julialang.org/t/pkg-polluting-tmp/14308 "2018-08-30T11:56:06Z")

</div>

Starting from version 0.7/1.0 it seems that, after adding or updating packages, Julia leaves behind several randomly named folders in /tmp, such as: /tmp/TwOJH2Hzmugb /tmp/ngcKCsSKTqbo /tmp/5smw1tKbkzNt ... Is it possi…

---

## [Multiple dispatch and "x^-n equivalent to inv(x)^n for literal n"](https://discourse.julialang.org/t/multiple-dispatch-and-x-n-equivalent-to-inv-x-n-for-literal-n/14303)

<div class="topic-metadata">

**Author:** [@xzackli](https://discourse.julialang.org/u/xzackli)\
**Replies:** 1\
**Last updated:** [August 30, 2018, 11:23am UTC](https://discourse.julialang.org/t/multiple-dispatch-and-x-n-equivalent-to-inv-x-n-for-literal-n/14303 "2018-08-30T11:23:27Z")

</div>

Applying a negative integer exponent calls inv, from pull request #24240. I have a custom type based on a string, which I would like to exponentiate, for example struct LaTeXobj latex\_string::String end x = LaTeXo…

---

## [Julia vs Matlab side thread](https://discourse.julialang.org/t/julia-vs-matlab-side-thread/14244)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 3\
**Last updated:** [August 30, 2018, 10:46am UTC](https://discourse.julialang.org/t/julia-vs-matlab-side-thread/14244 "2018-08-30T10:46:29Z")

</div>

Julia could’ve been better than MATLAB, even in heavily vectorized code, if some of the great projects like ParallelAccelerator.jl were still active. It seems that the countless changes that Julia witnessed recently drov…

---

## [How to use macro that has been moved from base to a package (e.g. @everywhere)?](https://discourse.julialang.org/t/how-to-use-macro-that-has-been-moved-from-base-to-a-package-e-g-everywhere/14295)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 5\
**Last updated:** [August 30, 2018, 9:21am UTC](https://discourse.julialang.org/t/how-to-use-macro-that-has-been-moved-from-base-to-a-package-e-g-everywhere/14295 "2018-08-30T09:21:25Z")

</div>

I am trying to port the following Notebook to Julia 1.0: I am stock on the following point: @everywhere println(myid()) Julia 0.7 warns me with: WARNING: Base.@everywhere is deprecated: it has been moved to the s…

---

## [Change the color and shape of boxplot objects (mean, flier) by PyPlot](https://discourse.julialang.org/t/change-the-color-and-shape-of-boxplot-objects-mean-flier-by-pyplot/14287)

<div class="topic-metadata">

**Author:** [@HSFengWang](https://discourse.julialang.org/u/HSFengWang)\
**Replies:** 1\
**Last updated:** [August 30, 2018, 6:14am UTC](https://discourse.julialang.org/t/change-the-color-and-shape-of-boxplot-objects-mean-flier-by-pyplot/14287 "2018-08-30T06:14:25Z")

</div>

How to change the color and shape of boxplot objects by PyPlot. There some parameters like whiskerprops and meanprops, but I did not find any examples. Thank you! data = \[\[1,2,3\],\[2,5,6\],\[2,4,2,3,2\]\] fig = figure("pyp…

---

## [Pmap performance regression: pmap(x-\>f(x,y), X) creates copies of y](https://discourse.julialang.org/t/pmap-performance-regression-pmap-x-f-x-y-x-creates-copies-of-y/14221)

<div class="topic-metadata">

**Author:** [@kaskarn](https://discourse.julialang.org/u/kaskarn)\
**Replies:** 9\
**Last updated:** [August 30, 2018, 3:16am UTC](https://discourse.julialang.org/t/pmap-performance-regression-pmap-x-f-x-y-x-creates-copies-of-y/14221 "2018-08-30T03:16:00Z")

</div>

Updating some code from 0.5 to 1.0 massively slowed pmap calls for our use case. Briefly, distributing the computation of f(x,arg) over the set X seems to copy and send arg during each iteration. This becomes a problem …

---

## [Writing a parser in Julia](https://discourse.julialang.org/t/writing-a-parser-in-julia/13769)

<div class="topic-metadata">

**Author:** [@Drgo](https://discourse.julialang.org/u/Drgo)\
**Replies:** 10\
**Last updated:** [August 30, 2018, 2:13am UTC](https://discourse.julialang.org/t/writing-a-parser-in-julia/13769 "2018-08-30T02:13:09Z")

</div>

Hello, Has anyone written a parser in Julia for an arbitrary syntax (other than Julia’s)? Any packages available for lexing and parsing? Thanks,

---

## [Wrapper Types](https://discourse.julialang.org/t/wrapper-types/14278)

<div class="topic-metadata">

**Author:** [@filipebraida](https://discourse.julialang.org/u/filipebraida)\
**Replies:** 6\
**Last updated:** [August 30, 2018, 2:06am UTC](https://discourse.julialang.org/t/wrapper-types/14278 "2018-08-30T02:06:21Z")

</div>

I am rebuilding my framework (recommender systems). I’m thinking about a new modeling of the problem and I’m testing some things. However, I was left with some doubts and I did not find a solution here. I created a wr…

---

## [How to use packages in \`dev\` rather than \`packages\`?](https://discourse.julialang.org/t/how-to-use-packages-in-dev-rather-than-packages/14265)

<div class="topic-metadata">

**Author:** [@jwu](https://discourse.julialang.org/u/jwu)\
**Replies:** 7\
**Last updated:** [August 29, 2018, 9:56pm UTC](https://discourse.julialang.org/t/how-to-use-packages-in-dev-rather-than-packages/14265 "2018-08-29T21:56:16Z")

</div>

In Julia 0.7, I have installed package in dev and package, but Julia is using the package in packages rather than dev!

---

## [JuMP "getvalue" suddenly very slow](https://discourse.julialang.org/t/jump-getvalue-suddenly-very-slow/14259)

<div class="topic-metadata">

**Author:** [@shoshievass](https://discourse.julialang.org/u/shoshievass)\
**Replies:** 2\
**Last updated:** [August 29, 2018, 8:47pm UTC](https://discourse.julialang.org/t/jump-getvalue-suddenly-very-slow/14259 "2018-08-29T20:47:17Z")

</div>

I’m using JuMP with a fairly large model (the largest component is a dict of @NLexpressions of size 10,254,747). Usually this works fine, and JuMP performs well. Recently, I’ve tried to do a ‘second stage’ optimization …

---

## [How to assignment of single value to multiple indexes to an Array?](https://discourse.julialang.org/t/how-to-assignment-of-single-value-to-multiple-indexes-to-an-array/14263)

<div class="topic-metadata">

**Author:** [@jwu](https://discourse.julialang.org/u/jwu)\
**Replies:** 3\
**Last updated:** [August 29, 2018, 8:25pm UTC](https://discourse.julialang.org/t/how-to-assignment-of-single-value-to-multiple-indexes-to-an-array/14263 "2018-08-29T20:25:09Z")

</div>

This code works in Julia 0.6, but not the latest Julia 0.7. Is there any alternative ways to do this? seg = zeros(UInt32,(100,100,100)) seg\[48:52,48:52, 1:end \] = one(UInt32) I got errors as follows: ERROR: M…

---

## [\`Base.rand\` but \`Random.rand!\`?](https://discourse.julialang.org/t/base-rand-but-random-rand/14174)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 25\
**Last updated:** [August 29, 2018, 7:55pm UTC](https://discourse.julialang.org/t/base-rand-but-random-rand/14174 "2018-08-29T19:55:40Z")

</div>

It doesn’t make sense to me that rand is in Base but rand! is in in the stdlib Random. I get that all the other random number related stuff got moved but this seems inconsistent to me. What was the reasoning here? I’d o…

---

## [Boolean Logic Package](https://discourse.julialang.org/t/boolean-logic-package/14241)

<div class="topic-metadata">

**Author:** [@rpgowers](https://discourse.julialang.org/u/rpgowers)\
**Replies:** 1\
**Last updated:** [August 29, 2018, 4:20pm UTC](https://discourse.julialang.org/t/boolean-logic-package/14241 "2018-08-29T16:20:48Z")

</div>

I am wondering if there exists a package for more complex Boolean operations. Some simple examples would be: majority logic, majority(\[false,true,false\]) = false logic gates which have multiple outputs, such as…

---

## [Question about DiffEqOperators](https://discourse.julialang.org/t/question-about-diffeqoperators/14242)

<div class="topic-metadata">

**Author:** [@jtravs](https://discourse.julialang.org/u/jtravs)\
**Replies:** 3\
**Last updated:** [August 29, 2018, 3:45pm UTC](https://discourse.julialang.org/t/question-about-diffeqoperators/14242 "2018-08-29T15:45:18Z")

</div>

I’m interested in possibly using the DiffEqOperators functionality in DifferentialEquations.jl I usually solve systems of nonlinear equations that are of the form \\frac{\\partial A}{\\partial z} = i\\beta(z) A + F(A,z) w…

---

## [Incomplete Gamma Function](https://discourse.julialang.org/t/incomplete-gamma-function/14220)

<div class="topic-metadata">

**Author:** [@gideonsimpson](https://discourse.julialang.org/u/gideonsimpson)\
**Replies:** 4\
**Last updated:** [August 29, 2018, 3:12pm UTC](https://discourse.julialang.org/t/incomplete-gamma-function/14220 "2018-08-29T15:12:08Z")

</div>

What’s a recommended way to compute the incomplete Gamma functions in Julia? I’m using 0.7.

---

## [PlotlyJS Pkg.add error : Markdown not defined](https://discourse.julialang.org/t/plotlyjs-pkg-add-error-markdown-not-defined/14238)

<div class="topic-metadata">

**Author:** [@dbpatankar](https://discourse.julialang.org/u/dbpatankar)\
**Replies:** 2\
**Last updated:** [August 29, 2018, 1:36pm UTC](https://discourse.julialang.org/t/plotlyjs-pkg-add-error-markdown-not-defined/14238 "2018-08-29T13:36:37Z")

</div>

Want to use PlotlyJS as backend for plots. So I do Pkg.add(“PlotlyJS”) I get following error Building PlotlyJS → ~/.julia/packages/PlotlyJS/3eSkF/deps/build.log ┌ Error: Error building PlotlyJS: │ % Total % Rece…

---

## [Extract type name only from parametric type](https://discourse.julialang.org/t/extract-type-name-only-from-parametric-type/14188)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 24\
**Last updated:** [August 29, 2018, 1:09pm UTC](https://discourse.julialang.org/t/extract-type-name-only-from-parametric-type/14188 "2018-08-29T13:09:25Z")

</div>

Suppose I have a function that takes a value of a parametric type, for example: abstract type AbstractMyType{Q} end struct MyType1{Q} \<: AbstractMyType{Q} end struct MyType2{Q} \<: AbstractMyType{Q} end f(x::T) where {T\<…

---

## [How do I push an array to the garbage collector in C?](https://discourse.julialang.org/t/how-do-i-push-an-array-to-the-garbage-collector-in-c/13942)

<div class="topic-metadata">

**Author:** [@kim366](https://discourse.julialang.org/u/kim366)\
**Replies:** 4\
**Last updated:** [August 29, 2018, 12:52pm UTC](https://discourse.julialang.org/t/how-do-i-push-an-array-to-the-garbage-collector-in-c/13942 "2018-08-29T12:52:52Z")

</div>

So on https://docs.julialang.org/en/stable/manual/embedding/ it says how to use Julia arrays and the garbage collector in C, but not how to use them together. Let’s say, I allocated an array in the following manner as i…

---

## [Macro: replace array indexing by function call in expression](https://discourse.julialang.org/t/macro-replace-array-indexing-by-function-call-in-expression/14234)

<div class="topic-metadata">

**Author:** [@carstenbauer](https://discourse.julialang.org/u/carstenbauer)\
**Replies:** 10\
**Last updated:** [August 29, 2018, 12:49pm UTC](https://discourse.julialang.org/t/macro-replace-array-indexing-by-function-call-in-expression/14234 "2018-08-29T12:49:54Z")

</div>

I’m a complete macro noob. Given an expression which contains (multiple) array indexing operations g\[i1, i2\], how do I replace all such occurrences by a function call G(i1,i2)? So what I want is all g\[i1,i2\] become G(i1,…

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

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