# General Usage

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

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

**Page:** 1022

---

## [New method defined at REPL not getting called](https://discourse.julialang.org/t/new-method-defined-at-repl-not-getting-called/6454)

<div class="topic-metadata">

**Author:** [@ssfrr](https://discourse.julialang.org/u/ssfrr)\
**Replies:** 0\
**Last updated:** [October 15, 2017, 11:47pm UTC](https://discourse.julialang.org/t/new-method-defined-at-repl-not-getting-called/6454 "2017-10-15T23:47:02Z")

</div>

I’m getting some behavior that seems suspiciously like #265, but of course that cannot be. Basically I’m calling a function, then defining a new method that should catch it, then calling it again, and my new method isn’…

---

## [Initiate workers on a remote cluster from local master process](https://discourse.julialang.org/t/initiate-workers-on-a-remote-cluster-from-local-master-process/6450)

<div class="topic-metadata">

**Author:** [@Janis\_Erdmanis](https://discourse.julialang.org/u/Janis_Erdmanis)\
**Replies:** 0\
**Last updated:** [October 15, 2017, 7:39pm UTC](https://discourse.julialang.org/t/initiate-workers-on-a-remote-cluster-from-local-master-process/6450 "2017-10-15T19:39:42Z")

</div>

Hello. I am trying to set up workflow with cluster so that my master process would be on my local PC. In that way for example data would be immediately saved locally, and with a simple change for include statements (Send…

---

## [Max and maximum: why the difference?](https://discourse.julialang.org/t/max-and-maximum-why-the-difference/3113)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 10\
**Last updated:** [October 15, 2017, 5:00am UTC](https://discourse.julialang.org/t/max-and-maximum-why-the-difference/3113 "2017-10-15T05:00:45Z")

</div>

max operates only on its arguments\*, and is only useful if the number of args is \> 1.\*\* maximum operates on a collection and only takes a second argument in specific cases. Is there any reason why we couldn’t have a sin…

---

## [Job hangs - "waiting for job to start" on a PBS Cluster](https://discourse.julialang.org/t/job-hangs-waiting-for-job-to-start-on-a-pbs-cluster/3755)

<div class="topic-metadata">

**Author:** [@Snir\_Gazit](https://discourse.julialang.org/u/Snir_Gazit)\
**Replies:** 2\
**Last updated:** [October 14, 2017, 11:31pm UTC](https://discourse.julialang.org/t/job-hangs-waiting-for-job-to-start-on-a-pbs-cluster/3755 "2017-10-14T23:31:11Z")

</div>

I’m trying to use ClusterManagers on a PBS cluster (interactively e.g.) julia\> using ClusterManagers julia\> addprocs\_pbs(2, queue="default") job id is 135963, waiting for job to start ..................................…

---

## [Cleaner way for applying conv2 to RGB image](https://discourse.julialang.org/t/cleaner-way-for-applying-conv2-to-rgb-image/6438)

<div class="topic-metadata">

**Author:** [@FlorinGogianu](https://discourse.julialang.org/u/FlorinGogianu)\
**Replies:** 0\
**Last updated:** [October 14, 2017, 2:32pm UTC](https://discourse.julialang.org/t/cleaner-way-for-applying-conv2-to-rgb-image/6438 "2017-10-14T14:32:47Z")

</div>

I am looking to apply conv2 on a RGB image. However the two solutions I arrived at don’t look very good. Questions: Is there any a better way to apply conv2 along a given dimension of img and return the result? Is ther…

---

## [Marching cubes without extra allocations](https://discourse.julialang.org/t/marching-cubes-without-extra-allocations/6222)

<div class="topic-metadata">

**Author:** [@louisponet](https://discourse.julialang.org/u/louisponet)\
**Replies:** 8\
**Last updated:** [October 14, 2017, 4:40pm UTC](https://discourse.julialang.org/t/marching-cubes-without-extra-allocations/6222 "2017-10-14T16:40:35Z")

</div>

Hi, I’ve been trying to implement a version of the famous marching cubes algorithm and have arrived at the following abomination: function marching\_cubes(values::Array{T,3},points::Array{Point3D{T},3},iso,cube\_size=1) …

---

## [Surprising performance characteristic: What is happening here?](https://discourse.julialang.org/t/surprising-performance-characteristic-what-is-happening-here/6420)

<div class="topic-metadata">

**Author:** [@saschatimme](https://discourse.julialang.org/u/saschatimme)\
**Replies:** 4\
**Last updated:** [October 14, 2017, 9:56am UTC](https://discourse.julialang.org/t/surprising-performance-characteristic-what-is-happening-here/6420 "2017-10-14T09:56:03Z")

</div>

I ran into some performance discrepancies, which I do not completely understand. Maybe someone of you has an idea? I want to compute the product of a vector of elements of length 2^k (for simplicity). But instead of co…

---

## [Does Julia have function prototypes?](https://discourse.julialang.org/t/does-julia-have-function-prototypes/6387)

<div class="topic-metadata">

**Author:** [@cjb](https://discourse.julialang.org/u/cjb)\
**Replies:** 6\
**Last updated:** [October 14, 2017, 9:08am UTC](https://discourse.julialang.org/t/does-julia-have-function-prototypes/6387 "2017-10-14T09:08:48Z")

</div>

Hello. I am wondering if it’s possible to have function prototypes, similar to what one does in C or C++ in a header file. I would like to have such prototypes because it makes it very easy to read a julia file and see …

---

## [Way to add progress bar to map function?](https://discourse.julialang.org/t/way-to-add-progress-bar-to-map-function/6426)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 3\
**Last updated:** [October 13, 2017, 9:22pm UTC](https://discourse.julialang.org/t/way-to-add-progress-bar-to-map-function/6426 "2017-10-13T21:22:09Z")

</div>

What would be the best way to add a loading bar (or just simple dots) to a map function This is for maps that can take several minutes. i.e. function foo(x) sleep(x) x ^ 2 end cur\_range = 1:3 map(x -\> foo(x), c…

---

## [Avoiding Dynamic dispatch](https://discourse.julialang.org/t/avoiding-dynamic-dispatch/4285)

<div class="topic-metadata">

**Author:** [@Nitin\_Arora](https://discourse.julialang.org/u/Nitin_Arora)\
**Replies:** 11\
**Last updated:** [October 13, 2017, 2:47pm UTC](https://discourse.julialang.org/t/avoiding-dynamic-dispatch/4285 "2017-10-13T14:47:49Z")

</div>

I am trying to write fairly complicated optimization tool and am running into a use case where the function being called depends on user inputs and hence resulting the need for dynamic dispatch. I could also just impleme…

---

## [Does JuliaPro supports debugging in 0.6?](https://discourse.julialang.org/t/does-juliapro-supports-debugging-in-0-6/6287)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [October 13, 2017, 1:44pm UTC](https://discourse.julialang.org/t/does-juliapro-supports-debugging-in-0-6/6287 "2017-10-13T13:44:29Z")

</div>

In their page, Julia computing claims debugging within the offered features, but Gallium.jl doesn’t still work on Julia 0.6, so debugging is disabled in “normal” Juno. How do they do it in JuliaPro ?

---

## [Columnwise/rowwise elementwise multiplication?](https://discourse.julialang.org/t/columnwise-rowwise-elementwise-multiplication/6412)

<div class="topic-metadata">

**Author:** [@Daneel](https://discourse.julialang.org/u/Daneel)\
**Replies:** 2\
**Last updated:** [October 13, 2017, 6:13am UTC](https://discourse.julialang.org/t/columnwise-rowwise-elementwise-multiplication/6412 "2017-10-13T06:13:50Z")

</div>

Is there an easier way of element-wise multiplying a vector, x, by each column in an array? Below I do it with a for loop. I’ve tried using mapslices but I still need to broadcast x over each slice. julia\> x = \[1;2;3\] 3…

---

## [Clean up DataFrame code for Julia benchmarks](https://discourse.julialang.org/t/clean-up-dataframe-code-for-julia-benchmarks/6415)

<div class="topic-metadata">

**Author:** [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Replies:** 0\
**Last updated:** [October 12, 2017, 5:36pm UTC](https://discourse.julialang.org/t/clean-up-dataframe-code-for-julia-benchmarks/6415 "2017-10-12T17:36:16Z")

</div>

I’ve been hacking https://github.com/JuliaLang/julialang.github.com/blob/master/benchmarks.ipynb to automate several steps in producing the microbenchmark plot on Juialang.org. I’ve gotten it to do what I want, but since…

---

## [Triangular patches in Plots](https://discourse.julialang.org/t/triangular-patches-in-plots/6406)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon](https://discourse.julialang.org/u/Philippe_Maincon)\
**Replies:** 7\
**Last updated:** [October 12, 2017, 4:52pm UTC](https://discourse.julialang.org/t/triangular-patches-in-plots/6406 "2017-10-12T16:52:37Z")

</div>

Hi, I am learning to use Plots.jl these days, to visualise output from FEM analysis. One thing I would like to be able to do is provide 3 “nodes” (in 2D, in my case, but 3D is an obvious extension) and 3 values or colo…

---

## [DataFramesMeta.jl insert @where subset programmatically?](https://discourse.julialang.org/t/dataframesmeta-jl-insert-where-subset-programmatically/6407)

<div class="topic-metadata">

**Author:** [@floswald](https://discourse.julialang.org/u/floswald)\
**Replies:** 5\
**Last updated:** [October 12, 2017, 3:36pm UTC](https://discourse.julialang.org/t/dataframesmeta-jl-insert-where-subset-programmatically/6407 "2017-10-12T15:36:54Z")

</div>

using DataFrames, DataFramesMeta # this works y = DataFrame(a=\[1,2,3\],b=rand(3),c=rand(3)) @where(y,:a.\>2) # how to achieve that? s = :(:a.\<2) # this criterion will change @where(y,s) # i tried julia\> macro wwhere(y,s…

---

## [Algebraic constraints for type parameters](https://discourse.julialang.org/t/algebraic-constraints-for-type-parameters/6409)

<div class="topic-metadata">

**Author:** [@Gregstrq](https://discourse.julialang.org/u/Gregstrq)\
**Replies:** 1\
**Last updated:** [October 12, 2017, 12:57pm UTC](https://discourse.julialang.org/t/algebraic-constraints-for-type-parameters/6409 "2017-10-12T12:57:47Z")

</div>

Hello. Let’s say I want to create a type which stores two tuples: one of them is exactly as twice as large as the other one: struct MyType{D} t1::NTuple{D, Int64} t2::NTuple{2\*D,Int64} end This code obviously …

---

## [Outdated list of registered packages](https://discourse.julialang.org/t/outdated-list-of-registered-packages/6369)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 2\
**Last updated:** [October 12, 2017, 3:03am UTC](https://discourse.julialang.org/t/outdated-list-of-registered-packages/6369 "2017-10-12T03:03:20Z")

</div>

Hey, I am not sure I am posting in the right section … sorry if it isn’t the case. It seems, as discussed at Creating a JuliaTeX group on github - #16 by kristoffer.carlsson, that the list of registered packages on the…

---

## [Applying Dict to DataFrame column](https://discourse.julialang.org/t/applying-dict-to-dataframe-column/6397)

<div class="topic-metadata">

**Author:** [@John\_Gibson](https://discourse.julialang.org/u/John_Gibson)\
**Replies:** 2\
**Last updated:** [October 12, 2017, 2:34am UTC](https://discourse.julialang.org/t/applying-dict-to-dataframe-column/6397 "2017-10-12T02:34:05Z")

</div>

I figured out a way to use Dict to do some text processing on Strings within a DataFrame, but I suspect there’s a better way to do it. shell\> cat benchmarks.csv c,iteration\_mandelbrot,0.263798 c,recursion\_fibonacci,0.02…

---

## [DateTime bug - Julia 0.6RC3](https://discourse.julialang.org/t/datetime-bug-julia-0-6rc3/4278)

<div class="topic-metadata">

**Author:** [@js135005](https://discourse.julialang.org/u/js135005)\
**Replies:** 6\
**Last updated:** [October 11, 2017, 6:39pm UTC](https://discourse.julialang.org/t/datetime-bug-julia-0-6rc3/4278 "2017-10-11T18:39:45Z")

</div>

There appears to be a bug(s) in the implementation of DateTime functions in Julia 0.6RC3 as shown below: \_ \_ \_ ()\_ | A fresh approach to technical computing () | () () | Documentation: ht…

---

## [String interpolation not working in julia pipe to julia !?!](https://discourse.julialang.org/t/string-interpolation-not-working-in-julia-pipe-to-julia/6385)

<div class="topic-metadata">

**Author:** [@TravisA9](https://discourse.julialang.org/u/TravisA9)\
**Replies:** 3\
**Last updated:** [October 11, 2017, 4:16pm UTC](https://discourse.julialang.org/t/string-interpolation-not-working-in-julia-pipe-to-julia/6385 "2017-10-11T16:16:52Z")

</div>

I was playing around a bit here on an idea based on an unanswered question I found on stackoverflow. Namely this one: Julia - pipe to Julia REPL - Stack Overflow The following is related and has a more direct answer: …

---

## [File for mmap with an unknown number of structs](https://discourse.julialang.org/t/file-for-mmap-with-an-unknown-number-of-structs/6380)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 7\
**Last updated:** [October 11, 2017, 3:45pm UTC](https://discourse.julialang.org/t/file-for-mmap-with-an-unknown-number-of-structs/6380 "2017-10-11T15:45:11Z")

</div>

Consider a struct (for MWE) struct Foo{T1, T2} id::T1 typ::T2 start::Date stop::Date end My algorithm works in two stages: I am generating a large number of these with fixed T1 and T2, want to write t…

---

## [Cnc controller](https://discourse.julialang.org/t/cnc-controller/6390)

<div class="topic-metadata">

**Author:** [@yakir12](https://discourse.julialang.org/u/yakir12)\
**Replies:** 0\
**Last updated:** [October 11, 2017, 2:52pm UTC](https://discourse.julialang.org/t/cnc-controller/6390 "2017-10-11T14:52:52Z")

</div>

Has anyone tried g-code from Julia?

---

## [Extendable multi-dimensional arrays](https://discourse.julialang.org/t/extendable-multi-dimensional-arrays/6084)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 23\
**Last updated:** [October 11, 2017, 11:30am UTC](https://discourse.julialang.org/t/extendable-multi-dimensional-arrays/6084 "2017-10-11T11:30:32Z")

</div>

I’m looking for a solution to extend a multi-dimensional array along the last dimension (e.g. to store incoming chunks of multi-dimensional data, when the final size is unknown). I didn’t find anything, but here’s my pro…

---

## [Travis Homebrew Failure](https://discourse.julialang.org/t/travis-homebrew-failure/6361)

<div class="topic-metadata">

**Author:** [@cortner](https://discourse.julialang.org/u/cortner)\
**Replies:** 6\
**Last updated:** [October 11, 2017, 12:15am UTC](https://discourse.julialang.org/t/travis-homebrew-failure/6361 "2017-10-11T00:15:00Z")

</div>

Recently I get the following error on travis: /usr/local/Homebrew/Library/Homebrew/brew.rb:12:in \`\<main\>': Homebrew must be run under Ruby 2.3! (RuntimeError) The command "if \[ $TRAVIS\_OS\_NAME = osx \]; then brew install…

---

## [Doctest error](https://discourse.julialang.org/t/doctest-error/6366)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 8\
**Last updated:** [October 10, 2017, 8:09pm UTC](https://discourse.julialang.org/t/doctest-error/6366 "2017-10-10T20:09:32Z")

</div>

Hi, I made my first steps with Documenter.jl and now wanted to set up some doctests but I’m failing on the first one and for a reason that makes no sense to me. The following test jldoctest julia\> cpt = makecpt(range="-…

---

## [BitShift operator on float](https://discourse.julialang.org/t/bitshift-operator-on-float/6364)

<div class="topic-metadata">

**Author:** [@nico202](https://discourse.julialang.org/u/nico202)\
**Replies:** 2\
**Last updated:** [October 10, 2017, 12:22am UTC](https://discourse.julialang.org/t/bitshift-operator-on-float/6364 "2017-10-10T00:22:29Z")

</div>

Hi, I wonder why isn’t \<\< (with \>\> and \>\>\>) defined for float (32 and 64). Is it because of flaoting point vs fixed? Thanks, Nicolò

---

## [Include documentation from another file?](https://discourse.julialang.org/t/include-documentation-from-another-file/6367)

<div class="topic-metadata">

**Author:** [@joa-quim](https://discourse.julialang.org/u/joa-quim)\
**Replies:** 2\
**Last updated:** [October 9, 2017, 11:36pm UTC](https://discourse.julialang.org/t/include-documentation-from-another-file/6367 "2017-10-09T23:36:13Z")

</div>

I need to document several functions that share a good deal of common options/arguments (example here). To avoid repeating the same definitions in each function, is there a way to put the common text in a ‘place’ and im…

---

## [Pkg.add(PKG,VER) Version Ignored - Workarounds?](https://discourse.julialang.org/t/pkg-add-pkg-ver-version-ignored-workarounds/6270)

<div class="topic-metadata">

**Author:** [@wibble](https://discourse.julialang.org/u/wibble)\
**Replies:** 4\
**Last updated:** [October 9, 2017, 10:37pm UTC](https://discourse.julialang.org/t/pkg-add-pkg-ver-version-ignored-workarounds/6270 "2017-10-09T22:37:02Z")

</div>

Recent versions of HDF5 and OffsetArrays seem to be incompatible with Julia 0.6.0 because of the change from Range to AbstractRange, but Pkg.add(PKG) just installs the latest. I believe I’ve found the latest compatible …

---

## [Using ForwardDiff to calculate gradients of fields in composite type?](https://discourse.julialang.org/t/using-forwarddiff-to-calculate-gradients-of-fields-in-composite-type/6365)

<div class="topic-metadata">

**Author:** [@mewilhel](https://discourse.julialang.org/u/mewilhel)\
**Replies:** 1\
**Last updated:** [October 9, 2017, 10:04pm UTC](https://discourse.julialang.org/t/using-forwarddiff-to-calculate-gradients-of-fields-in-composite-type/6365 "2017-10-09T22:04:27Z")

</div>

Hello everybody, A little background: I’m working on a package that implements creates differentiable McCormick relaxations of functions. These relaxations are generally tighter than interval bounds and since they are …

---

## [Best way to loop over arrays sequentially?](https://discourse.julialang.org/t/best-way-to-loop-over-arrays-sequentially/6363)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 2\
**Last updated:** [October 9, 2017, 9:22pm UTC](https://discourse.julialang.org/t/best-way-to-loop-over-arrays-sequentially/6363 "2017-10-09T21:22:25Z")

</div>

For example, if you had: x\_vars = \["T\_k", "Q", "kappa", "delta", "epsilon", "wave\_theta"\] y\_vars = \["R\_0", "B\_0", "P\_F", "eta\_CD", "rho\_j", "f\_B", "n\_bar", "I\_M"\] for cur\_var in vcat(x\_vars, y\_vars) println(cur\_va…

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

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