# General Usage

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

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

**Page:** 970

---

## [Help with type instability needed](https://discourse.julialang.org/t/help-with-type-instability-needed/11749)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 5\
**Last updated:** [June 19, 2018, 3:13am UTC](https://discourse.julialang.org/t/help-with-type-instability-needed/11749 "2018-06-19T03:13:52Z")

</div>

I would like to write a function grideval(f,x) that evaluates a function f on the cartesian grid described by the tuple x of one-dimensional grid coordinates. This is what I have so far: """ cartesian(x::AbstractVec…

---

## [Simulation Framework with Logging to Tabular Data](https://discourse.julialang.org/t/simulation-framework-with-logging-to-tabular-data/5205)

<div class="topic-metadata">

**Author:** [@philip](https://discourse.julialang.org/u/philip)\
**Replies:** 25\
**Last updated:** [June 19, 2018, 2:45am UTC](https://discourse.julialang.org/t/simulation-framework-with-logging-to-tabular-data/5205 "2018-06-19T02:45:19Z")

</div>

Is there any existing framework or set of macros for building mutable container types that can be easily logged into tabular data? Here’s a dumb example: using DataFrames srand(1) mutable struct Person age::Int64 …

---

## [Can we access shell variables from Julia?](https://discourse.julialang.org/t/can-we-access-shell-variables-from-julia/11750)

<div class="topic-metadata">

**Author:** [@tlienart](https://discourse.julialang.org/u/tlienart)\
**Replies:** 4\
**Last updated:** [June 19, 2018, 12:37am UTC](https://discourse.julialang.org/t/can-we-access-shell-variables-from-julia/11750 "2018-06-19T00:37:15Z")

</div>

I may be missing something but would it be possible to use $ (or appropriate symbol) in a Cmd object in the “shell sense” as opposed to the julia interpolation sense? As a slightly stupid example: run(\`echo $PWD\`) woul…

---

## [Can't define dependencies with Pkg3 (v0.7)](https://discourse.julialang.org/t/cant-define-dependencies-with-pkg3-v0-7/11764)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 1\
**Last updated:** [June 18, 2018, 8:25pm UTC](https://discourse.julialang.org/t/cant-define-dependencies-with-pkg3-v0-7/11764 "2018-06-18T20:25:02Z")

</div>

I have a project (started in 0.6 which I’m now updating to 0.7). I’ve started by adding a few dependencies: (hotel-hound) pkg\> status Status \`Project.toml\` \[c513aa4d\] DateParser v0.1.1+ \[\`~/.julia/dev/DateParser\`\]…

---

## [Assigning inside a macro, and proper way to create this expr](https://discourse.julialang.org/t/assigning-inside-a-macro-and-proper-way-to-create-this-expr/11724)

<div class="topic-metadata">

**Author:** [@digital\_carver](https://discourse.julialang.org/u/digital_carver)\
**Replies:** 4\
**Last updated:** [June 18, 2018, 5:58pm UTC](https://discourse.julialang.org/t/assigning-inside-a-macro-and-proper-way-to-create-this-expr/11724 "2018-06-18T17:58:24Z")

</div>

I (as a beginner to macros) was looking to write a macro @deal such that I could write: @deal R a b (where length(a)+length(b)==length(R)), and have it distribute the values in R into a and b - for eg. if length(R)==10,…

---

## [Video/mp4 in IJulia](https://discourse.julialang.org/t/video-mp4-in-ijulia/11756)

<div class="topic-metadata">

**Author:** [@cstjean](https://discourse.julialang.org/u/cstjean)\
**Replies:** 3\
**Last updated:** [June 18, 2018, 2:08pm UTC](https://discourse.julialang.org/t/video-mp4-in-ijulia/11756 "2018-06-18T14:08:39Z")

</div>

I can embed a gif in an IJulia notebook with display(MIME"image/png"(), read(open(filename))). Is there a reason why display(MIME"video/mp4"(), read(open(filename))) does not work? It simply does nothing.

---

## [Why is changing type of variable problematic?](https://discourse.julialang.org/t/why-is-changing-type-of-variable-problematic/11722)

<div class="topic-metadata">

**Author:** [@nickeubank](https://discourse.julialang.org/u/nickeubank)\
**Replies:** 19\
**Last updated:** [June 18, 2018, 2:06pm UTC](https://discourse.julialang.org/t/why-is-changing-type-of-variable-problematic/11722 "2018-06-18T14:06:03Z")

</div>

I was wondering if anyone could explain why changing the type of a variable is problematic in Julia. I (think) I understand the reason type-instabilities are a problem when they arise conditional on the value (rather th…

---

## [Benchmarking before and after Spectre BIOS fix](https://discourse.julialang.org/t/benchmarking-before-and-after-spectre-bios-fix/11751)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 0\
**Last updated:** [June 18, 2018, 8:34am UTC](https://discourse.julialang.org/t/benchmarking-before-and-after-spectre-bios-fix/11751 "2018-06-18T08:34:18Z")

</div>

I guess the Spectre/Meltdown thing has been done to death. However I have an HP laptop, which has a BIOS update available. It seems to be a mitigation for Spectre. It is only a Core i7 dual core, so not exactly a multico…

---

## [Returning a module expression from a macro to be evaluated at a different module](https://discourse.julialang.org/t/returning-a-module-expression-from-a-macro-to-be-evaluated-at-a-different-module/11738)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [June 18, 2018, 7:27am UTC](https://discourse.julialang.org/t/returning-a-module-expression-from-a-macro-to-be-evaluated-at-a-different-module/11738 "2018-06-18T07:27:07Z")

</div>

Hi Fellows, I was trying to return a module expression to be evaluated at the top module of where i do the macrocall. Here is an example: module X export @cmodule is\_module(a) = false is\_module(e::Expr) = e.head …

---

## [Help interpolating a symbol](https://discourse.julialang.org/t/help-interpolating-a-symbol/11743)

<div class="topic-metadata">

**Author:** [@pdeffebach](https://discourse.julialang.org/u/pdeffebach)\
**Replies:** 8\
**Last updated:** [June 18, 2018, 3:04am UTC](https://discourse.julialang.org/t/help-interpolating-a-symbol/11743 "2018-06-18T03:04:50Z")

</div>

I am trying to make a value that does the following var = :x1 @replace\_name var = 4 I am trying to start to figure this out by doing a macro like this: macro repname(y,body) body.args\[1\] = y esc(body) en…

---

## [Can I make docstrings work with @everywhere?](https://discourse.julialang.org/t/can-i-make-docstrings-work-with-everywhere/11402)

<div class="topic-metadata">

**Author:** [@chunkulator](https://discourse.julialang.org/u/chunkulator)\
**Replies:** 2\
**Last updated:** [June 18, 2018, 12:10am UTC](https://discourse.julialang.org/t/can-i-make-docstrings-work-with-everywhere/11402 "2018-06-18T00:10:57Z")

</div>

It seems I can’t document my code with docstrings if I want to do parallel computing with the @everywhere macro: test\_docstring.jl: "This is a doc string" @everywhere function foo() nothing end julia\> versioninfo(…

---

## [How to define a function in a different module other than what you are in right now](https://discourse.julialang.org/t/how-to-define-a-function-in-a-different-module-other-than-what-you-are-in-right-now/11736)

<div class="topic-metadata">

**Author:** [@Qiyamah](https://discourse.julialang.org/u/Qiyamah)\
**Replies:** 1\
**Last updated:** [June 17, 2018, 8:44pm UTC](https://discourse.julialang.org/t/how-to-define-a-function-in-a-different-module-other-than-what-you-are-in-right-now/11736 "2018-06-17T20:44:35Z")

</div>

Hi Fellows, module DDF end function DDF.foo(x::Int) x+1 end i want to define a function within DDF like foo. How can i do that? The example above doesn’t work.

---

## [Status of ControlSystems.jl](https://discourse.julialang.org/t/status-of-controlsystems-jl/11708)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 14\
**Last updated:** [June 17, 2018, 12:02pm UTC](https://discourse.julialang.org/t/status-of-controlsystems-jl/11708 "2018-06-17T12:02:02Z")

</div>

Hello, What is the status of the JuliaControl organization and the package ControlSystems.jl? I want to model state space systems. Is that already implemented in ControlSystems.jl? I know there is also the package Con…

---

## [Local specialization of global function](https://discourse.julialang.org/t/local-specialization-of-global-function/11730)

<div class="topic-metadata">

**Author:** [@mzaffalon](https://discourse.julialang.org/u/mzaffalon)\
**Replies:** 0\
**Last updated:** [June 17, 2018, 4:49am UTC](https://discourse.julialang.org/t/local-specialization-of-global-function/11730 "2018-06-17T04:49:00Z")

</div>

Is there a reason why one cannot specialize the global function k within the scope of another function? This is on Julia 0.6.3. k(a, b) = a + b function doesnotwork(B) k(a) = k(a, B) k(1) end function doeswork…

---

## [Plan FFTs both in julia 0.6.3 and 0.7](https://discourse.julialang.org/t/plan-ffts-both-in-julia-0-6-3-and-0-7/11728)

<div class="topic-metadata">

**Author:** [@navidcy](https://discourse.julialang.org/u/navidcy)\
**Replies:** 2\
**Last updated:** [June 17, 2018, 4:04am UTC](https://discourse.julialang.org/t/plan-ffts-both-in-julia-0-6-3-and-0-7/11728 "2018-06-17T04:04:51Z")

</div>

I’m trying to make my package (FourierFlows.jl) compatible with v0.7.0. I have some trouble planning the fft’s. I can plan the ffts and do in-place ffts in both 0.7.0 and 0.6.3. However, I don’t know how to code it up in…

---

## [Potential small inefficiency in \`triu!\` and \`tril!\`?](https://discourse.julialang.org/t/potential-small-inefficiency-in-triu-and-tril/11725)

<div class="topic-metadata">

**Author:** [@Seif\_Shebl](https://discourse.julialang.org/u/Seif_Shebl)\
**Replies:** 0\
**Last updated:** [June 16, 2018, 9:20pm UTC](https://discourse.julialang.org/t/potential-small-inefficiency-in-triu-and-tril/11725 "2018-06-16T21:20:58Z")

</div>

The definition of triu! in dense.jl of LinearAlgebra is copy-pasted below. Observing line 181, we see that zero(M\[i\]) is calculated at each iteration of the inner loop. Obviously, this can be moved out of the loop and re…

---

## [Plotting bar chart inside a loop](https://discourse.julialang.org/t/plotting-bar-chart-inside-a-loop/11646)

<div class="topic-metadata">

**Author:** [@jayce\_ram](https://discourse.julialang.org/u/jayce_ram)\
**Replies:** 2\
**Last updated:** [June 15, 2018, 9:42pm UTC](https://discourse.julialang.org/t/plotting-bar-chart-inside-a-loop/11646 "2018-06-15T21:42:07Z")

</div>

I would like to plot a bar chart like this following one : The x-axe data are represented by dates x\_years = \[ "2018", "2019"\] and my y-axe data represents the amount of production of a given product. This informati…

---

## [Memory allocation in macro programming](https://discourse.julialang.org/t/memory-allocation-in-macro-programming/11706)

<div class="topic-metadata">

**Author:** [@bkang119](https://discourse.julialang.org/u/bkang119)\
**Replies:** 2\
**Last updated:** [June 15, 2018, 8:34pm UTC](https://discourse.julialang.org/t/memory-allocation-in-macro-programming/11706 "2018-06-15T20:34:09Z")

</div>

Hi I have a simple question regarding memory allocation in macro programming. A simplified version of my question is as follows: Given an expression such as ex1 = :(A\[a,b,c\]), I would like to extract indices :a, :b, an…

---

## [Cannot find installed modules when 0.7 is not launched from bindir](https://discourse.julialang.org/t/cannot-find-installed-modules-when-0-7-is-not-launched-from-bindir/11676)

<div class="topic-metadata">

**Author:** [@raminammour](https://discourse.julialang.org/u/raminammour)\
**Replies:** 2\
**Last updated:** [June 15, 2018, 8:20pm UTC](https://discourse.julialang.org/t/cannot-find-installed-modules-when-0-7-is-not-launched-from-bindir/11676 "2018-06-15T20:20:40Z")

</div>

Hello, I have JULIA\_DEPOT\_PATH set up. When julia is launched from its bindir=Sys.BINDIR, v0.7-alphafinds the modules inJULIA\_DEPOT\_PATH\`; when launched from any other folder I get the error: ERROR: ArgumentError: Modu…

---

## [Efficiently using single large dataframe over multiple workers](https://discourse.julialang.org/t/efficiently-using-single-large-dataframe-over-multiple-workers/11696)

<div class="topic-metadata">

**Author:** [@dgcbritto](https://discourse.julialang.org/u/dgcbritto)\
**Replies:** 10\
**Last updated:** [June 15, 2018, 7:10pm UTC](https://discourse.julialang.org/t/efficiently-using-single-large-dataframe-over-multiple-workers/11696 "2018-06-15T19:10:21Z")

</div>

I’m new to Julia and programming in general. I need to run many linear regressions using exactly the same large dataset 5GB+. I’ve wrote a code to run each regression over different workers. Essentially, I’m copying the …

---

## [Julia Performance vs. C](https://discourse.julialang.org/t/julia-performance-vs-c/11675)

<div class="topic-metadata">

**Author:** [@jinliangwei](https://discourse.julialang.org/u/jinliangwei)\
**Replies:** 8\
**Last updated:** [June 15, 2018, 1:29pm UTC](https://discourse.julialang.org/t/julia-performance-vs-c/11675 "2018-06-15T13:29:12Z")

</div>

I wonder if someone has taken a closer look at the Julia microbenchmarks or has some better understanding of what causes the performance difference between Julia and C. I am guessing that Julia has a higher overhead for…

---

## [JuliaDB & OnlineStats syntax for linear regression](https://discourse.julialang.org/t/juliadb-onlinestats-syntax-for-linear-regression/11643)

<div class="topic-metadata">

**Author:** [@MaximilianJHuber](https://discourse.julialang.org/u/MaximilianJHuber)\
**Replies:** 5\
**Last updated:** [June 15, 2018, 11:51am UTC](https://discourse.julialang.org/t/juliadb-onlinestats-syntax-for-linear-regression/11643 "2018-06-15T11:51:35Z")

</div>

I cannot seem to figure out how to run a LinReg Onlinestat on my JuliaDB table. Especially, how to tell the reduce function what the left-hand-side and right-hand-side variables are. The following runs a regression of y …

---

## [Precompiling submodules](https://discourse.julialang.org/t/precompiling-submodules/11683)

<div class="topic-metadata">

**Author:** [@tbo](https://discourse.julialang.org/u/tbo)\
**Replies:** 3\
**Last updated:** [June 15, 2018, 11:31am UTC](https://discourse.julialang.org/t/precompiling-submodules/11683 "2018-06-15T11:31:38Z")

</div>

Hi all, I’m having a hard time with \_\_precompile\_\_(). I have a large project which consists of multiple submodules. To speed up the compilation process, I want to precompile some of the submodules, that would in theory …

---

## [Using an already-loaded module in 0.7](https://discourse.julialang.org/t/using-an-already-loaded-module-in-0-7/11587)

<div class="topic-metadata">

**Author:** [@barche](https://discourse.julialang.org/u/barche)\
**Replies:** 6\
**Last updated:** [June 15, 2018, 11:29am UTC](https://discourse.julialang.org/t/using-an-already-loaded-module-in-0-7/11587 "2018-06-15T11:29:15Z")

</div>

When doing the following in 0.7: module Foo end using Foo This yields: ERROR: ArgumentError: Module Foo not found in current path. Run \`Pkg.add("Foo")\` to install the Foo package. I found I could do using Main.Foo in…

---

## [Dates not found in current path (v0.7-alpha)](https://discourse.julialang.org/t/dates-not-found-in-current-path-v0-7-alpha/11686)

<div class="topic-metadata">

**Author:** [@Ralph\_Smith](https://discourse.julialang.org/u/Ralph_Smith)\
**Replies:** 1\
**Last updated:** [June 15, 2018, 4:21am UTC](https://discourse.julialang.org/t/dates-not-found-in-current-path-v0-7-alpha/11686 "2018-06-15T04:21:36Z")

</div>

I am encountering this: ERROR: LoadError: ArgumentError: Module Dates not found in current path. Run \`Pkg.add("Dates")\` to install the Dates package. while working on some local packages and scripts, but not others. (D…

---

## [Package Manager (0.7) - Difference between CLI add and Pkg.add](https://discourse.julialang.org/t/package-manager-0-7-difference-between-cli-add-and-pkg-add/11665)

<div class="topic-metadata">

**Author:** [@pazzo83](https://discourse.julialang.org/u/pazzo83)\
**Replies:** 6\
**Last updated:** [June 14, 2018, 8:58pm UTC](https://discourse.julialang.org/t/package-manager-0-7-difference-between-cli-add-and-pkg-add/11665 "2018-06-14T20:58:19Z")

</div>

Hi, I am just starting to use 0.7, and I’m a bit confused as to how the new package manager for adding packages. Generally are we still supposed to be using Pkg.add, or should we now do everything via the new CLI (which…

---

## [Julia noob trying Computer Vision](https://discourse.julialang.org/t/julia-noob-trying-computer-vision/11679)

<div class="topic-metadata">

**Author:** [@microlifecc](https://discourse.julialang.org/u/microlifecc)\
**Replies:** 6\
**Last updated:** [June 14, 2018, 8:04pm UTC](https://discourse.julialang.org/t/julia-noob-trying-computer-vision/11679 "2018-06-14T20:04:20Z")

</div>

Hi guys! I am new to Julia and am trying to implement some Computer Vision algorithms such as SIFT in Julia. Can you please suggest some resources and packages that might be helpful? Till now I have only gone through the…

---

## [Can't update packages in Docker container from JuliaComputing](https://discourse.julialang.org/t/cant-update-packages-in-docker-container-from-juliacomputing/11669)

<div class="topic-metadata">

**Author:** [@ScottPJones](https://discourse.julialang.org/u/ScottPJones)\
**Replies:** 2\
**Last updated:** [June 14, 2018, 12:05pm UTC](https://discourse.julialang.org/t/cant-update-packages-in-docker-container-from-juliacomputing/11669 "2018-06-14T12:05:50Z")

</div>

It gets an error at the very end: INFO: Computing changes... ERROR: resolve is unable to satisfy package requirements. The problem was detected when trying to find a feasible version for package NullableArrays. Ho…

---

## [How to batch indexing tensors in Julia](https://discourse.julialang.org/t/how-to-batch-indexing-tensors-in-julia/11671)

<div class="topic-metadata">

**Author:** [@Roger-luo](https://discourse.julialang.org/u/Roger-luo)\
**Replies:** 1\
**Last updated:** [June 14, 2018, 9:58am UTC](https://discourse.julialang.org/t/how-to-batch-indexing-tensors-in-julia/11671 "2018-06-14T09:58:35Z")

</div>

e.g A = rand(30, 2, 30) and now I have a batch of index \[1, 2, 1, 1, 1, 2\], I want to have the result of this batched indexing res of size (30, 6, 30), where res\[:, 1, :\] == A\[:, 1, :\] res\[:, 2, :\] == A\[:, 2, :\] res\[:…

---

## [0.7 deprecation: Use \`at most one line break\`](https://discourse.julialang.org/t/0-7-deprecation-use-at-most-one-line-break/11663)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 9\
**Last updated:** [June 14, 2018, 9:21am UTC](https://discourse.julialang.org/t/0-7-deprecation-use-at-most-one-line-break/11663 "2018-06-14T09:21:30Z")

</div>

Hi, I’ve ported most of GMT.jl to 0.7 but keep receiving many of these. Don’t understand what it wants with this story of the line breaks. Thanks for pointers. Warning: Deprecated syntax \`multiple line breaks between …

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

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