# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1627

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

**Page:** 1628

---

## [Flux: concatenate layers](https://discourse.julialang.org/t/flux-concatenate-layers/18877)

<div class="topic-metadata">

**Author:** [@zot](https://discourse.julialang.org/u/zot)\
**Replies:** 7\
**Last updated:** [September 18, 2020, 11:13am UTC](https://discourse.julialang.org/t/flux-concatenate-layers/18877 "2020-09-18T11:13:45Z")

</div>

I’m looking for a way to concatenate layers in Flux like this: Would this work for that? The input is an array of inputs to the layers and the output is the concatenation of the layers’ outputs. Creating it would be …

---

## [Problems with Lathe TrainTestSplit](https://discourse.julialang.org/t/problems-with-lathe-traintestsplit/46700)

<div class="topic-metadata">

**Author:** [@Jasper\_Hall](https://discourse.julialang.org/u/Jasper_Hall)\
**Replies:** 11\
**Last updated:** [September 18, 2020, 11:13am UTC](https://discourse.julialang.org/t/problems-with-lathe-traintestsplit/46700 "2020-09-18T11:13:07Z")

</div>

I am attempting to use Lathe for Linear Regression but unfortunately the documentation is unreachable (webpage lathe.ai/docs/ returns an error). All the tutorials that I have seen about it (e.g. here) plus the documenta…

---

## [Flux.params does not recognize parameters with \`x -\> layer(x)\` syntax](https://discourse.julialang.org/t/flux-params-does-not-recognize-parameters-with-x-layer-x-syntax/46832)

<div class="topic-metadata">

**Author:** [@tgrassi](https://discourse.julialang.org/u/tgrassi)\
**Replies:** 4\
**Last updated:** [September 18, 2020, 11:10am UTC](https://discourse.julialang.org/t/flux-params-does-not-recognize-parameters-with-x-layer-x-syntax/46832 "2020-09-18T11:10:26Z")

</div>

Hi all, I have a basic question about params in Flux that confuses me. Why do I get different parameters in these two cases? Shouldn’t be equivalent? using Flux m1 = x -\> Dense(4, 2)(x) println(params(m1)) m2 = Dens…

---

## [How to track dynamic dispatch](https://discourse.julialang.org/t/how-to-track-dynamic-dispatch/46826)

<div class="topic-metadata">

**Author:** [@tisztamo](https://discourse.julialang.org/u/tisztamo)\
**Replies:** 4\
**Last updated:** [September 18, 2020, 9:07am UTC](https://discourse.julialang.org/t/how-to-track-dynamic-dispatch/46826 "2020-09-18T09:07:29Z")

</div>

Similar to --track-allocation, I would like to see where in my code dynamic dispatch happened during a specific run. Is there a tool for that?

---

## [Using \`include\` to bring variables into scope not working](https://discourse.julialang.org/t/using-include-to-bring-variables-into-scope-not-working/46636)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 10\
**Last updated:** [September 18, 2020, 8:48am UTC](https://discourse.julialang.org/t/using-include-to-bring-variables-into-scope-not-working/46636 "2020-09-18T08:48:21Z")

</div>

My workflow is to usually have a init.jl file which brings some variables into scope, e.g. saveDir = "/path". Then all my scripts start with include("init.jl"). However, I noticed that this wasn’t always working, so I en…

---

## [Convert REQUIRE to Project.toml and Manifest.toml](https://discourse.julialang.org/t/convert-require-to-project-toml-and-manifest-toml/17775)

<div class="topic-metadata">

**Author:** [@armstrtw](https://discourse.julialang.org/u/armstrtw)\
**Replies:** 16\
**Last updated:** [September 18, 2020, 8:29am UTC](https://discourse.julialang.org/t/convert-require-to-project-toml-and-manifest-toml/17775 "2020-09-18T08:29:06Z")

</div>

Is there a standard process or function that allows one to upgrade old packages using the REQUIRE file to the new package format using Project.toml and Manifest.toml ? Apologies if I missed this documentation online.

---

## [How to wait on multiple file descriptors/streams](https://discourse.julialang.org/t/how-to-wait-on-multiple-file-descriptors-streams/46827)

<div class="topic-metadata">

**Author:** [@HanD](https://discourse.julialang.org/u/HanD)\
**Replies:** 0\
**Last updated:** [September 18, 2020, 7:42am UTC](https://discourse.julialang.org/t/how-to-wait-on-multiple-file-descriptors-streams/46827 "2020-09-18T07:42:41Z")

</div>

Hello all, I’m trying to read from multiple sockets/file descriptors, and would like to wait for either of them to have available bytes, then read them, and go back to waiting. In a regular posix system, I would use sel…

---

## [Waiting on a file: poll\_fd and RawFD](https://discourse.julialang.org/t/waiting-on-a-file-poll-fd-and-rawfd/1876)

<div class="topic-metadata">

**Author:** [@ggggggggg](https://discourse.julialang.org/u/ggggggggg)\
**Replies:** 5\
**Last updated:** [September 18, 2020, 7:35am UTC](https://discourse.julialang.org/t/waiting-on-a-file-poll-fd-and-rawfd/1876 "2020-09-18T07:35:08Z")

</div>

Hello, I’ve found a few different ways to wait on a file until data is available to read. Of the methods I’ve found, poll\_fd seems to match my use case well, but I worry that it requires the use of RawFD, which only app…

---

## [Generic array scan line](https://discourse.julialang.org/t/generic-array-scan-line/46816)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 9\
**Last updated:** [September 18, 2020, 7:12am UTC](https://discourse.julialang.org/t/generic-array-scan-line/46816 "2020-09-18T07:12:57Z")

</div>

I have: const w, h = 640, 480 a = rand(Float32, w, h) and an algorithm, which requires scanning array a by row or column in all possible directions like shown here: function scan4(a) scanLine = zeros(max(w, h)) f…

---

## [Not able to capture variable (via symbol) from outer scope?](https://discourse.julialang.org/t/not-able-to-capture-variable-via-symbol-from-outer-scope/46797)

<div class="topic-metadata">

**Author:** [@conditionality](https://discourse.julialang.org/u/conditionality)\
**Replies:** 10\
**Last updated:** [September 18, 2020, 7:01am UTC](https://discourse.julialang.org/t/not-able-to-capture-variable-via-symbol-from-outer-scope/46797 "2020-09-18T07:01:04Z")

</div>

I have the following minimal example: function foo() myvar1 = 55 function bar() println(myvar1) #\<- OK s = Symbol("myvar", 1) println(@eval $s) # \<-ERROR: LoadError: UndefVarError: myvar1…

---

## [How to mmap a string](https://discourse.julialang.org/t/how-to-mmap-a-string/39291)

<div class="topic-metadata">

**Author:** [@lesshaste](https://discourse.julialang.org/u/lesshaste)\
**Replies:** 18\
**Last updated:** [September 18, 2020, 6:18am UTC](https://discourse.julialang.org/t/how-to-mmap-a-string/39291 "2020-09-18T06:18:40Z")

</div>

I have a really large text file with one line in it. For slightly smaller files I just read it in with: line = readline(filename) I then process line from left to right. As a toy example: for i in 1:10 …

---

## [What is the type 'Method' and where is it defined?](https://discourse.julialang.org/t/what-is-the-type-method-and-where-is-it-defined/46755)

<div class="topic-metadata">

**Author:** [@HenrikM](https://discourse.julialang.org/u/HenrikM)\
**Replies:** 2\
**Last updated:** [September 18, 2020, 5:28am UTC](https://discourse.julialang.org/t/what-is-the-type-method-and-where-is-it-defined/46755 "2020-09-18T05:28:10Z")

</div>

The @which macro returns a mutable composite type Method. Is this documented anywhere and how do I find the source code for it? I guess it is part of the Julia internals since the usual ways of discovery fail. m = @whic…

---

## [Array of tuples into a pure array of integers](https://discourse.julialang.org/t/array-of-tuples-into-a-pure-array-of-integers/46811)

<div class="topic-metadata">

**Author:** [@Dale\_James\_Black](https://discourse.julialang.org/u/Dale_James_Black)\
**Replies:** 3\
**Last updated:** [September 18, 2020, 5:02am UTC](https://discourse.julialang.org/t/array-of-tuples-into-a-pure-array-of-integers/46811 "2020-09-18T05:02:49Z")

</div>

New to Julia from Python so I am not used to all of these types, sorry if this is super simple but I have had no luck in my google searches. Can someone help me turn an array of tuples into a pure array of integers. Fo…

---

## [Reading DOT graph](https://discourse.julialang.org/t/reading-dot-graph/46683)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 1\
**Last updated:** [September 18, 2020, 1:19am UTC](https://discourse.julialang.org/t/reading-dot-graph/46683 "2020-09-18T01:19:41Z")

</div>

I have: julia\> using LightGraphs, GraphIO julia\> graph = loadgraph("gr.dot", "gr", DOTFormat()) ERROR: UndefVarError: DOT not defined Stacktrace: \[1\] DOTFormat() at /home/paul/.julia/packages/GraphIO/IgxnP/src/depreca…

---

## [Why the @objective value is negative?](https://discourse.julialang.org/t/why-the-objective-value-is-negative/46781)

<div class="topic-metadata">

**Author:** [@sogrbilja](https://discourse.julialang.org/u/sogrbilja)\
**Replies:** 2\
**Last updated:** [September 18, 2020, 1:18am UTC](https://discourse.julialang.org/t/why-the-objective-value-is-negative/46781 "2020-09-18T01:18:31Z")

</div>

I have this model (using cbc solver): @variable(premex, PRODAMOUNT\[op\_k in keys(\_ORDER\_PRODUCTs\_ALL), u\_k in keys(UNITS), t in TIME\], Int, lower\_bound = 0) @objective( premex, M…

---

## [SOCP modeling in Julia?](https://discourse.julialang.org/t/socp-modeling-in-julia/46808)

<div class="topic-metadata">

**Author:** [@Qinyang](https://discourse.julialang.org/u/Qinyang)\
**Replies:** 4\
**Last updated:** [September 18, 2020, 12:17am UTC](https://discourse.julialang.org/t/socp-modeling-in-julia/46808 "2020-09-18T00:17:36Z")

</div>

Hello friends, I am new to Julia and optimization. I have met a SOCP problem in my research. The model looks like the following the objective function is a quardratic one. PG(i), alpha(i) here are my variables. I main…

---

## [JuliaAstro travis ci migration](https://discourse.julialang.org/t/juliaastro-travis-ci-migration/46719)

<div class="topic-metadata">

**Author:** [@Bernard\_GODARD](https://discourse.julialang.org/u/Bernard_GODARD)\
**Replies:** 9\
**Last updated:** [September 18, 2020, 12:08am UTC](https://discourse.julialang.org/t/juliaastro-travis-ci-migration/46719 "2020-09-18T00:08:36Z")

</div>

Hi all I have received an email from travis ci saying that we need to migrate our projects from Travis-ci.org to Travis-ci.com. But it does not seem like I can migrate my project JuliaAstro/CALCEPH.jl Probably I don’t…

---

## [ANN: ArgMacros v0.2.0 - Flexible, easy, fast command line argument parsing in Julia](https://discourse.julialang.org/t/ann-argmacros-v0-2-0-flexible-easy-fast-command-line-argument-parsing-in-julia/46566)

<div class="topic-metadata">

**Author:** [@zachmatson](https://discourse.julialang.org/u/zachmatson)\
**Replies:** 14\
**Last updated:** [September 17, 2020, 11:06pm UTC](https://discourse.julialang.org/t/ann-argmacros-v0-2-0-flexible-easy-fast-command-line-argument-parsing-in-julia/46566 "2020-09-17T23:06:58Z")

</div>

ArgMacros is now on version 0.2.0. ArgMacros continues to be a performant module for parsing command line arguments, and the new version is about ~12% faster to load and run a test benchmark on my machine, compared to 0…

---

## [Plotly with multiple jupyter windows](https://discourse.julialang.org/t/plotly-with-multiple-jupyter-windows/46807)

<div class="topic-metadata">

**Author:** [@MatFi](https://discourse.julialang.org/u/MatFi)\
**Replies:** 0\
**Last updated:** [September 17, 2020, 10:42pm UTC](https://discourse.julialang.org/t/plotly-with-multiple-jupyter-windows/46807 "2020-09-17T22:42:25Z")

</div>

When I create a plot with the Plots package using the plotlyjs() backend in a jupyter-notebook this works wonderfully at first. But if I open a new browser window with the same notebook (and close the old one) I don’t g…

---

## [Binning a 2D array](https://discourse.julialang.org/t/binning-a-2d-array/46791)

<div class="topic-metadata">

**Author:** [@pnms](https://discourse.julialang.org/u/pnms)\
**Replies:** 8\
**Last updated:** [September 17, 2020, 10:10pm UTC](https://discourse.julialang.org/t/binning-a-2d-array/46791 "2020-09-17T22:10:25Z")

</div>

Hi, I am trying to apply my understanding of image binning in Julia (which at its heart is an operation that needs to be performed on a 2D array) . To that end I created a toy array julia\> a = rand(range(0,1,step=1),10…

---

## [Gridded Interplation with NoInterp fails when specifying nodes](https://discourse.julialang.org/t/gridded-interplation-with-nointerp-fails-when-specifying-nodes/46756)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 1\
**Last updated:** [September 17, 2020, 9:46pm UTC](https://discourse.julialang.org/t/gridded-interplation-with-nointerp-fails-when-specifying-nodes/46756 "2020-09-17T21:46:49Z")

</div>

I have a function f(z,k) where I am trying to interpolate along k. Both z and k may be non-uniform. I do not want any interpolation along z. I am using Interpolations.jl and trying out the following: julia\> interpolate(…

---

## [Different exponent results with Int64 and Float64](https://discourse.julialang.org/t/different-exponent-results-with-int64-and-float64/46804)

<div class="topic-metadata">

**Author:** [@cadojo](https://discourse.julialang.org/u/cadojo)\
**Replies:** 1\
**Last updated:** [September 17, 2020, 9:25pm UTC](https://discourse.julialang.org/t/different-exponent-results-with-int64-and-float64/46804 "2020-09-17T21:25:59Z")

</div>

During a calculation, I realized the following two examples produce different results. This doesn’t match my intuition, because the first example defaults to Int64, and the second example defaults to Float64. julia\> (1…

---

## [How to searchsortedfirst when each element requires expensive transformation](https://discourse.julialang.org/t/how-to-searchsortedfirst-when-each-element-requires-expensive-transformation/46720)

<div class="topic-metadata">

**Author:** [@MFairley](https://discourse.julialang.org/u/MFairley)\
**Replies:** 24\
**Last updated:** [September 17, 2020, 8:49pm UTC](https://discourse.julialang.org/t/how-to-searchsortedfirst-when-each-element-requires-expensive-transformation/46720 "2020-09-17T20:49:40Z")

</div>

I have a problem where I have an expensive function expensive() and I want to find the first integer i in 0:n such that expensive(i) \> a where a is some constant and we know that expensive(j) \> a for j \>= i. I want to m…

---

## [Bounded gradient descent on bounded interpolation searches \[NaN, NaN\]](https://discourse.julialang.org/t/bounded-gradient-descent-on-bounded-interpolation-searches-nan-nan/46346)

<div class="topic-metadata">

**Author:** [@grahamas](https://discourse.julialang.org/u/grahamas)\
**Replies:** 2\
**Last updated:** [September 17, 2020, 8:32pm UTC](https://discourse.julialang.org/t/bounded-gradient-descent-on-bounded-interpolation-searches-nan-nan/46346 "2020-09-17T20:32:34Z")

</div>

I’m confused how\[NaN, NaN\] could ever come up, and am at a loss as to how go about debugging. The same code works for several other example data. It seems like the issue is that there are so many zeros but I would think …

---

## [How to iterate the optimization model with the updated bounds of the variables?](https://discourse.julialang.org/t/how-to-iterate-the-optimization-model-with-the-updated-bounds-of-the-variables/46746)

<div class="topic-metadata">

**Author:** [@mamuniut09](https://discourse.julialang.org/u/mamuniut09)\
**Replies:** 1\
**Last updated:** [September 17, 2020, 7:57pm UTC](https://discourse.julialang.org/t/how-to-iterate-the-optimization-model-with-the-updated-bounds-of-the-variables/46746 "2020-09-17T19:57:24Z")

</div>

Hello all, The optimization code is given below. x\_min=1; x\_max=7; y\_min=2; y\_max=5; m= Model(with\_optimizer(Ipopt.Optimizer)) @variable(m, x\>=0) @variable(m, y\>=0) @variable(m, z) @variable(m, w) @constraint(m,…

---

## [When to use Tarrays](https://discourse.julialang.org/t/when-to-use-tarrays/46758)

<div class="topic-metadata">

**Author:** [@Elmo](https://discourse.julialang.org/u/Elmo)\
**Replies:** 3\
**Last updated:** [September 17, 2020, 7:10pm UTC](https://discourse.julialang.org/t/when-to-use-tarrays/46758 "2020-09-17T19:10:31Z")

</div>

Hi everyone, I’m new to Turing/probabilistic programming and would like to know when you should use TArrays vs. normal arrays in the model definition. The package guidelines mention that “stack allocated variables” are…

---

## [How can I specialize similar and copy on a offset custom array?](https://discourse.julialang.org/t/how-can-i-specialize-similar-and-copy-on-a-offset-custom-array/46796)

<div class="topic-metadata">

**Author:** [@suavesito](https://discourse.julialang.org/u/suavesito)\
**Replies:** 0\
**Last updated:** [September 17, 2020, 6:17pm UTC](https://discourse.julialang.org/t/how-can-i-specialize-similar-and-copy-on-a-offset-custom-array/46796 "2020-09-17T18:17:36Z")

</div>

Hi All! :smiley: I have a Spinor struct, that Inherits from AbstractVector, but it’s index go from 0 to 2^{\\lfloor dim/2\\rfloor}-1, with dim a part of the Spinor struct, for this I’m using CustomUnitRanges.jl. The Spino…

---

## [OrdinaryDiffEq.jl: DiscreteCallback at last step](https://discourse.julialang.org/t/ordinarydiffeq-jl-discretecallback-at-last-step/46795)

<div class="topic-metadata">

**Author:** [@ranocha](https://discourse.julialang.org/u/ranocha)\
**Replies:** 4\
**Last updated:** [September 17, 2020, 6:22pm UTC](https://discourse.julialang.org/t/ordinarydiffeq-jl-discretecallback-at-last-step/46795 "2020-09-17T18:22:11Z")

</div>

Is there an easy way to determine whether a DiscreteCallback is called after the last step of an integration, i.e. just before the integration terminates? I would like to call such a callback using my chosen condition(u,…

---

## [FYI: fast.ai's "fastcore \[adds\] to Python features inspired by other languages we’ve loved, like multiple dispatch from Julia"](https://discourse.julialang.org/t/fyi-fast-ais-fastcore-adds-to-python-features-inspired-by-other-languages-we-ve-loved-like-multiple-dispatch-from-julia/46794)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 1\
**Last updated:** [September 17, 2020, 5:49pm UTC](https://discourse.julialang.org/t/fyi-fast-ais-fastcore-adds-to-python-features-inspired-by-other-languages-we-ve-loved-like-multiple-dispatch-from-julia/46794 "2020-09-17T17:49:05Z")

</div>

On their homepage: Python is a powerful, dynamic language. Rather than bake everything into the language, it lets the programmer customize it to make it work for them. fastcore uses this flexibility to add to Python fe…

---

## [Are new courses teaching Julia just started?](https://discourse.julialang.org/t/are-new-courses-teaching-julia-just-started/28199)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 6\
**Last updated:** [September 17, 2020, 5:05pm UTC](https://discourse.julialang.org/t/are-new-courses-teaching-julia-just-started/28199 "2020-09-17T17:05:11Z")

</div>

Just noticed that in SO there seems to be many new SO users asking questions that sounds really like class exercises, and wondered if that is because of some new classes that just started and that focus on Julia… …just c…

[Previous page](https://discourse.julialang.org/latest.md?page=1626)

[Next page](https://discourse.julialang.org/latest.md?page=1628)
