# Latest

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

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

**Page:** 892

---

## [Could I change the type of a declared variable?](https://discourse.julialang.org/t/could-i-change-the-type-of-a-declared-variable/88933)

<div class="topic-metadata">

**Author:** [@swish47](https://discourse.julialang.org/u/swish47)\
**Replies:** 3\
**Last updated:** [October 18, 2022, 9:58pm UTC](https://discourse.julialang.org/t/could-i-change-the-type-of-a-declared-variable/88933 "2022-10-18T21:58:03Z")

</div>

It is known that we cannot clear a variable after set them. However is it possible to change a decleared variable? For example: a::Int16=1001; Then what ever we set: a=nothing or a=1.000001 will both receive Inex…

---

## [How to directly specify datatype when reading from excel? Matrix{Any} to Vector{Int64}](https://discourse.julialang.org/t/how-to-directly-specify-datatype-when-reading-from-excel-matrix-any-to-vector-int64/88853)

<div class="topic-metadata">

**Author:** [@Mike\_comen](https://discourse.julialang.org/u/Mike_comen)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 9:51pm UTC](https://discourse.julialang.org/t/how-to-directly-specify-datatype-when-reading-from-excel-matrix-any-to-vector-int64/88853 "2022-10-18T21:51:45Z")

</div>

I’d like to have some coulmns of an excel sheet in Julia in a Vector{Int64} format. However, it gives me Matrix{Any}. My try: xf = XLSX.readxlsx(\`"C:/Data/sales.xlsx"\`) A = xf\["sheet1!A2:A100"\]) A\_vec = vec(A) …

---

## [Iterating over (key, value) with grouped DataFrame](https://discourse.julialang.org/t/iterating-over-key-value-with-grouped-dataframe/27360)

<div class="topic-metadata">

**Author:** [@ElOceanografo](https://discourse.julialang.org/u/ElOceanografo)\
**Replies:** 8\
**Last updated:** [October 18, 2022, 9:36pm UTC](https://discourse.julialang.org/t/iterating-over-key-value-with-grouped-dataframe/27360 "2022-10-18T21:36:14Z")

</div>

Not sure if I’m being dense here, but is there a simple way to iterate over a GroupedDataFrame, having the grouping levels available at each iteration? i.e. something like df = DataFrame(a = \[1,1,2,2\], b = randn(4)) gdf…

---

## [How to fix? ArgumentError: row indices I\[k\] must satisfy 1 \<= I\[k\] \<= m](https://discourse.julialang.org/t/how-to-fix-argumenterror-row-indices-i-k-must-satisfy-1-i-k-m/88931)

<div class="topic-metadata">

**Author:** [@F\_A](https://discourse.julialang.org/u/F_A)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 8:18pm UTC](https://discourse.julialang.org/t/how-to-fix-argumenterror-row-indices-i-k-must-satisfy-1-i-k-m/88931 "2022-10-18T20:18:57Z")

</div>

Hi, I’ve already ask this here. But, perhaps asking here is better. When I try to build a graph from the following arrays of sources, destinations, and weights, the last line returns an error ERROR: ArgumentError: col…

---

## [Question about functors and closures (I think 😅), with an example, but really a general Q](https://discourse.julialang.org/t/question-about-functors-and-closures-i-think-with-an-example-but-really-a-general-q/88758)

<div class="topic-metadata">

**Author:** [@fins](https://discourse.julialang.org/u/fins)\
**Replies:** 27\
**Last updated:** [October 18, 2022, 7:54pm UTC](https://discourse.julialang.org/t/question-about-functors-and-closures-i-think-with-an-example-but-really-a-general-q/88758 "2022-10-18T19:54:48Z")

</div>

Hi, I’ve just been fiddling with some bits of code and am still a bit blown away by some julian’ language-constructs. I’ve been doing oo-programming, mainly, for a considerable timespan & my (purely ever academic) expos…

---

## [Useful Julia script tips? (workaround shebang)](https://discourse.julialang.org/t/useful-julia-script-tips-workaround-shebang/15584)

<div class="topic-metadata">

**Author:** [@tkf](https://discourse.julialang.org/u/tkf)\
**Replies:** 6\
**Last updated:** [October 18, 2022, 2:48pm UTC](https://discourse.julialang.org/t/useful-julia-script-tips-workaround-shebang/15584 "2022-10-18T14:48:30Z")

</div>

I found a useful little hack so I share it here. It may already be discovered elsewhere, but it’s fun to re-discover a nice(?) trick! If you ever tried to write a julia script and put its options in the shebang, you mi…

---

## [Meaning of Base function source code in julia documentation](https://discourse.julialang.org/t/meaning-of-base-function-source-code-in-julia-documentation/88923)

<div class="topic-metadata">

**Author:** [@Christian\_Brunbjerg](https://discourse.julialang.org/u/Christian_Brunbjerg)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 6:45pm UTC](https://discourse.julialang.org/t/meaning-of-base-function-source-code-in-julia-documentation/88923 "2022-10-18T18:45:37Z")

</div>

Hello community! I have been looking at source code for some functions and when looking at certain base functions (like shown in the picture) the function is simply defined as itself. How does this make sense? Where is …

---

## [Floor? Force magnitude amount?](https://discourse.julialang.org/t/floor-force-magnitude-amount/88833)

<div class="topic-metadata">

**Author:** [@theboiwholived](https://discourse.julialang.org/u/theboiwholived)\
**Replies:** 5\
**Last updated:** [October 18, 2022, 6:44pm UTC](https://discourse.julialang.org/t/floor-force-magnitude-amount/88833 "2022-10-18T18:44:17Z")

</div>

Hey all, Newer to julia and working with some very large numbers. Unfort conditioning of the system im using leads to numerical issues with numbers spanning more than 12 orders of magnitude. I’ve been working in bigInt…

---

## [ReactiveMP hierarchical linear regression](https://discourse.julialang.org/t/reactivemp-hierarchical-linear-regression/88112)

<div class="topic-metadata">

**Author:** [@SebastianCallh](https://discourse.julialang.org/u/SebastianCallh)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 4:24pm UTC](https://discourse.julialang.org/t/reactivemp-hierarchical-linear-regression/88112 "2022-10-18T16:24:24Z")

</div>

Hello, I am playing around with ReactiveMP and wanted to try a hierarchical linear regression model. I tried adapting the linear regression example in the docs, but I cannot figure out how to properly index the group l…

---

## [Finding combinations of combinations/permutations](https://discourse.julialang.org/t/finding-combinations-of-combinations-permutations/88870)

<div class="topic-metadata">

**Author:** [@mrbaker](https://discourse.julialang.org/u/mrbaker)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 1:47am UTC](https://discourse.julialang.org/t/finding-combinations-of-combinations-permutations/88870 "2022-10-18T01:47:12Z")

</div>

I’m trying to generate a list of combinations of combinations for an array. First, I’d like to find all pairs that don’t reuse elements (order doesn’t matter), and I’ve been able to get that far: using Combinatorics a…

---

## [Data frame sum of a Time column](https://discourse.julialang.org/t/data-frame-sum-of-a-time-column/88738)

<div class="topic-metadata">

**Author:** [@StuartRL](https://discourse.julialang.org/u/StuartRL)\
**Replies:** 9\
**Last updated:** [October 18, 2022, 3:39pm UTC](https://discourse.julialang.org/t/data-frame-sum-of-a-time-column/88738 "2022-10-18T15:39:21Z")

</div>

Simple (I hope): how to sum the Time column (d) of 15:52:31 + 15:52:31 + 15:52:31 giving 47:34:33

---

## [Type Instability and Union Splitting](https://discourse.julialang.org/t/type-instability-and-union-splitting/88886)

<div class="topic-metadata">

**Author:** [@HashBrown](https://discourse.julialang.org/u/HashBrown)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 3:23pm UTC](https://discourse.julialang.org/t/type-instability-and-union-splitting/88886 "2022-10-18T15:23:23Z")

</div>

So I know the following code is not type stable: foo(x::Int64, y::Float64) = x \< y ? x : y As a human I understand that the return type of this function must be Union{Int64, Float64}. Does the compiler also understan…

---

## [Eigvals faster for ComplexF64 matrices than Float64](https://discourse.julialang.org/t/eigvals-faster-for-complexf64-matrices-than-float64/88846)

<div class="topic-metadata">

**Author:** [@ysh](https://discourse.julialang.org/u/ysh)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 3:15pm UTC](https://discourse.julialang.org/t/eigvals-faster-for-complexf64-matrices-than-float64/88846 "2022-10-18T15:15:06Z")

</div>

I’ve noticed that when diagonalising real symmetric matrices, eigvals may perform faster if the input matrix is complex, i.e. Matrix{ComplexF64} rather than Matrix{Float64}. Here is my test code: using LinearAlgebra, Be…

---

## [How to handle unknown length returns in recursion without allocating](https://discourse.julialang.org/t/how-to-handle-unknown-length-returns-in-recursion-without-allocating/88909)

<div class="topic-metadata">

**Author:** [@jacobusmmsmit](https://discourse.julialang.org/u/jacobusmmsmit)\
**Replies:** 3\
**Last updated:** [October 18, 2022, 1:45pm UTC](https://discourse.julialang.org/t/how-to-handle-unknown-length-returns-in-recursion-without-allocating/88909 "2022-10-18T13:45:35Z")

</div>

I have a recursive function f(x, data) which can return anywhere between 1 and length(x) elements. All I want to be able to do is iterate over the return value of f so the result doesn’t need to be instantiated into a Tu…

---

## [Is there a package to read EXIF data from a jpg image?](https://discourse.julialang.org/t/is-there-a-package-to-read-exif-data-from-a-jpg-image/35297)

<div class="topic-metadata">

**Author:** [@michael-prange](https://discourse.julialang.org/u/michael-prange)\
**Replies:** 13\
**Last updated:** [October 18, 2022, 2:43pm UTC](https://discourse.julialang.org/t/is-there-a-package-to-read-exif-data-from-a-jpg-image/35297 "2022-10-18T14:43:41Z")

</div>

I’m looking for a package to read EXIF data from a jpg image. I had hoped that ImageMetadata would do that, but but when I load a jpg image, all the metadata is gone, e.g., img=load(“/Users/prange/Downloads/TKNE8480.JPG…

---

## [Jua.ai weather forcast jobs](https://discourse.julialang.org/t/jua-ai-weather-forcast-jobs/88914)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 2:29pm UTC](https://discourse.julialang.org/t/jua-ai-weather-forcast-jobs/88914 "2022-10-18T14:29:44Z")

</div>

I don’t work for Jua.ai (is it ok to post for others, even if not primarily a Julia job ad? Julia might be their main language for all I know, or will be…), I just found their work and the job ad intriguing: https://car…

---

## [Questions about parallel computing](https://discourse.julialang.org/t/questions-about-parallel-computing/88888)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 1:24pm UTC](https://discourse.julialang.org/t/questions-about-parallel-computing/88888 "2022-10-18T13:24:45Z")

</div>

I want to calculate human chromosomes’s something, and then using each chromosomes for parallel computing, and finally write it into a csv file, but when I use the Threads.@threads macro, I get an error, and if I don’t a…

---

## [Preventing ticks from appearing outside of a plot](https://discourse.julialang.org/t/preventing-ticks-from-appearing-outside-of-a-plot/88907)

<div class="topic-metadata">

**Author:** [@Spynel](https://discourse.julialang.org/u/Spynel)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 12:42pm UTC](https://discourse.julialang.org/t/preventing-ticks-from-appearing-outside-of-a-plot/88907 "2022-10-18T12:42:01Z")

</div>

Hello ! I am working on a code that’s supposed to display a plot with dates on the X axis. That part works, but when moving the plot left and right, the ticks on the x axis stay displayed even when they’re outside of th…

---

## [Help with solving 2nd order PDE](https://discourse.julialang.org/t/help-with-solving-2nd-order-pde/87506)

<div class="topic-metadata">

**Author:** [@David\_F](https://discourse.julialang.org/u/David_F)\
**Replies:** 12\
**Last updated:** [October 18, 2022, 12:39pm UTC](https://discourse.julialang.org/t/help-with-solving-2nd-order-pde/87506 "2022-10-18T12:39:50Z")

</div>

Dear community, This is my first attempt with Julia, so naturally I already face several problems, but I’m very excited to learn something new! Basically, I’m trying to solve a 2nd order PDE, namely an extended Rayleig…

---

## [Fast check if a character "is" an integer](https://discourse.julialang.org/t/fast-check-if-a-character-is-an-integer/88750)

<div class="topic-metadata">

**Author:** [@lmiq](https://discourse.julialang.org/u/lmiq)\
**Replies:** 23\
**Last updated:** [October 18, 2022, 12:28pm UTC](https://discourse.julialang.org/t/fast-check-if-a-character-is-an-integer/88750 "2022-10-18T12:28:38Z")

</div>

I need to check if the first character of a string is an integer, quickly. I’m doing a try-catch: julia\> function c(name) i0 = try parse(Int, name\[1\]) true catch …

---

## [Docker + Base.runtests("Sockets")](https://discourse.julialang.org/t/docker-base-runtests-sockets/19435)

<div class="topic-metadata">

**Author:** [@ImreSamu](https://discourse.julialang.org/u/ImreSamu)\
**Replies:** 5\
**Last updated:** [October 18, 2022, 12:13pm UTC](https://discourse.julialang.org/t/docker-base-runtests-sockets/19435 "2022-10-18T12:13:32Z")

</div>

How can I run Julia “Sockets” test inside docker environments? I tried & finished with errors :frowning: docker run -it --rm julia:1.0.3 julia -e 'Base.runtests("Sockets")' docker run --privileged -…

---

## [How to make changes/develop a package in the StdLib?](https://discourse.julialang.org/t/how-to-make-changes-develop-a-package-in-the-stdlib/88906)

<div class="topic-metadata">

**Author:** [@habemus-papadum](https://discourse.julialang.org/u/habemus-papadum)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 11:58am UTC](https://discourse.julialang.org/t/how-to-make-changes-develop-a-package-in-the-stdlib/88906 "2022-10-18T11:58:17Z")

</div>

Hello, I want to add function to Downloads.jl (to allow overriding the default Downloader). Downloads.jl is in the stdlib/default sysimage, and I am not sure what the best development flow is for making changes and test…

---

## [Implicit Nonlinear Dynamics example in DataDrivenDiffEq doesn't work](https://discourse.julialang.org/t/implicit-nonlinear-dynamics-example-in-datadrivendiffeq-doesnt-work/88901)

<div class="topic-metadata">

**Author:** [@CurioMath](https://discourse.julialang.org/u/CurioMath)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 11:36am UTC](https://discourse.julialang.org/t/implicit-nonlinear-dynamics-example-in-datadrivendiffeq-doesnt-work/88901 "2022-10-18T11:36:00Z")

</div>

Hi, I have a DAE system which when structurally simplified gives an ODE system with 7 Differential Equations and 21 parameters. I would like to recover this system from the simulated data. I tried DataDrivenDiffEq for t…

---

## [Performance problem on dual socket Xeon under Windows 11](https://discourse.julialang.org/t/performance-problem-on-dual-socket-xeon-under-windows-11/88772)

<div class="topic-metadata">

**Author:** [@fdekerme](https://discourse.julialang.org/u/fdekerme)\
**Replies:** 6\
**Last updated:** [October 18, 2022, 6:51am UTC](https://discourse.julialang.org/t/performance-problem-on-dual-socket-xeon-under-windows-11/88772 "2022-10-18T06:51:05Z")

</div>

Hello, I have a question about parallelization in Julia. I am working on a Dell dual socket Xeon 5220r workstation ( 2x24 cores, 2x48 threads) running Windows 11. I was initially on Windows 10, but as this old post ( @…

---

## [Error with HTTP get requests](https://discourse.julialang.org/t/error-with-http-get-requests/88645)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 6\
**Last updated:** [October 18, 2022, 6:14am UTC](https://discourse.julialang.org/t/error-with-http-get-requests/88645 "2022-10-18T06:14:22Z")

</div>

Hello all I have this error when using HTTP GET to retrieve data from a webservice. I have a properly formatted url and if I pass this url to curl like this, I can retrieve data correctly r = read(\`curl -s -k $url\`, S…

---

## [Maximize sum of the piecewise function](https://discourse.julialang.org/t/maximize-sum-of-the-piecewise-function/88882)

<div class="topic-metadata">

**Author:** [@t.sh](https://discourse.julialang.org/u/t.sh)\
**Replies:** 2\
**Last updated:** [October 18, 2022, 5:00am UTC](https://discourse.julialang.org/t/maximize-sum-of-the-piecewise-function/88882 "2022-10-18T05:00:03Z")

</div>

I am the new in JuMP package, and I am trying to solve the optimization with a piecewise function My maximum working example looks as follows: using JuMP, Ipopt function sum\_rate(β::T ...) where {T \<: Real} rate =…

---

## [Non-convex loss functions with Flux.jl](https://discourse.julialang.org/t/non-convex-loss-functions-with-flux-jl/88273)

<div class="topic-metadata">

**Author:** [@MattSainsbury-Dale](https://discourse.julialang.org/u/MattSainsbury-Dale)\
**Replies:** 4\
**Last updated:** [October 18, 2022, 3:19am UTC](https://discourse.julialang.org/t/non-convex-loss-functions-with-flux-jl/88273 "2022-10-18T03:19:49Z")

</div>

I am interested in training a Flux neural network under a non-convex loss function. Specifically, the loss function L\_P(x, y) = (|x - y|)^P for some 0 \< P \< 1, which is implemented in LossFunctions.jl as LPDistLoss. Is…

---

## [Speed up Array computation](https://discourse.julialang.org/t/speed-up-array-computation/88875)

<div class="topic-metadata">

**Author:** [@ahmed](https://discourse.julialang.org/u/ahmed)\
**Replies:** 4\
**Last updated:** [October 17, 2022, 10:39pm UTC](https://discourse.julialang.org/t/speed-up-array-computation/88875 "2022-10-17T22:39:20Z")

</div>

I have an array of matrices whose columns are used as vectors to do the following calculation in the function E\_int nb=6; #number of columns dim=120; #number of rows np=400; #number of matrices in the array function H0(…

---

## [Sharing variables between Notebook and REPL in Visual Studio or JupyterLab](https://discourse.julialang.org/t/sharing-variables-between-notebook-and-repl-in-visual-studio-or-jupyterlab/88797)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 2\
**Last updated:** [October 17, 2022, 10:04pm UTC](https://discourse.julialang.org/t/sharing-variables-between-notebook-and-repl-in-visual-studio-or-jupyterlab/88797 "2022-10-17T22:04:39Z")

</div>

Is it possible to share variables (or Julia instance) between a Jupyter-style notebook and a REPL, either in Visual Studio or JupyterLab? Thanks for any help.

---

## [Disabling DomainError (in sqrt())?](https://discourse.julialang.org/t/disabling-domainerror-in-sqrt/88755)

<div class="topic-metadata">

**Author:** [@bremez](https://discourse.julialang.org/u/bremez)\
**Replies:** 21\
**Last updated:** [October 17, 2022, 9:20pm UTC](https://discourse.julialang.org/t/disabling-domainerror-in-sqrt/88755 "2022-10-17T21:20:30Z")

</div>

Is there any way one can remove the negative number check for sqrt(Float64)? Neither @inbounds or @fastmath seems to do the trick (by checking the generated @code\_native). However, it seems that, say, LinearAlgebra.norm(…

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

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