# Latest

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

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

**Page:** 1750

---

## [Blog-post -- Euclidean Plane Geometry with Julia](https://discourse.julialang.org/t/blog-post-euclidean-plane-geometry-with-julia/39172)

<div class="topic-metadata">

**Author:** [@Xing\_Shi\_Cai](https://discourse.julialang.org/u/Xing_Shi_Cai)\
**Replies:** 2\
**Last updated:** [May 12, 2020, 4:16am UTC](https://discourse.julialang.org/t/blog-post-euclidean-plane-geometry-with-julia/39172 "2020-05-12T04:16:24Z")

</div>

Hi everyone, I just wrote a new blog post about doing a bit basic geometry with Julia.

---

## [Purpose of reduce(Array, Array)](https://discourse.julialang.org/t/purpose-of-reduce-array-array/39294)

<div class="topic-metadata">

**Author:** [@bpou](https://discourse.julialang.org/u/bpou)\
**Replies:** 5\
**Last updated:** [May 12, 2020, 3:45am UTC](https://discourse.julialang.org/t/purpose-of-reduce-array-array/39294 "2020-05-12T03:45:10Z")

</div>

Hello, I’m wondering what the purpose of reduce is when given two arrays as only arguments. Here’s what I’ve observed: julia\> reduce(\[1\], \[4\]) 4 julia\> reduce(\[1, 2, 3\], \[4\]) 4 julia\> reduce(\[1, 2, 3\], \[1\]) 1 ju…

---

## [Adding null-coalescing operator](https://discourse.julialang.org/t/adding-null-coalescing-operator/39318)

<div class="topic-metadata">

**Author:** [@zachmatson](https://discourse.julialang.org/u/zachmatson)\
**Replies:** 2\
**Last updated:** [May 12, 2020, 3:01am UTC](https://discourse.julialang.org/t/adding-null-coalescing-operator/39318 "2020-05-12T03:01:26Z")

</div>

C# has the “null-coalescing operator” ?? which equates to: # Existing syntax a = !isnothing(b) ? b : c # Equivalent if ?? introduced a = b ?? c I don’t think this is an especially important or foundational operator, bu…

---

## [SharedArray with mixed types of elements? Alternative functions?](https://discourse.julialang.org/t/sharedarray-with-mixed-types-of-elements-alternative-functions/39316)

<div class="topic-metadata">

**Author:** [@Jing\_Zhang](https://discourse.julialang.org/u/Jing_Zhang)\
**Replies:** 2\
**Last updated:** [May 12, 2020, 1:50am UTC](https://discourse.julialang.org/t/sharedarray-with-mixed-types-of-elements-alternative-functions/39316 "2020-05-12T01:50:57Z")

</div>

Hi Julia users, I am doing parallel computation using @distributed. The returned results will be a multi-dimensional array with mixed types of elements, such as Int64, Float64 and Spring. I was trying to use SharedArray…

---

## [Parallel loops and maps](https://discourse.julialang.org/t/parallel-loops-and-maps/39309)

<div class="topic-metadata">

**Author:** [@Jing\_Zhang](https://discourse.julialang.org/u/Jing_Zhang)\
**Replies:** 8\
**Last updated:** [May 12, 2020, 1:47am UTC](https://discourse.julialang.org/t/parallel-loops-and-maps/39309 "2020-05-12T01:47:06Z")

</div>

Dear Julia Users, I am running multiple layers of for loops. Within the for loops, it is a function named do\_one, which will return a 105000×34 DataFrame. I would want to combine these DataFrame to a larger DataFrame. C…

---

## [Anonymous functions with tuple arguments](https://discourse.julialang.org/t/anonymous-functions-with-tuple-arguments/3306)

<div class="topic-metadata">

**Author:** [@greg\_plowman](https://discourse.julialang.org/u/greg_plowman)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 9:36pm UTC](https://discourse.julialang.org/t/anonymous-functions-with-tuple-arguments/3306 "2020-05-11T21:36:20Z")

</div>

I have a feeling this is a stupid question, but here it is anyway: Suppose I have a collection of tuples. Would it be possible to write anonymous function (x,y,…)-\>… where arguments are the tuple elements? An example: …

---

## [What does this error message mean](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 7\
**Last updated:** [May 11, 2020, 9:29pm UTC](https://discourse.julialang.org/t/what-does-this-error-message-mean/39303 "2020-05-11T21:29:36Z")

</div>

It should be sort of obvious: I am redefining a const somewhere. Which const could it be? I have nothing named Variable anywhere. I only have 4 structs anywhere in the code. None redefine another. What is the refere…

---

## [Need help writing some recursive code please! Full code explanation and snapshot included](https://discourse.julialang.org/t/need-help-writing-some-recursive-code-please-full-code-explanation-and-snapshot-included/39306)

<div class="topic-metadata">

**Author:** [@Julia1](https://discourse.julialang.org/u/Julia1)\
**Replies:** 6\
**Last updated:** [May 11, 2020, 9:00pm UTC](https://discourse.julialang.org/t/need-help-writing-some-recursive-code-please-full-code-explanation-and-snapshot-included/39306 "2020-05-11T21:00:23Z")

</div>

Hi how’s it going? I’m trying to write this recursive code out and can’t get it to work. Can someone help me with a solution? Here is a code of the scenario. y = \[2,2,2,2,3,3,4\] x = \[1,2,3,3,2,2,2\] df = DataFrame(:colu…

---

## [$110 million lost because software could not cope with negative numbers](https://discourse.julialang.org/t/110-million-lost-because-software-could-not-cope-with-negative-numbers/39264)

<div class="topic-metadata">

**Author:** [@johnh](https://discourse.julialang.org/u/johnh)\
**Replies:** 6\
**Last updated:** [May 11, 2020, 7:12pm UTC](https://discourse.julialang.org/t/110-million-lost-because-software-could-not-cope-with-negative-numbers/39264 "2020-05-11T19:12:47Z")

</div>

https://www.bloomberg.com/news/articles/2020-05-08/oil-crash-busted-a-broker-s-computers-and-inflicted-huge-losses Don’t buy oil at 1 cent per barrel - that gift horse IS too good Is the opinion that Julias type system…

---

## [How to choose a nonlinear optimizer (ecosystem)?](https://discourse.julialang.org/t/how-to-choose-a-nonlinear-optimizer-ecosystem/39231)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 7\
**Last updated:** [May 11, 2020, 6:50pm UTC](https://discourse.julialang.org/t/how-to-choose-a-nonlinear-optimizer-ecosystem/39231 "2020-05-11T18:50:09Z")

</div>

At work, we currently use JuMP + Gurobi to solve fairly large LPs in production. These LPs are linear approximations of much smaller nonlinear problems. For several reasons including “Gurobi is expensive” and “this appro…

---

## [Preconditioner for L-BFGS in Optim.jl](https://discourse.julialang.org/t/preconditioner-for-l-bfgs-in-optim-jl/39167)

<div class="topic-metadata">

**Author:** [@cpross90](https://discourse.julialang.org/u/cpross90)\
**Replies:** 17\
**Last updated:** [May 11, 2020, 6:45pm UTC](https://discourse.julialang.org/t/preconditioner-for-l-bfgs-in-optim-jl/39167 "2020-05-11T18:45:54Z")

</div>

I’m stumped, and I’m not sure if my problem is a lack of understanding of the L-BFGS implementation or the Optim.jl interface. I’m trying to figure out how to create a preconditioner such that it is equivalent to the ap…

---

## [Monte Carlo particle simulations are very slow](https://discourse.julialang.org/t/monte-carlo-particle-simulations-are-very-slow/39239)

<div class="topic-metadata">

**Author:** [@edwinb-ai](https://discourse.julialang.org/u/edwinb-ai)\
**Replies:** 9\
**Last updated:** [May 11, 2020, 5:15pm UTC](https://discourse.julialang.org/t/monte-carlo-particle-simulations-are-very-slow/39239 "2020-05-11T17:15:40Z")

</div>

Hello everyone, I’m still learning Julia by doing some standard physics simulations in Julia. I used to have all of my code base in C and Fortran, and just recently attempted to migrate everything to Julia. In particul…

---

## [Help on Live Plotting data which are getting appended to file(.txt)](https://discourse.julialang.org/t/help-on-live-plotting-data-which-are-getting-appended-to-file-txt/39224)

<div class="topic-metadata">

**Author:** [@Fringe](https://discourse.julialang.org/u/Fringe)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 5:44pm UTC](https://discourse.julialang.org/t/help-on-live-plotting-data-which-are-getting-appended-to-file-txt/39224 "2020-05-11T17:44:55Z")

</div>

I am very new to Julia, I have a question for the experts, currently, I am appending bunch of data to a text file using c++ , the data is just numbers separated by comma and i just keep apending more numbers in new line…

---

## [Is there a way to "print" to pdf, html, or similar a copy of the code with syntax highlighting?](https://discourse.julialang.org/t/is-there-a-way-to-print-to-pdf-html-or-similar-a-copy-of-the-code-with-syntax-highlighting/39290)

<div class="topic-metadata">

**Author:** [@klaff](https://discourse.julialang.org/u/klaff)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 5:27pm UTC](https://discourse.julialang.org/t/is-there-a-way-to-print-to-pdf-html-or-similar-a-copy-of-the-code-with-syntax-highlighting/39290 "2020-05-11T17:27:38Z")

</div>

This would be for sharing snippets or files with folks who do not have a Julia-enabled editor.

---

## [How to query elements in a matrix diagonal to a given point](https://discourse.julialang.org/t/how-to-query-elements-in-a-matrix-diagonal-to-a-given-point/39253)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 8\
**Last updated:** [May 11, 2020, 5:13pm UTC](https://discourse.julialang.org/t/how-to-query-elements-in-a-matrix-diagonal-to-a-given-point/39253 "2020-05-11T17:13:56Z")

</div>

I’m wondering if there’s an efficient way to return all of the elements in a matrix that are diagonal to some starting point. For example, given the following matrix: julia\> A = \[1 2 3 4; 5 6 7 8; 9 10 11 12; 13 14 15 1…

---

## [Networkx & lightgraphs.jl shortest path benchmark](https://discourse.julialang.org/t/networkx-lightgraphs-jl-shortest-path-benchmark/39245)

<div class="topic-metadata">

**Author:** [@zhangliye](https://discourse.julialang.org/u/zhangliye)\
**Replies:** 7\
**Last updated:** [May 11, 2020, 4:36pm UTC](https://discourse.julialang.org/t/networkx-lightgraphs-jl-shortest-path-benchmark/39245 "2020-05-11T16:36:20Z")

</div>

I have developped a small package (GraphMLReader.jl ) to load GraphML file to MetaGraph, which keep all the attributes of nodes and edges. I compare the speed of reading GraphML file and dijkstra shortest path of network…

---

## [Conditional NLconstraint, Couenne](https://discourse.julialang.org/t/conditional-nlconstraint-couenne/26801)

<div class="topic-metadata">

**Author:** [@Raminel](https://discourse.julialang.org/u/Raminel)\
**Replies:** 4\
**Last updated:** [May 11, 2020, 4:50pm UTC](https://discourse.julialang.org/t/conditional-nlconstraint-couenne/26801 "2020-05-11T16:50:26Z")

</div>

Hi all, I am trying to solve a MINLP problem with Couenne. I have difficulty implementing an NLconstraint of this form: if x\[i,j\] == 0, y\[i,j\] == 0 else y\[i,j\] = 1/x\[i,j\], I have checked the Syntax notes and I still can…

---

## [Need to sample from two-parameter univariate exponential distribution](https://discourse.julialang.org/t/need-to-sample-from-two-parameter-univariate-exponential-distribution/39288)

<div class="topic-metadata">

**Author:** [@Manoj\_Gopalkrishnan](https://discourse.julialang.org/u/Manoj_Gopalkrishnan)\
**Replies:** 3\
**Last updated:** [May 11, 2020, 4:50pm UTC](https://discourse.julialang.org/t/need-to-sample-from-two-parameter-univariate-exponential-distribution/39288 "2020-05-11T16:50:11Z")

</div>

Hello, I need to sample from a two-parameter family of continuous univariate distributions supported on the interval \[0,C\] where C is around 10^{12}. The parameters are \\alpha and \\beta and the PDF is proportional to e…

---

## [Dynamic reloading of Objects using Revise or Cassette?](https://discourse.julialang.org/t/dynamic-reloading-of-objects-using-revise-or-cassette/38018)

<div class="topic-metadata">

**Author:** [@Amval](https://discourse.julialang.org/u/Amval)\
**Replies:** 3\
**Last updated:** [May 11, 2020, 4:20pm UTC](https://discourse.julialang.org/t/dynamic-reloading-of-objects-using-revise-or-cassette/38018 "2020-05-11T16:20:04Z")

</div>

Hello all, I need help to find a strategy to speed up my development process. I have written a framework in Julia, which I use for writing conversational agents. Whenever I am working on the framework code, everything …

---

## [PackageCompiler Executable - Plots not showing up](https://discourse.julialang.org/t/packagecompiler-executable-plots-not-showing-up/32630)

<div class="topic-metadata">

**Author:** [@mtwhite4](https://discourse.julialang.org/u/mtwhite4)\
**Replies:** 4\
**Last updated:** [December 25, 2019, 6:11am UTC](https://discourse.julialang.org/t/packagecompiler-executable-plots-not-showing-up/32630 "2019-12-25T06:11:46Z")

</div>

Hi all, I just figured out how to compile my code into an executable using PackageCompiler. This has worked great. However, upon running the code, none of the plot windows show up. For my project it is necessary that th…

---

## [Any benchmark about memory consumption?](https://discourse.julialang.org/t/any-benchmark-about-memory-consumption/17270)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 11\
**Last updated:** [May 11, 2020, 4:02pm UTC](https://discourse.julialang.org/t/any-benchmark-about-memory-consumption/17270 "2020-05-11T16:02:36Z")

</div>

There are some benchmarks testing the time to compute several tasks compared to other languages. But what about memory consumption? For example how well does Julia reshape a dataset from long to wide format compared to…

---

## [Converting DataValues.DataValue{String} to String](https://discourse.julialang.org/t/converting-datavalues-datavalue-string-to-string/38941)

<div class="topic-metadata">

**Author:** [@stej](https://discourse.julialang.org/u/stej)\
**Replies:** 10\
**Last updated:** [May 11, 2020, 3:51pm UTC](https://discourse.julialang.org/t/converting-datavalues-datavalue-string-to-string/38941 "2020-05-11T15:51:45Z")

</div>

Hi all, just continuing from Read CSV and change rows later - #6 by pdeffebach I’m trying to convert a column like this: using CSV using DataFrames using Query file = """ "X1", "X2", "X3", "x4", "Splits" "5674012","53…

---

## [Why get(A) involves allocation?](https://discourse.julialang.org/t/why-get-a-involves-allocation/39145)

<div class="topic-metadata">

**Author:** [@vinhphunguyen](https://discourse.julialang.org/u/vinhphunguyen)\
**Replies:** 5\
**Last updated:** [May 11, 2020, 3:07pm UTC](https://discourse.julialang.org/t/why-get-a-involves-allocation/39145 "2020-05-11T15:07:04Z")

</div>

Hi all, Could u please explain why get(A) where A is a matrix involves allocation? The code is: julia\> a=ones(3,3) 3×3 Array{Float64,2}: 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 1.0 julia\> function f(a) return …

---

## [GLPK callbacks in JuMP](https://discourse.julialang.org/t/glpk-callbacks-in-jump/39261)

<div class="topic-metadata">

**Author:** [@jmacherone](https://discourse.julialang.org/u/jmacherone)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 3:02pm UTC](https://discourse.julialang.org/t/glpk-callbacks-in-jump/39261 "2020-05-11T15:02:40Z")

</div>

Hello! I’ve been trying to implement a callback function using GLPK that rejects feasible solutions (with lazy constraints) when certain conditions are met. However, I understand that JuMP only allows you to retrieve so…

---

## [While loop](https://discourse.julialang.org/t/while-loop/39282)

<div class="topic-metadata">

**Author:** [@Jul](https://discourse.julialang.org/u/Jul)\
**Replies:** 4\
**Last updated:** [May 11, 2020, 2:50pm UTC](https://discourse.julialang.org/t/while-loop/39282 "2020-05-11T14:50:03Z")

</div>

Hello, I’m trying to rewrite some old java code to julia and I’ve problem with whlie loop. In java I was while(++a \< b && c\>d) and here I see that ++ is “not a unuary operator”. Is it possible to create this kind of comp…

---

## [Can not cahnge variables defined in an external file](https://discourse.julialang.org/t/can-not-cahnge-variables-defined-in-an-external-file/39214)

<div class="topic-metadata">

**Author:** [@fedoroff](https://discourse.julialang.org/u/fedoroff)\
**Replies:** 7\
**Last updated:** [May 11, 2020, 2:40pm UTC](https://discourse.julialang.org/t/can-not-cahnge-variables-defined-in-an-external-file/39214 "2020-05-11T14:40:45Z")

</div>

Let us assume that I define some variables in a separate file “input.jl”. For example, let the content of “input.jl” be a = 123.0 Then, I want to use the name of this file as an input parameter to dynamically load the…

---

## [Please help, I study computer science at the university](https://discourse.julialang.org/t/please-help-i-study-computer-science-at-the-university/39262)

<div class="topic-metadata">

**Author:** [@qais](https://discourse.julialang.org/u/qais)\
**Replies:** 9\
**Last updated:** [May 11, 2020, 2:36pm UTC](https://discourse.julialang.org/t/please-help-i-study-computer-science-at-the-university/39262 "2020-05-11T14:36:52Z")

</div>

Please my friends Can you answer these questions related to the Julia programming language ? Classify your language (imperative, functional, logic, OO, your choice). Is the scoping static or dynamic? Is type ch…

---

## [Debugging macros at module loading](https://discourse.julialang.org/t/debugging-macros-at-module-loading/39286)

<div class="topic-metadata">

**Author:** [@bcgv](https://discourse.julialang.org/u/bcgv)\
**Replies:** 0\
**Last updated:** [May 11, 2020, 1:24pm UTC](https://discourse.julialang.org/t/debugging-macros-at-module-loading/39286 "2020-05-11T13:24:43Z")

</div>

Hello, I am using several macros in a module I am creating. How can I step through the macro for debugging? I am looking for something like (which obviously does not work, not a function call): @enter using mymodule …

---

## [How to use matplotlib in julia? without using python backend?](https://discourse.julialang.org/t/how-to-use-matplotlib-in-julia-without-using-python-backend/39270)

<div class="topic-metadata">

**Author:** [@Neeraj\_Verma\_ASETRAI](https://discourse.julialang.org/u/Neeraj_Verma_ASETRAI)\
**Replies:** 2\
**Last updated:** [May 11, 2020, 12:39pm UTC](https://discourse.julialang.org/t/how-to-use-matplotlib-in-julia-without-using-python-backend/39270 "2020-05-11T12:39:01Z")

</div>

How i can use matplotlib graph plotting tool with julia native without using any python backend? please help me out…

---

## [How to plot square root of solution to an ODE](https://discourse.julialang.org/t/how-to-plot-square-root-of-solution-to-an-ode/39272)

<div class="topic-metadata">

**Author:** [@Manoj\_Gopalkrishnan](https://discourse.julialang.org/u/Manoj_Gopalkrishnan)\
**Replies:** 3\
**Last updated:** [May 11, 2020, 12:22pm UTC](https://discourse.julialang.org/t/how-to-plot-square-root-of-solution-to-an-ode/39272 "2020-05-11T12:22:40Z")

</div>

Hi, I have an ODEProblem, let us say like the one in this example: https://docs.sciml.ai/stable/tutorials/ode\_example/ function parameterized\_lorenz!(du,u,p,t) du\[1\] = p\[1\]\*(u\[2\]-u\[1\]) du\[2\] = u\[1\]\*(p\[2\]-u\[3\]) - u\[2\]…

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

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