# Latest

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

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

**Page:** 1703

---

## [Convert utf8 to binary](https://discourse.julialang.org/t/convert-utf8-to-binary/42315)

<div class="topic-metadata">

**Author:** [@pihive](https://discourse.julialang.org/u/pihive)\
**Replies:** 3\
**Last updated:** [June 30, 2020, 5:57pm UTC](https://discourse.julialang.org/t/convert-utf8-to-binary/42315 "2020-06-30T17:57:46Z")

</div>

Hi, I’m new to Julia and trying to solve the cryptopals challenge: Challenge 6 Set 1 - The Cryptopals Crypto Challenges This challenge requires to compute the hamming distance between two strings: str1 = "this is a te…

---

## [Call a macro from within a funciton](https://discourse.julialang.org/t/call-a-macro-from-within-a-funciton/42310)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 1\
**Last updated:** [June 30, 2020, 3:54pm UTC](https://discourse.julialang.org/t/call-a-macro-from-within-a-funciton/42310 "2020-06-30T15:54:30Z")

</div>

I am working with DataFrames.jl and DataFramesMeta.jl (which I love). So consider the following MWE, not directly related to my actual work: using DataFrames, DataFramesMeta grps = groupby(dff, :col1) dff = DataFrame(\[…

---

## [Nested random effects in MixedModels](https://discourse.julialang.org/t/nested-random-effects-in-mixedmodels/40290)

<div class="topic-metadata">

**Author:** [@talat](https://discourse.julialang.org/u/talat)\
**Replies:** 1\
**Last updated:** [June 30, 2020, 3:50pm UTC](https://discourse.julialang.org/t/nested-random-effects-in-mixedmodels/40290 "2020-06-30T15:50:40Z")

</div>

What is the correct specification of nested random effects in julia’s MixedModels package? What I’m trying to model can be done in R using lme4: y ~ x + (1 | site / block) so that blocks are nested in sites. How would…

---

## [Fast iteration over rows of a DataFrame](https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 14\
**Last updated:** [June 30, 2020, 3:20pm UTC](https://discourse.julialang.org/t/fast-iteration-over-rows-of-a-dataframe/24612 "2020-06-30T15:20:56Z")

</div>

I want to read a CSV file and do some path-dependent calculations involving multiple columns (i.e., no vectorization allowed in the actual problem.) I was surprised to see that in a simple example, DataFrames introduce …

---

## [How to get a random number from rand that is not an array?](https://discourse.julialang.org/t/how-to-get-a-random-number-from-rand-that-is-not-an-array/42304)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 3\
**Last updated:** [June 30, 2020, 2:37pm UTC](https://discourse.julialang.org/t/how-to-get-a-random-number-from-rand-that-is-not-an-array/42304 "2020-06-30T14:37:42Z")

</div>

Hello, Is it possible to generate a random number that is not a Vector{Float64} but just Float64? I want to change the value but the types don’t match. Is there a way to do this? a = 4 d = 7 qwe = zeros(a+d) asd = zer…

---

## [Can't Convert 'Nothing' to 'Missing'](https://discourse.julialang.org/t/cant-convert-nothing-to-missing/42303)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 4\
**Last updated:** [June 30, 2020, 2:20pm UTC](https://discourse.julialang.org/t/cant-convert-nothing-to-missing/42303 "2020-06-30T14:20:40Z")

</div>

There has been a bit of discussion on here about ‘nothing’ vs ‘missing’ and why both are needed. I don’t really have an opinion on this as long as I can easily convert, which I can’t. I tried the suggestion on Github …

---

## [Different image orientation in Images vs Makie](https://discourse.julialang.org/t/different-image-orientation-in-images-vs-makie/42288)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 1\
**Last updated:** [June 30, 2020, 1:44pm UTC](https://discourse.julialang.org/t/different-image-orientation-in-images-vs-makie/42288 "2020-06-30T13:44:27Z")

</div>

I have this (raw) image: julia\> depth1D 640×480 reshape(reinterpret(Float32, ::Array{UInt8,1}), 640, 480) with eltype Float32: When I display it with Images, calling imshow(depth1D), I get this orientation: When I …

---

## [How to save multivariate distribution generated by using variational inference with the help of Turing package?](https://discourse.julialang.org/t/how-to-save-multivariate-distribution-generated-by-using-variational-inference-with-the-help-of-turing-package/42300)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 0\
**Last updated:** [June 30, 2020, 1:22pm UTC](https://discourse.julialang.org/t/how-to-save-multivariate-distribution-generated-by-using-variational-inference-with-the-help-of-turing-package/42300 "2020-06-30T13:22:38Z")

</div>

Hi, I am trying to save the multivariate distribution generated by using variational inference. I tried to save in JLS format. But I am getting the following error: ERROR: MethodError: no method matching write(::IOStre…

---

## [Addprocs using](https://discourse.julialang.org/t/addprocs-using/42299)

<div class="topic-metadata">

**Author:** [@soo\_y](https://discourse.julialang.org/u/soo_y)\
**Replies:** 1\
**Last updated:** [June 30, 2020, 1:06pm UTC](https://discourse.julialang.org/t/addprocs-using/42299 "2020-06-30T13:06:41Z")

</div>

I am just trying to use addprocs but the error shows as below. Anyone know how do I handle it? type or paste cjulia\> addprocs(2) From worker 122: Master process (id 1) could not connect within 60.0 seconds. …

---

## [Why does this allocate?](https://discourse.julialang.org/t/why-does-this-allocate/42298)

<div class="topic-metadata">

**Author:** [@cafaxo](https://discourse.julialang.org/u/cafaxo)\
**Replies:** 4\
**Last updated:** [June 30, 2020, 12:23pm UTC](https://discourse.julialang.org/t/why-does-this-allocate/42298 "2020-06-30T12:23:42Z")

</div>

Consider the following code: function foo(x) if x\[1\] \> 0 (x, 1) else nothing end end It seems that this code has 1 allocation: julia\> bla = \[1\] 1-element Array{Int64,1}: 1 julia\> @time f…

---

## [Unitful: how to restrict units to specific dimension](https://discourse.julialang.org/t/unitful-how-to-restrict-units-to-specific-dimension/42295)

<div class="topic-metadata">

**Author:** [@Olivier\_Merchiers](https://discourse.julialang.org/u/Olivier_Merchiers)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 11:29am UTC](https://discourse.julialang.org/t/unitful-how-to-restrict-units-to-specific-dimension/42295 "2020-06-30T11:29:40Z")

</div>

Hello everyone, My question is very similar to How To Properly Use Unitful. I would like to make a function that is similar to uconvert in that its first argument is a unit of dimension length: f1(unit :: ??) = unit W…

---

## [Viewing the content of an array in a browser](https://discourse.julialang.org/t/viewing-the-content-of-an-array-in-a-browser/42297)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 10:57am UTC](https://discourse.julialang.org/t/viewing-the-content-of-an-array-in-a-browser/42297 "2020-06-30T10:57:30Z")

</div>

I have a script that updates every T seconds. The result of each update is an array. I would now like to display the content of the array on a (local) website using a browser, and then have the display update when my sc…

---

## [Adding a line to the end of an Array](https://discourse.julialang.org/t/adding-a-line-to-the-end-of-an-array/42291)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 8\
**Last updated:** [June 30, 2020, 10:42am UTC](https://discourse.julialang.org/t/adding-a-line-to-the-end-of-an-array/42291 "2020-06-30T10:42:20Z")

</div>

I have a 18×12 Array{Any,2} called “stock”. I also have a 12×1 vector called “flow”. My aim is to add the content of flow to the end of stock (essentially adding a new row to stock). I have tried stock = \[stock;flow'…

---

## [Adding a row to the end of a matrix](https://discourse.julialang.org/t/adding-a-row-to-the-end-of-a-matrix/42290)

<div class="topic-metadata">

**Author:** [@Nash](https://discourse.julialang.org/u/Nash)\
**Replies:** 4\
**Last updated:** [June 30, 2020, 9:30am UTC](https://discourse.julialang.org/t/adding-a-row-to-the-end-of-a-matrix/42290 "2020-06-30T09:30:54Z")

</div>

I have a row by col matrix called “stock” and I have a col array called “flow”. I want to add the content of flow to the bottom of stock. I thought the following would work, but it does not: stock = \[stock;flow\[1,:\]\] M…

---

## [Function returning normalized vector and norm](https://discourse.julialang.org/t/function-returning-normalized-vector-and-norm/42285)

<div class="topic-metadata">

**Author:** [@ettersi](https://discourse.julialang.org/u/ettersi)\
**Replies:** 9\
**Last updated:** [June 30, 2020, 9:15am UTC](https://discourse.julialang.org/t/function-returning-normalized-vector-and-norm/42285 "2020-06-30T09:15:50Z")

</div>

Does the standard library have a function equivalent to the following? function norm\_normalize(v, p = 2) n = norm(v,p) return n, v/n end If not, is there a reason why such a function does not exist? And finall…

---

## [Efficient way to find which package defines an unknown type](https://discourse.julialang.org/t/efficient-way-to-find-which-package-defines-an-unknown-type/42222)

<div class="topic-metadata">

**Author:** [@pauljurczak](https://discourse.julialang.org/u/pauljurczak)\
**Replies:** 15\
**Last updated:** [June 30, 2020, 8:24am UTC](https://discourse.julialang.org/t/efficient-way-to-find-which-package-defines-an-unknown-type/42222 "2020-06-30T08:24:41Z")

</div>

I installed a bunch of packages from https://juliaimages.org/ and I’m going through examples, which inevitably require more packages. Say, I’m confronted with: julia\> j = rand(Gray{N0f8}, 3, 4) ERROR: UndefVarError: N0f…

---

## [Metaprogamming](https://discourse.julialang.org/t/metaprogamming/42286)

<div class="topic-metadata">

**Author:** [@Azzaare](https://discourse.julialang.org/u/Azzaare)\
**Replies:** 5\
**Last updated:** [June 30, 2020, 6:38am UTC](https://discourse.julialang.org/t/metaprogamming/42286 "2020-06-30T06:38:50Z")

</div>

Hi there, I am writing a module with dozens of MyType like structure (as below), that all belong to an Abstract super type. I would like to be able to write a meta constructor (roughly sketched below). Is it possible? s…

---

## [What causes data movement when using remotecall\_fetch?](https://discourse.julialang.org/t/what-causes-data-movement-when-using-remotecall-fetch/42279)

<div class="topic-metadata">

**Author:** [@xtt](https://discourse.julialang.org/u/xtt)\
**Replies:** 2\
**Last updated:** [June 30, 2020, 5:05am UTC](https://discourse.julialang.org/t/what-causes-data-movement-when-using-remotecall-fetch/42279 "2020-06-30T05:05:55Z")

</div>

Hi, I read the section Data Movement and Global variables to understand when data is being transferred between processes. Still, I need some help here. I try to define a global data on the main process, send this data …

---

## [Is possible to enabled an option so that type-instable functions will throw an error?](https://discourse.julialang.org/t/is-possible-to-enabled-an-option-so-that-type-instable-functions-will-throw-an-error/42278)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 3\
**Last updated:** [June 30, 2020, 2:50am UTC](https://discourse.julialang.org/t/is-possible-to-enabled-an-option-so-that-type-instable-functions-will-throw-an-error/42278 "2020-06-30T02:50:39Z")

</div>

I wonder if it’s possible run a function so that after running the function, all type instable functions will throw error, e.g. it looks into the @code\_warntypes, detects if there are any Any and throw an error it does? …

---

## [Question on package vs modules](https://discourse.julialang.org/t/question-on-package-vs-modules/42196)

<div class="topic-metadata">

**Author:** [@jiggunjer](https://discourse.julialang.org/u/jiggunjer)\
**Replies:** 5\
**Last updated:** [June 30, 2020, 2:37am UTC](https://discourse.julialang.org/t/question-on-package-vs-modules/42196 "2020-06-30T02:37:02Z")

</div>

I’ve read the official documentation on packages and modules, but I get the impression the two concepts get conflated. Can someone say if the following statements are true or false, and if false then why: A single Gith…

---

## [Comparing Julia Performance to CLI Program](https://discourse.julialang.org/t/comparing-julia-performance-to-cli-program/42280)

<div class="topic-metadata">

**Author:** [@mtsch](https://discourse.julialang.org/u/mtsch)\
**Replies:** 0\
**Last updated:** [June 30, 2020, 2:22am UTC](https://discourse.julialang.org/t/comparing-julia-performance-to-cli-program/42280 "2020-06-30T02:22:01Z")

</div>

Hi, I have written a Julia package that is based on an algorithm that is used by a CLI program. I’m trying to perform some benchmarks to see where I stand. I want to eventually publish the results, so I want to make sur…

---

## [How to create a geotiff in Julia?](https://discourse.julialang.org/t/how-to-create-a-geotiff-in-julia/42270)

<div class="topic-metadata">

**Author:** [@scone](https://discourse.julialang.org/u/scone)\
**Replies:** 14\
**Last updated:** [June 30, 2020, 12:33am UTC](https://discourse.julialang.org/t/how-to-create-a-geotiff-in-julia/42270 "2020-06-30T00:33:15Z")

</div>

Hi, I have a array of values in Julia that I would like to export as a geotiff. Right now I am using osgeo in python to make them seperately, which is a pain. Does anyone have an example of how to do this? I can’t fin…

---

## [Haskey is deprecated, use Target instead](https://discourse.julialang.org/t/haskey-is-deprecated-use-target-instead/42273)

<div class="topic-metadata">

**Author:** [@deveshjawla](https://discourse.julialang.org/u/deveshjawla)\
**Replies:** 1\
**Last updated:** [June 29, 2020, 11:28pm UTC](https://discourse.julialang.org/t/haskey-is-deprecated-use-target-instead/42273 "2020-06-29T23:28:23Z")

</div>

I get this warning ever since I added CUDA.jl. How to make sense of a warning in Julia?

---

## [Structure Usage](https://discourse.julialang.org/t/structure-usage/42269)

<div class="topic-metadata">

**Author:** [@smickus](https://discourse.julialang.org/u/smickus)\
**Replies:** 3\
**Last updated:** [June 29, 2020, 9:45pm UTC](https://discourse.julialang.org/t/structure-usage/42269 "2020-06-29T21:45:26Z")

</div>

Hi so I am currently trying to create a structure I have included a condensed version of my structure that I am trying to create. The issue is that when I try and set the values of the fields in the structure they are a…

---

## [How to build a constraint with summation?](https://discourse.julialang.org/t/how-to-build-a-constraint-with-summation/41618)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 15\
**Last updated:** [June 29, 2020, 9:19pm UTC](https://discourse.julialang.org/t/how-to-build-a-constraint-with-summation/41618 "2020-06-29T21:19:34Z")

</div>

I need to mount this restriction But the following error is appearing when I compile the function: syntax: incomplete: premature end of input I’m doing like this using JuMP, Cbc Model1 = Model(with\_optimizer(Cbc.Op…

---

## [Given that Zygote does not support mutation, how does Recur gets away with it?](https://discourse.julialang.org/t/given-that-zygote-does-not-support-mutation-how-does-recur-gets-away-with-it/36290)

<div class="topic-metadata">

**Author:** [@Azamat](https://discourse.julialang.org/u/Azamat)\
**Replies:** 7\
**Last updated:** [June 29, 2020, 7:59pm UTC](https://discourse.julialang.org/t/given-that-zygote-does-not-support-mutation-how-does-recur-gets-away-with-it/36290 "2020-06-29T19:59:38Z")

</div>

From Flux.jl’s source code here: mutable struct Recur{T} cell::T init state end Recur(m, h = hidden(m)) = Recur(m, h, h) function (m::Recur)(xs...) h, y = m.cell(m.state, xs...) m.state = h return y end i…

---

## [Question regarding TIME\_LIMIT status](https://discourse.julialang.org/t/question-regarding-time-limit-status/42258)

<div class="topic-metadata">

**Author:** [@arkanver](https://discourse.julialang.org/u/arkanver)\
**Replies:** 2\
**Last updated:** [June 29, 2020, 7:09pm UTC](https://discourse.julialang.org/t/question-regarding-time-limit-status/42258 "2020-06-29T19:09:21Z")

</div>

Hi, I am trying to solve some optimization problems using JuMP + CPLEX. Since some problems take a long time I define a time limit of 3600 seconds for my model : model = Model(CPLEX.Optimizer) set\_optimizer\_attribute…

---

## [Code folding for emacs?](https://discourse.julialang.org/t/code-folding-for-emacs/41421)

<div class="topic-metadata">

**Author:** [@Perrin\_Meyer](https://discourse.julialang.org/u/Perrin_Meyer)\
**Replies:** 8\
**Last updated:** [June 29, 2020, 6:54pm UTC](https://discourse.julialang.org/t/code-folding-for-emacs/41421 "2020-06-29T18:54:03Z")

</div>

I’m using julia-mode.el, but I’m by no means an emacs wizard Is there a way to do code folding? I.e. I place the cursor at the start of a function, press some key combo, and it becomes one line… and then another key com…

---

## [Seeking recommended dashboard Julia packages](https://discourse.julialang.org/t/seeking-recommended-dashboard-julia-packages/42253)

<div class="topic-metadata">

**Author:** [@hafez\_ahmad](https://discourse.julialang.org/u/hafez_ahmad)\
**Replies:** 4\
**Last updated:** [June 29, 2020, 6:43pm UTC](https://discourse.julialang.org/t/seeking-recommended-dashboard-julia-packages/42253 "2020-06-29T18:43:03Z")

</div>

seeking recommended dashboard Julia packages. I know python Plotly dashboard and R shiny dashboard are suitable for me. but I am trying to move into Julia. I am trying to make geospatial dashboards .for example, I will …

---

## [Batch/batch in Flux?](https://discourse.julialang.org/t/batch-batch-in-flux/41735)

<div class="topic-metadata">

**Author:** [@mefob](https://discourse.julialang.org/u/mefob)\
**Replies:** 2\
**Last updated:** [June 29, 2020, 2:04pm UTC](https://discourse.julialang.org/t/batch-batch-in-flux/41735 "2020-06-29T14:04:09Z")

</div>

I am building my own ODE layer and would like to make sure it works with batches as well as with individual vectors. The input and output to my layer are a NxM 2D arrays, so I will also need to reshape to couple e.g. t…

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

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