# Latest

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

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

**Page:** 1539

---

## [Why Might One Get Different Behavior in the VSCode Extension vs the Terminal?](https://discourse.julialang.org/t/why-might-one-get-different-behavior-in-the-vscode-extension-vs-the-terminal/52276)

<div class="topic-metadata">

**Author:** [@JamesK](https://discourse.julialang.org/u/JamesK)\
**Replies:** 3\
**Last updated:** [December 25, 2020, 5:01am UTC](https://discourse.julialang.org/t/why-might-one-get-different-behavior-in-the-vscode-extension-vs-the-terminal/52276 "2020-12-25T05:01:34Z")

</div>

I am experiencing different behavior running the same command: include(raw"/home/james/Julia\_projs/calling\_pytorch\_proj/main.jl") using the VSCode extension versus using the julia REPL called from the command line (Ubu…

---

## [VsCode julia execute file and while loop](https://discourse.julialang.org/t/vscode-julia-execute-file-and-while-loop/52022)

<div class="topic-metadata">

**Author:** [@hei06j](https://discourse.julialang.org/u/hei06j)\
**Replies:** 4\
**Last updated:** [December 25, 2020, 4:38am UTC](https://discourse.julialang.org/t/vscode-julia-execute-file-and-while-loop/52022 "2020-12-25T04:38:07Z")

</div>

Hi, I have a script with a while loop. When I run the code using “Shift+Enter”, “Alt+Enter” or even “Execute Code” everything is fine. But when I use “Execute file”, two errors I get (1) the global variables are not rec…

---

## [Maximum Likelihood: Normal Linear Model](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664)

<div class="topic-metadata">

**Author:** [@Donald\_Lacombe](https://discourse.julialang.org/u/Donald_Lacombe)\
**Replies:** 31\
**Last updated:** [December 25, 2020, 2:14am UTC](https://discourse.julialang.org/t/maximum-likelihood-normal-linear-model/11664 "2020-12-25T02:14:34Z")

</div>

Hello, I’m trying to optimize a simple normal linear model likelihood function and have two questions. The code I am using is below: using Optim nobs = 500 nvar = 1 β = ones(nvar)\*3.0 x = \[ones(nobs) randn(nobs,nvar-1…

---

## [Two almost identical image convolve function different results](https://discourse.julialang.org/t/two-almost-identical-image-convolve-function-different-results/52353)

<div class="topic-metadata">

**Author:** [@zshen0x](https://discourse.julialang.org/u/zshen0x)\
**Replies:** 0\
**Last updated:** [December 24, 2020, 11:49pm UTC](https://discourse.julialang.org/t/two-almost-identical-image-convolve-function-different-results/52353 "2020-12-24T23:49:22Z")

</div>

I think I have these two identical function (the difference is using acc inside a loop or not) function convolve\_image\_bad(M::AbstractMatrix, K::AbstractMatrix) M′ = zero(M) nrow, ncol = size(M) lr, lc = size(K) .÷ 2…

---

## [How to adjust file modification times?](https://discourse.julialang.org/t/how-to-adjust-file-modification-times/52337)

<div class="topic-metadata">

**Author:** [@Joris\_Pinkse](https://discourse.julialang.org/u/Joris_Pinkse)\
**Replies:** 3\
**Last updated:** [December 24, 2020, 9:00pm UTC](https://discourse.julialang.org/t/how-to-adjust-file-modification-times/52337 "2020-12-24T21:00:58Z")

</div>

How do I change the modification time of a file to a prespecified time other than by going something like run(touch ....) ? I know there is a touch command in Julia, but it only sets it to the current time.

---

## [Array of heterogeneous named tuples to DataFrame](https://discourse.julialang.org/t/array-of-heterogeneous-named-tuples-to-dataframe/52339)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [December 24, 2020, 8:45pm UTC](https://discourse.julialang.org/t/array-of-heterogeneous-named-tuples-to-dataframe/52339 "2020-12-24T20:45:18Z")

</div>

Hi all- I would like to convert an array of named tuples to a dataframe. This can be achieved with the DataFrame constructor when the named tuples have the same keys. However, in my case, the named tuples do not necessa…

---

## [Float64 Julian Date from AstroTime](https://discourse.julialang.org/t/float64-julian-date-from-astrotime/52341)

<div class="topic-metadata">

**Author:** [@rbl100](https://discourse.julialang.org/u/rbl100)\
**Replies:** 1\
**Last updated:** [December 24, 2020, 8:26pm UTC](https://discourse.julialang.org/t/float64-julian-date-from-astrotime/52341 "2020-12-24T20:26:51Z")

</div>

I can use AstroTime julian(UTCEpoch(2020,12,24,12,0,0.0)) to give me 2.459208e6 days. How do I turn that into a simple float? Float64() gives an error. I’m sure I’m missing something simple. Thanks in advance.

---

## [Inpolygon usage](https://discourse.julialang.org/t/inpolygon-usage/39226)

<div class="topic-metadata">

**Author:** [@O\_Julia](https://discourse.julialang.org/u/O_Julia)\
**Replies:** 7\
**Last updated:** [December 24, 2020, 6:15pm UTC](https://discourse.julialang.org/t/inpolygon-usage/39226 "2020-12-24T18:15:59Z")

</div>

How can we generate following Octave codes in Julia with GeometricalPredicates package xv = \[ 0.05840, 0.48375, 0.69356, 1.47478, 1.32158, ... 1.94545, 2.16477, 1.87639, 1.18218, 0.27615, ... 0.05840 \]; …

---

## [Save figure in eps or pdf using Plots pyplot() or gr()](https://discourse.julialang.org/t/save-figure-in-eps-or-pdf-using-plots-pyplot-or-gr/52330)

<div class="topic-metadata">

**Author:** [@juliauser](https://discourse.julialang.org/u/juliauser)\
**Replies:** 1\
**Last updated:** [December 24, 2020, 5:16pm UTC](https://discourse.julialang.org/t/save-figure-in-eps-or-pdf-using-plots-pyplot-or-gr/52330 "2020-12-24T17:16:20Z")

</div>

I am trying to save a plot with scatter,marketcolors, etc etc… in either pdf or eps, but I can only save in png. If the extension is pdf or eps the code crashes with pyplot() or it fails at plotting the minus sign in fr…

---

## [Anything like C++ std::includes?](https://discourse.julialang.org/t/anything-like-c-std-includes/52288)

<div class="topic-metadata">

**Author:** [@phendric](https://discourse.julialang.org/u/phendric)\
**Replies:** 15\
**Last updated:** [December 24, 2020, 5:03pm UTC](https://discourse.julialang.org/t/anything-like-c-std-includes/52288 "2020-12-24T17:03:44Z")

</div>

Question: does Julia have an analog to C++'s std::includes? issubset doesn’t do what I’m looking for (I want following to return false, as the first array isn’t a sub-array of the 2nd): julia\> issubset(\[4,4,1\],\[1,4,2\])…

---

## [Trouble with macro expression escaping](https://discourse.julialang.org/t/trouble-with-macro-expression-escaping/52312)

<div class="topic-metadata">

**Author:** [@Volker\_Weissmann](https://discourse.julialang.org/u/Volker_Weissmann)\
**Replies:** 3\
**Last updated:** [December 24, 2020, 4:32pm UTC](https://discourse.julialang.org/t/trouble-with-macro-expression-escaping/52312 "2020-12-24T16:32:35Z")

</div>

This code: macro mymacro(ast) println("ast outside = ", ast, "---\\n") :(function generated() println("ast inside = ", $ast, "---\\n") end ) end @mymacro function func() return 123 end genera…

---

## [Converting QRCompactWY.Q to Array changes its size](https://discourse.julialang.org/t/converting-qrcompactwy-q-to-array-changes-its-size/52291)

<div class="topic-metadata">

**Author:** [@dstahlke](https://discourse.julialang.org/u/dstahlke)\
**Replies:** 6\
**Last updated:** [December 24, 2020, 4:21pm UTC](https://discourse.julialang.org/t/converting-qrcompactwy-q-to-array-changes-its-size/52291 "2020-12-24T16:21:30Z")

</div>

I’m trying to convert the Q matrix from a QR transform into an Array. But it changes size. Is this a bug or am I doing it wrong? julia\> size(qr(ones(9,5)).Q) (9, 9) julia\> size(Array(qr(ones(9,5)).Q)) (9, 5) Motivat…

---

## [Need to plot high resolution time series data](https://discourse.julialang.org/t/need-to-plot-high-resolution-time-series-data/52316)

<div class="topic-metadata">

**Author:** [@Zaim\_Awang](https://discourse.julialang.org/u/Zaim_Awang)\
**Replies:** 11\
**Last updated:** [December 24, 2020, 3:35pm UTC](https://discourse.julialang.org/t/need-to-plot-high-resolution-time-series-data/52316 "2020-12-24T15:35:48Z")

</div>

I have successfully created a time series plot using timeseries.jl, with Version 1.5.3 (2020-11-09), in Juno, installed with JuliaPro, with the following code ATTEMPT 1: using IterableTables using DataFrames using CSV …

---

## [Getting INVALID\_MODEL error while solving RMSE](https://discourse.julialang.org/t/getting-invalid-model-error-while-solving-rmse/52153)

<div class="topic-metadata">

**Author:** [@gaadis](https://discourse.julialang.org/u/gaadis)\
**Replies:** 8\
**Last updated:** [December 24, 2020, 2:12pm UTC](https://discourse.julialang.org/t/getting-invalid-model-error-while-solving-rmse/52153 "2020-12-24T14:12:28Z")

</div>

I’m attempting to minimize an RMSE where the optimized coefficients alpha and beta give a forecasted value (xnext) from the original value (x\_k). Initially it did not let me add the square root in the objective function…

---

## [Reinterpret Tuple as Struct, and vector thereof](https://discourse.julialang.org/t/reinterpret-tuple-as-struct-and-vector-thereof/52324)

<div class="topic-metadata">

**Author:** [@circonflexe](https://discourse.julialang.org/u/circonflexe)\
**Replies:** 2\
**Last updated:** [December 24, 2020, 2:05pm UTC](https://discourse.julialang.org/t/reinterpret-tuple-as-struct-and-vector-thereof/52324 "2020-12-24T14:05:13Z")

</div>

So I am playing a bit with the Clipper.jl library, which uses a type IntPoint defined as a struct of two Int64 fields. However, it would be more convenient for me to use static vectors of fixed-point reals, i.e. SVector{…

---

## [LightGraphs for Luby's algorithm](https://discourse.julialang.org/t/lightgraphs-for-lubys-algorithm/52306)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 1\
**Last updated:** [December 24, 2020, 12:12pm UTC](https://discourse.julialang.org/t/lightgraphs-for-lubys-algorithm/52306 "2020-12-24T12:12:46Z")

</div>

I am trying to use the LightGraphs and associated packages to implement Maximal-Independent-Set algorithms: Luby, Blelloch Both algorithms work by iterating over vertices and based on a relation between a vertex and its…

---

## [NLsolve not able to render solution](https://discourse.julialang.org/t/nlsolve-not-able-to-render-solution/52319)

<div class="topic-metadata">

**Author:** [@bhaveshshrimali](https://discourse.julialang.org/u/bhaveshshrimali)\
**Replies:** 2\
**Last updated:** [December 24, 2020, 7:41am UTC](https://discourse.julialang.org/t/nlsolve-not-able-to-render-solution/52319 "2020-12-24T07:41:37Z")

</div>

Hi everyone, I am trying to use NLsolve to solve a nonlinear equation and trying to compare it with scipy.optimize.root. However, as usual, the solver isn’t rendering the solution and my guess is that I am not using it …

---

## [DDE too stiff? Required tolerances are too slow](https://discourse.julialang.org/t/dde-too-stiff-required-tolerances-are-too-slow/52259)

<div class="topic-metadata">

**Author:** [@ANasc](https://discourse.julialang.org/u/ANasc)\
**Replies:** 4\
**Last updated:** [December 24, 2020, 4:51am UTC](https://discourse.julialang.org/t/dde-too-stiff-required-tolerances-are-too-slow/52259 "2020-12-24T04:51:49Z")

</div>

Hi, I have a system of DDEs that model host-parasite dynamics in a seasonal environment and I am having some issues because (I think) the equations are so stiff. Basically, when the number of hosts S is too high (\> abou…

---

## [Romberg.jl: Simple Romberg integration in Julia](https://discourse.julialang.org/t/romberg-jl-simple-romberg-integration-in-julia/39313)

<div class="topic-metadata">

**Author:** [@EP-Guy](https://discourse.julialang.org/u/EP-Guy)\
**Replies:** 11\
**Last updated:** [December 24, 2020, 1:46am UTC](https://discourse.julialang.org/t/romberg-jl-simple-romberg-integration-in-julia/39313 "2020-12-24T01:46:32Z")

</div>

Romberg integration combines trapezoidal integration with Richardson extrapolation for significantly more accurate estimates at slightly more cost than trapezoidal integration alone. This package uses Trapz.jl for the…

---

## [Multiple dispatch Union](https://discourse.julialang.org/t/multiple-dispatch-union/52280)

<div class="topic-metadata">

**Author:** [@ZettEff](https://discourse.julialang.org/u/ZettEff)\
**Replies:** 5\
**Last updated:** [December 24, 2020, 12:13am UTC](https://discourse.julialang.org/t/multiple-dispatch-union/52280 "2020-12-24T00:13:01Z")

</div>

I have a question and am not even sure how to phrase it correctly. In the end I am wondering if my (toy) implementation can be improved / made more idiomatic to julia. So this is a pure learning question. Problem I hav…

---

## [Software Carpentry lessons with Julia](https://discourse.julialang.org/t/software-carpentry-lessons-with-julia/51996)

<div class="topic-metadata">

**Author:** [@giordano](https://discourse.julialang.org/u/giordano)\
**Replies:** 8\
**Last updated:** [December 23, 2020, 11:30pm UTC](https://discourse.julialang.org/t/software-carpentry-lessons-with-julia/51996 "2020-12-23T23:30:43Z")

</div>

Software Carpentry is a project to teach basics of programming in the context of research computing. The target audience includes both students and researchers. The current curriculum includes the use of Unix shell, ve…

---

## [Addressing raw string syntax and semantics for Julia 2.0?](https://discourse.julialang.org/t/addressing-raw-string-syntax-and-semantics-for-julia-2-0/51343)

<div class="topic-metadata">

**Author:** [@cce](https://discourse.julialang.org/u/cce)\
**Replies:** 58\
**Last updated:** [December 23, 2020, 11:16pm UTC](https://discourse.julialang.org/t/addressing-raw-string-syntax-and-semantics-for-julia-2-0/51343 "2020-12-23T23:16:45Z")

</div>

This discussion (as of December 17th) is now arguing a paired delimiter (such as double-angle brackets ⟪...⟫) could offer improved semantics for raw strings, used by regular expressions and other string notations, by neg…

---

## [Working setup for emacs org-mode](https://discourse.julialang.org/t/working-setup-for-emacs-org-mode/41574)

<div class="topic-metadata">

**Author:** [@Chen](https://discourse.julialang.org/u/Chen)\
**Replies:** 4\
**Last updated:** [December 23, 2020, 11:07pm UTC](https://discourse.julialang.org/t/working-setup-for-emacs-org-mode/41574 "2020-12-23T23:07:33Z")

</div>

I am confused when reading posts that used ob-emacs or ESS. Could someone post a .emacs setup that works? The idea is to write Julia codes in emacs org-mode and run the codes there. Thanks!

---

## [Reduce memory allocation for repeatedly solving problem using Optim.jl](https://discourse.julialang.org/t/reduce-memory-allocation-for-repeatedly-solving-problem-using-optim-jl/52292)

<div class="topic-metadata">

**Author:** [@MFairley](https://discourse.julialang.org/u/MFairley)\
**Replies:** 0\
**Last updated:** [December 23, 2020, 8:16pm UTC](https://discourse.julialang.org/t/reduce-memory-allocation-for-repeatedly-solving-problem-using-optim-jl/52292 "2020-12-23T20:16:29Z")

</div>

I’m trying to re-solve a problem with different parameter values many times using Optim.jl. My current code allocates a lot of memory because a new TwiceDifferentiable and TwiceDifferentiableConstraints is created for ev…

---

## [Change array type in mutating function?](https://discourse.julialang.org/t/change-array-type-in-mutating-function/52284)

<div class="topic-metadata">

**Author:** [@mihalybaci](https://discourse.julialang.org/u/mihalybaci)\
**Replies:** 4\
**Last updated:** [December 23, 2020, 6:44pm UTC](https://discourse.julialang.org/t/change-array-type-in-mutating-function/52284 "2020-12-23T18:44:26Z")

</div>

I am trying to define some simple functions for 2-D and 3-D rotations, and I would like to define a mutating version as well. This function function rotate!(r, θ) r\[:\] = exp(θ\*\[0 1 ; -1 0\])\*r end works for arrays o…

---

## [Array cumulation](https://discourse.julialang.org/t/array-cumulation/52287)

<div class="topic-metadata">

**Author:** [@danicaratelli](https://discourse.julialang.org/u/danicaratelli)\
**Replies:** 4\
**Last updated:** [December 23, 2020, 5:43pm UTC](https://discourse.julialang.org/t/array-cumulation/52287 "2020-12-23T17:43:37Z")

</div>

Hello, I am trying to, quickly, accumulate an array without over-riding previous allocations. In particular consider the following example: B = zeros(2,2); A = \[0.1 0.3; 0.2 0.5\]; idx = \[1 1; 1 1\]; I would like to add…

---

## [Parallel Julia's self computing](https://discourse.julialang.org/t/parallel-julias-self-computing/52282)

<div class="topic-metadata">

**Author:** [@marllos](https://discourse.julialang.org/u/marllos)\
**Replies:** 9\
**Last updated:** [December 23, 2020, 4:32pm UTC](https://discourse.julialang.org/t/parallel-julias-self-computing/52282 "2020-12-23T16:32:28Z")

</div>

When I run a longer Julia code, I notice that the 24 cores of the computer are operating. Is this because Julia is running my code with parallel computing? Thanks.

---

## [CUDA.jl vs. ArrayFire.jl on Windows 10 VM running on VMWare VSphere](https://discourse.julialang.org/t/cuda-jl-vs-arrayfire-jl-on-windows-10-vm-running-on-vmware-vsphere/52078)

<div class="topic-metadata">

**Author:** [@Zhong\_Pan](https://discourse.julialang.org/u/Zhong_Pan)\
**Replies:** 1\
**Last updated:** [December 23, 2020, 4:27pm UTC](https://discourse.julialang.org/t/cuda-jl-vs-arrayfire-jl-on-windows-10-vm-running-on-vmware-vsphere/52078 "2020-12-23T16:27:29Z")

</div>

We need to speed up some double-precision calculations that are mainly just complex array calculations and FFT/IFFT. We were using NVIDIA Geforce RTX 2080 Ti on a PC and the speedup vs CPU is very good but not sufficient…

---

## [Style recommendation for enum as type](https://discourse.julialang.org/t/style-recommendation-for-enum-as-type/46078)

<div class="topic-metadata">

**Author:** [@Mikhail\_Kagalenko](https://discourse.julialang.org/u/Mikhail_Kagalenko)\
**Replies:** 5\
**Last updated:** [December 23, 2020, 2:45pm UTC](https://discourse.julialang.org/t/style-recommendation-for-enum-as-type/46078 "2020-12-23T14:45:28Z")

</div>

Julia documentation states: If a type is effectively an enumeration, it should be defined as a single (ideally immutable struct or primitive) type, with the enumeration values being instances of it. Why? How strong …

---

## [Julia simple String process and file I/O is slow](https://discourse.julialang.org/t/julia-simple-string-process-and-file-i-o-is-slow/52112)

<div class="topic-metadata">

**Author:** [@vedasulo](https://discourse.julialang.org/u/vedasulo)\
**Replies:** 12\
**Last updated:** [December 23, 2020, 2:43pm UTC](https://discourse.julialang.org/t/julia-simple-string-process-and-file-i-o-is-slow/52112 "2020-12-23T14:43:07Z")

</div>

I was doing i/o in julia from string. Code as follows function func(strd) a = Any\[\]; for url in split(replace(strd, "\\n" =\> ""), "✖") if occursin(".",url) push!(a, url); end end …

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

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