# Latest

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

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

**Page:** 1932

---

## [Syntax error when using @ode\_def inside a function](https://discourse.julialang.org/t/syntax-error-when-using-ode-def-inside-a-function/28171)

<div class="topic-metadata">

**Author:** [@Geometh](https://discourse.julialang.org/u/Geometh)\
**Replies:** 1\
**Last updated:** [August 29, 2019, 4:07pm UTC](https://discourse.julialang.org/t/syntax-error-when-using-ode-def-inside-a-function/28171 "2019-08-29T16:07:03Z")

</div>

Hi there, I wanted to use the @ode\_def macro from the ParametrizedFunctions package inside some custom function. However, I get a syntax error saying: syntax: "struct" expression not at top level. Here is a minimum wo…

---

## [\[Santa Clara CA\] Building a High-Performance Earth System Model in Julia](https://discourse.julialang.org/t/santa-clara-ca-building-a-high-performance-earth-system-model-in-julia/28170)

<div class="topic-metadata">

**Author:** [@chrisvwx](https://discourse.julialang.org/u/chrisvwx)\
**Replies:** 0\
**Last updated:** [August 29, 2019, 3:45pm UTC](https://discourse.julialang.org/t/santa-clara-ca-building-a-high-performance-earth-system-model-in-julia/28170 "2019-08-29T15:45:30Z")

</div>

Maciej Waruszewski will speak to the (San Francisco) Bay Area Julia Users Group on “Building a High-Performance Earth System Model in Julia” on Mon Sept 16 at 6:30pm. His abstract is below To reduce and quantify unce…

---

## [Makie - drawing lines through transparent surface](https://discourse.julialang.org/t/makie-drawing-lines-through-transparent-surface/28148)

<div class="topic-metadata">

**Author:** [@nhardy](https://discourse.julialang.org/u/nhardy)\
**Replies:** 4\
**Last updated:** [August 29, 2019, 3:10pm UTC](https://discourse.julialang.org/t/makie-drawing-lines-through-transparent-surface/28148 "2019-08-29T15:10:28Z")

</div>

Hi, I’ve been using Julia and the Plots package for a while, but only recently have tried using Makie for some visualizations, and ran into some problems. No matter what I try, I can’t get line segments to play nicely wi…

---

## [Make an existing type a child of an abstract type](https://discourse.julialang.org/t/make-an-existing-type-a-child-of-an-abstract-type/28162)

<div class="topic-metadata">

**Author:** [@zsoerenm](https://discourse.julialang.org/u/zsoerenm)\
**Replies:** 3\
**Last updated:** [August 29, 2019, 2:26pm UTC](https://discourse.julialang.org/t/make-an-existing-type-a-child-of-an-abstract-type/28162 "2019-08-29T14:26:25Z")

</div>

Is it possible to make an existing type a child of an abstract type? Something like this? using StaticArrays abstract type Abstract3DVector end struct type SVector{3} \<: Abstract3DVector end Unfortunately it does not …

---

## [How to quickly bulk insert into postgres 1](https://discourse.julialang.org/t/how-to-quickly-bulk-insert-into-postgres-1/27784)

<div class="topic-metadata">

**Author:** [@datnt2509](https://discourse.julialang.org/u/datnt2509)\
**Replies:** 3\
**Last updated:** [August 29, 2019, 2:12pm UTC](https://discourse.julialang.org/t/how-to-quickly-bulk-insert-into-postgres-1/27784 "2019-08-29T14:12:54Z")

</div>

This is sort of a shot in the dark, I don’t have any reason to believe there’s a better solution to this but I thought I’d give it a try. I’m trying to insert data into tables on a postgres database. I’m using the excel…

---

## [Plots (PyPlot) xscale=log throwing error](https://discourse.julialang.org/t/plots-pyplot-xscale-log-throwing-error/28093)

<div class="topic-metadata">

**Author:** [@Rouzaire](https://discourse.julialang.org/u/Rouzaire)\
**Replies:** 7\
**Last updated:** [August 29, 2019, 1:07pm UTC](https://discourse.julialang.org/t/plots-pyplot-xscale-log-throwing-error/28093 "2019-08-29T13:07:33Z")

</div>

Hello, Here is my code : x = abs.(randn(100000)) plotly() Plots.histogram(x, yaxis = (:log10, (1,Inf))) # line A Plots.histogram(log.(x)) # line B Plots.histogram(x, xaxis = (:log10, (1,Inf))) # line C Lines A and B…

---

## [Replace(kv-\>first(kv)\<3 ? 3=\>last(kv) : kv, Dict(1=\>2, 3=\>4)) does not work as I expect](https://discourse.julialang.org/t/replace-kv-first-kv-3-3-last-kv-kv-dict-1-2-3-4-does-not-work-as-i-expect/28161)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 3\
**Last updated:** [August 29, 2019, 11:50am UTC](https://discourse.julialang.org/t/replace-kv-first-kv-3-3-last-kv-kv-dict-1-2-3-4-does-not-work-as-i-expect/28161 "2019-08-29T11:50:41Z")

</div>

replace(kv-\>first(kv)\<3 ? 3=\>last(kv) : kv, Dict(1=\>2, 3=\>4)) (with Julia 1.2) I believe intuitively correct return value of the above expression must be : 3=\>2 3=\>4 But I get only 3=\>2. It really beats me.

---

## [REPL unresponsive after 'using' package](https://discourse.julialang.org/t/repl-unresponsive-after-using-package/28160)

<div class="topic-metadata">

**Author:** [@daniel](https://discourse.julialang.org/u/daniel)\
**Replies:** 1\
**Last updated:** [August 29, 2019, 11:42am UTC](https://discourse.julialang.org/t/repl-unresponsive-after-using-package/28160 "2019-08-29T11:42:03Z")

</div>

I’ve got an interesting problem with one of my dev’ed packages after upgrading to julia 1.2 (compiled from source). In the REPL, after using MyPackage I now always get a Recompile stale cache file, and after the second…

---

## [ForwardDiff & mul!()](https://discourse.julialang.org/t/forwarddiff-mul/28144)

<div class="topic-metadata">

**Author:** [@PharmCat](https://discourse.julialang.org/u/PharmCat)\
**Replies:** 6\
**Last updated:** [August 29, 2019, 10:38am UTC](https://discourse.julialang.org/t/forwarddiff-mul/28144 "2019-08-29T10:38:10Z")

</div>

Is it possible to make ForwardDiff works with mul!() inside function? Or how to optimize allocations when I try to get gradient/hessian of likelihood function?

---

## [REQUIRE file still needed?](https://discourse.julialang.org/t/require-file-still-needed/28157)

<div class="topic-metadata">

**Author:** [@janlisse](https://discourse.julialang.org/u/janlisse)\
**Replies:** 3\
**Last updated:** [August 29, 2019, 10:26am UTC](https://discourse.julialang.org/t/require-file-still-needed/28157 "2019-08-29T10:26:30Z")

</div>

Hi, since https://github.com/JuliaLang/Pkg.jl/issues/849 is closed now, is a REQUIRE file still needed when i want to publish my package to the Julia registry? If it is obsolete by now can I safely remove it for an alre…

---

## [AutomaticDocstrings does not generate output](https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 3\
**Last updated:** [August 29, 2019, 9:49am UTC](https://discourse.julialang.org/t/automaticdocstrings-does-not-generate-output/28158 "2019-08-29T09:49:07Z")

</div>

Hello, I’m trying to use the AutomaticDocstring package, but I cannot make it work. When I evaluate to following the example from the docs in Juno: using AutomaticDocstrings @autodoc function f(x::A, b=5; c=LinRange(…

---

## [How to "print" a dataframe representation in a string?](https://discourse.julialang.org/t/how-to-print-a-dataframe-representation-in-a-string/28155)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 3\
**Last updated:** [August 29, 2019, 9:22am UTC](https://discourse.julialang.org/t/how-to-print-a-dataframe-representation-in-a-string/28155 "2019-08-29T09:22:05Z")

</div>

How do I “print” a representation of a dataframe in within a String, e.g. this would not work: df = DataFrame(c1=\["a","b"\],c2=\[1,2\]) myStr = """ My dataframe: $(show(df,allrows=true, allcols=true)) bla,bla,bla... """

---

## [Is there a way to teach Zygote to derive Diagonal \* Vector more efficiently?](https://discourse.julialang.org/t/is-there-a-way-to-teach-zygote-to-derive-diagonal-vector-more-efficiently/28145)

<div class="topic-metadata">

**Author:** [@marius311](https://discourse.julialang.org/u/marius311)\
**Replies:** 4\
**Last updated:** [August 29, 2019, 6:07am UTC](https://discourse.julialang.org/t/is-there-a-way-to-teach-zygote-to-derive-diagonal-vector-more-efficiently/28145 "2019-08-29T06:07:35Z")

</div>

I’m still getting my head around reverse-mode diff, but is there a way to teach Zygote to do the derivative of Diagonal \* Vector without allocating N^2 memory? using LinearAlgebra, BenchmarkTools, Zygote v = rand(4096)…

---

## [Very strange, can not create a data frame with the following simple example](https://discourse.julialang.org/t/very-strange-can-not-create-a-data-frame-with-the-following-simple-example/28147)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [August 29, 2019, 5:45am UTC](https://discourse.julialang.org/t/very-strange-can-not-create-a-data-frame-with-the-following-simple-example/28147 "2019-08-29T05:45:43Z")

</div>

I have the following simple code to create a data frame. function writeAmbsFile(fin::String, ambs::Vector{Amb}) df = DataFrame( (index = a.index, stationIndex = a.stationIndex, intClass = a.intClass, class=…

---

## [Convert AbstractVector to Vector](https://discourse.julialang.org/t/convert-abstractvector-to-vector/28098)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 6\
**Last updated:** [August 29, 2019, 5:43am UTC](https://discourse.julialang.org/t/convert-abstractvector-to-vector/28098 "2019-08-29T05:43:02Z")

</div>

What is a generic, idiomatic and performant method to convert an AbstractVector (which may have non-standard indexing) to a Vector? I want to treat the AbstractVector as list of items to be “loaded” into a regular Vect…

---

## [Sample size calculation + experimental design](https://discourse.julialang.org/t/sample-size-calculation-experimental-design/27433)

<div class="topic-metadata">

**Author:** [@Crghilardi](https://discourse.julialang.org/u/Crghilardi)\
**Replies:** 1\
**Last updated:** [August 28, 2019, 11:35pm UTC](https://discourse.julialang.org/t/sample-size-calculation-experimental-design/27433 "2019-08-28T23:35:32Z")

</div>

I started to write a small function that I use somewhat regularly to calculate sample size from coefficient of variation. I checked JuliaStats/StatsBase to see if any sample size functionality was included and I did not …

---

## [Failed to load the julia-client package. can not find module 'etch'](https://discourse.julialang.org/t/failed-to-load-the-julia-client-package-can-not-find-module-etch/28141)

<div class="topic-metadata">

**Author:** [@Nathanbyarugaba](https://discourse.julialang.org/u/Nathanbyarugaba)\
**Replies:** 0\
**Last updated:** [August 28, 2019, 10:28pm UTC](https://discourse.julialang.org/t/failed-to-load-the-julia-client-package-can-not-find-module-etch/28141 "2019-08-28T22:28:06Z")

</div>

Hello, I recently installed Julia and atom. on opening atom it shows; "Failed to load the julia-client package. can not find module ‘etch’ ". I clicked install uber juno. But I was unsuccessful in starting julia in ato…

---

## [Providing hints to broadcast?](https://discourse.julialang.org/t/providing-hints-to-broadcast/28137)

<div class="topic-metadata">

**Author:** [@wsphillips](https://discourse.julialang.org/u/wsphillips)\
**Replies:** 8\
**Last updated:** [August 28, 2019, 10:02pm UTC](https://discourse.julialang.org/t/providing-hints-to-broadcast/28137 "2019-08-28T22:02:05Z")

</div>

I often run into this situation and have yet to find a solution other than writing a for-loop. Is there a way to vectorize the MWE below using features in Base? Suppose I have a function accepting a 2d array and two in…

---

## [UTF8 support in Juno console workaround?](https://discourse.julialang.org/t/utf8-support-in-juno-console-workaround/28063)

<div class="topic-metadata">

**Author:** [@braamvandyk](https://discourse.julialang.org/u/braamvandyk)\
**Replies:** 4\
**Last updated:** [August 28, 2019, 8:51pm UTC](https://discourse.julialang.org/t/utf8-support-in-juno-console-workaround/28063 "2019-08-28T20:51:49Z")

</div>

In a previous post, @PetrKryslUCSD showed that starting Atom from inside the Git bash allows the shell commands, like ls the functions as expected in the console. That is extremely helpful. UTF8 support however is stil…

---

## [Reading .csv.gz with CSV does not find readavailable(::GZipStream)](https://discourse.julialang.org/t/reading-csv-gz-with-csv-does-not-find-readavailable-gzipstream/27966)

<div class="topic-metadata">

**Author:** [@hmmueller](https://discourse.julialang.org/u/hmmueller)\
**Replies:** 4\
**Last updated:** [August 28, 2019, 5:49pm UTC](https://discourse.julialang.org/t/reading-csv-gz-with-csv-does-not-find-readavailable-gzipstream/27966 "2019-08-28T17:49:38Z")

</div>

I had an original piece of code like this, which worked nicely: filepaths = \[joinpath(root, f) for (root, dirs, files) in walkdir(root) for f in files\[occursin.(fnfeature,…

---

## [Passing a function as an argument via closure](https://discourse.julialang.org/t/passing-a-function-as-an-argument-via-closure/28017)

<div class="topic-metadata">

**Author:** [@cpross90](https://discourse.julialang.org/u/cpross90)\
**Replies:** 9\
**Last updated:** [August 28, 2019, 5:09pm UTC](https://discourse.julialang.org/t/passing-a-function-as-an-argument-via-closure/28017 "2019-08-28T17:09:57Z")

</div>

I am creating some numerical methods, and I am running into some issues with closures. Here’s an example of what I’m doing: Function to drive myPkg: function main() #allocate temporaries function linear() …

---

## [Pkg.status and DataFrame operations fail in Juno Debugger](https://discourse.julialang.org/t/pkg-status-and-dataframe-operations-fail-in-juno-debugger/28070)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 2\
**Last updated:** [August 28, 2019, 5:00pm UTC](https://discourse.julialang.org/t/pkg-status-and-dataframe-operations-fail-in-juno-debugger/28070 "2019-08-28T17:00:32Z")

</div>

I cannot execute either of the following functions successfully with the Juno debugger. They run fine outside of the debugger, however. Function 1 function df\_debug1() df = DataFrame(A=1:3, B=4:6) df1 = hcat(df…

---

## [Accumulating distributed data](https://discourse.julialang.org/t/accumulating-distributed-data/28117)

<div class="topic-metadata">

**Author:** [@grahamas](https://discourse.julialang.org/u/grahamas)\
**Replies:** 0\
**Last updated:** [August 28, 2019, 3:56pm UTC](https://discourse.julialang.org/t/accumulating-distributed-data/28117 "2019-08-28T15:56:52Z")

</div>

I’m running distributed simulations and hoping to save the results as I go – the aggregate results are too big to hold in memory. Can someone point me to a good way to do this that doesn’t amount to saving each run in a…

---

## [Type VariableRef has no field head](https://discourse.julialang.org/t/type-variableref-has-no-field-head/28116)

<div class="topic-metadata">

**Author:** [@faoh](https://discourse.julialang.org/u/faoh)\
**Replies:** 0\
**Last updated:** [August 28, 2019, 3:50pm UTC](https://discourse.julialang.org/t/type-variableref-has-no-field-head/28116 "2019-08-28T15:50:18Z")

</div>

Hi All, I try to formulate an objective function, like x\*log(x), x is a nonlinear expression. However, when I run the optimization, it shows type VariableRef has no field head. Anyone else saw this message? JuMP.@NLex…

---

## [Package for resampling of an unevenly spaced time series to an evenly spaced time series](https://discourse.julialang.org/t/package-for-resampling-of-an-unevenly-spaced-time-series-to-an-evenly-spaced-time-series/28110)

<div class="topic-metadata">

**Author:** [@Volker](https://discourse.julialang.org/u/Volker)\
**Replies:** 3\
**Last updated:** [August 28, 2019, 3:00pm UTC](https://discourse.julialang.org/t/package-for-resampling-of-an-unevenly-spaced-time-series-to-an-evenly-spaced-time-series/28110 "2019-08-28T15:00:18Z")

</div>

Does somebody know a package, which can convert an unevenly spaced time series to an evenly spaced time series ? Example: from time = \[0.0, 0.03, 0.08, 1.1, 1.4, 1.7, 2.0\] u = \[1.0, 1.2, 2.5, 7.8, 10.0, 12.0, 12.5\] t…

---

## [\[Flux\] Issue while computing Hessian MethodError: objects of type Tracker.Grads are not callable](https://discourse.julialang.org/t/flux-issue-while-computing-hessian-methoderror-objects-of-type-tracker-grads-are-not-callable/27980)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 12\
**Last updated:** [August 28, 2019, 2:52pm UTC](https://discourse.julialang.org/t/flux-issue-while-computing-hessian-methoderror-objects-of-type-tracker-grads-are-not-callable/27980 "2019-08-28T14:52:23Z")

</div>

I’m new to Flux and I’m trying to compute the hessian. Here’s the code: grad = Flux.gradient(() -\> loss(x, y), Flux.params(model)) hess = Flux.gradient(grad, Flux.params(model)) But when running the line to compute he…

---

## [(Compiler) Performance of Dict](https://discourse.julialang.org/t/compiler-performance-of-dict/27986)

<div class="topic-metadata">

**Author:** [@tobias.knopp](https://discourse.julialang.org/u/tobias.knopp)\
**Replies:** 23\
**Last updated:** [August 28, 2019, 2:19pm UTC](https://discourse.julialang.org/t/compiler-performance-of-dict/27986 "2019-08-28T14:19:16Z")

</div>

In Roadmap for a faster time-to-first-plot?, it was suggested by @ChrisRackauckas to circumvent the usage of Dicts since they slow down compile time performance. I would love to get suggestions how to actually do this. I…

---

## [Extract row if column contains text in Julia dataframe](https://discourse.julialang.org/t/extract-row-if-column-contains-text-in-julia-dataframe/28103)

<div class="topic-metadata">

**Author:** [@Luigi\_Marongiu](https://discourse.julialang.org/u/Luigi_Marongiu)\
**Replies:** 1\
**Last updated:** [August 28, 2019, 1:53pm UTC](https://discourse.julialang.org/t/extract-row-if-column-contains-text-in-julia-dataframe/28103 "2019-08-28T13:53:56Z")

</div>

Hello, is it possible to extract a row of the dataframe whose column contain a value? for instance, if I have this dataframe: col1 col2 col3 a abba gold b queen gratesthits c bowie the best of how can …

---

## [Want to change DEPOT\_PATH](https://discourse.julialang.org/t/want-to-change-depot-path/28105)

<div class="topic-metadata">

**Author:** [@imrankhan\_juliaLang](https://discourse.julialang.org/u/imrankhan_juliaLang)\
**Replies:** 2\
**Last updated:** [August 28, 2019, 1:48pm UTC](https://discourse.julialang.org/t/want-to-change-depot-path/28105 "2019-08-28T13:48:35Z")

</div>

Help i need to change and update DEPOT\_PATH. when i change DEPOT\_PATH by using DEPOT\_PATH\[1\] = “” after re open it reset

---

## [Julia 1.2 on CoCalc](https://discourse.julialang.org/t/julia-1-2-on-cocalc/28107)

<div class="topic-metadata">

**Author:** [@ha\_sch](https://discourse.julialang.org/u/ha_sch)\
**Replies:** 0\
**Last updated:** [August 28, 2019, 1:25pm UTC](https://discourse.julialang.org/t/julia-1-2-on-cocalc/28107 "2019-08-28T13:25:47Z")

</div>

Hello! Julia 1.2 is available on CoCalc. Recently updated list of installed packages: Julia packages

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

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