# Latest

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

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

**Page:** 1147

---

## [Using @code\_warntype to inspect my module functions](https://discourse.julialang.org/t/using-code-warntype-to-inspect-my-module-functions/74901)

<div class="topic-metadata">

**Author:** [@TI36XPro](https://discourse.julialang.org/u/TI36XPro)\
**Replies:** 3\
**Last updated:** [January 21, 2022, 1:13am UTC](https://discourse.julialang.org/t/using-code-warntype-to-inspect-my-module-functions/74901 "2022-01-21T01:13:09Z")

</div>

Hello! I am wondering what or how is the best way to use @code\_warntype to inspect my code for type instabilities. To give you some context, I am working in a script file (.jl) and doing using MyCustomModule at the top …

---

## [Why UTC is U.T.C.](https://discourse.julialang.org/t/why-utc-is-u-t-c/74916)

<div class="topic-metadata">

**Author:** [@sylvaticus](https://discourse.julialang.org/u/sylvaticus)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 11:03pm UTC](https://discourse.julialang.org/t/why-utc-is-u-t-c/74916 "2022-01-20T23:03:45Z")

</div>

"Why is UTC used as the acronym for Coordinated Universal Time instead of CUT? In 1970, the Coordinated Universal Time system was devised by an international advisory group of technical experts within the International…

---

## [Redirect stdout and stderr?](https://discourse.julialang.org/t/redirect-stdout-and-stderr/13424)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 5\
**Last updated:** [January 20, 2022, 10:17pm UTC](https://discourse.julialang.org/t/redirect-stdout-and-stderr/13424 "2022-01-20T22:17:48Z")

</div>

I want to do a computation with stdout and stderr both redirected to files. Here is what I wrote: open(prefix \* ".log", "w") do out open(prefix \* ".err", "w") do err redirect\_stdout(out) do redir…

---

## [Hessian with user-defined functions in MathOptNLSModel](https://discourse.julialang.org/t/hessian-with-user-defined-functions-in-mathoptnlsmodel/74672)

<div class="topic-metadata">

**Author:** [@DanielVandH](https://discourse.julialang.org/u/DanielVandH)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 10:04pm UTC](https://discourse.julialang.org/t/hessian-with-user-defined-functions-in-mathoptnlsmodel/74672 "2022-01-20T22:04:04Z")

</div>

I am trying to use user-defined functions with the MathOptNLSModel for solving nonlinear least squares problems. I use: using JuMP using NLPModelsJuMP using JSOSolvers model = Mod…

---

## [Weighted histogram ~2x as slow in Julia vs. Python](https://discourse.julialang.org/t/weighted-histogram-2x-as-slow-in-julia-vs-python/74953)

<div class="topic-metadata">

**Author:** [@kirklong](https://discourse.julialang.org/u/kirklong)\
**Replies:** 13\
**Last updated:** [January 20, 2022, 9:36pm UTC](https://discourse.julialang.org/t/weighted-histogram-2x-as-slow-in-julia-vs-python/74953 "2022-01-20T21:36:35Z")

</div>

I’m working on a project where I need to compute the weighted histogram of something many times. Basically I need the sum of each of the bins of the histogram, and I’ve been using PyCall to call the SciPy “binned statist…

---

## [Pkg.instantiate() after activating project?](https://discourse.julialang.org/t/pkg-instantiate-after-activating-project/36603)

<div class="topic-metadata">

**Author:** [@hendri54](https://discourse.julialang.org/u/hendri54)\
**Replies:** 6\
**Last updated:** [January 20, 2022, 8:53pm UTC](https://discourse.julialang.org/t/pkg-instantiate-after-activating-project/36603 "2022-01-20T20:53:12Z")

</div>

I run code on a cluster (using slurm). The sbatch file starts Julia in the package directory. For example: julia --project="." --startup-file=no "longleaf/run\_simple.jl" Occasionally, the jobs crash with errors complai…

---

## [Convolutional GRU/LSTM in Flux?](https://discourse.julialang.org/t/convolutional-gru-lstm-in-flux/74770)

<div class="topic-metadata">

**Author:** [@johnbb](https://discourse.julialang.org/u/johnbb)\
**Replies:** 4\
**Last updated:** [January 20, 2022, 8:46pm UTC](https://discourse.julialang.org/t/convolutional-gru-lstm-in-flux/74770 "2022-01-20T20:46:21Z")

</div>

Is there any implementation of (2D) convolutional GRU, LSTM or similar based on Flux? A similar question was raised in Sept. 2020.

---

## [Fitting Mixed Effects Models - Python, Julia or R?](https://discourse.julialang.org/t/fitting-mixed-effects-models-python-julia-or-r/74955)

<div class="topic-metadata">

**Author:** [@dm13450](https://discourse.julialang.org/u/dm13450)\
**Replies:** 0\
**Last updated:** [January 20, 2022, 8:13pm UTC](https://discourse.julialang.org/t/fitting-mixed-effects-models-python-julia-or-r/74955 "2022-01-20T20:13:36Z")

</div>

I’ve written a blog post bench-marking Julia, Python and R when fitting a mixed effects model. Julia comes out top (by quite a bit!), so if you ever need to convince someone, hopefully this will help!

---

## [\[ANN\] HelloJulia.jl: Some resources for that "Intro to Julia" workshop you are planning](https://discourse.julialang.org/t/ann-hellojulia-jl-some-resources-for-that-intro-to-julia-workshop-you-are-planning/74322)

<div class="topic-metadata">

**Author:** [@ablaom](https://discourse.julialang.org/u/ablaom)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 8:00pm UTC](https://discourse.julialang.org/t/ann-hellojulia-jl-some-resources-for-that-intro-to-julia-workshop-you-are-planning/74322 "2022-01-20T20:00:35Z")

</div>

The HelloJulia.jl repo (which is also an unregistered package) collects some resources I included in 1 hour workshop introducing julia to (mostly) university researchers. I make no guarantees about it’s quality or corre…

---

## [Makie RGFf0 Undefeined VariableError](https://discourse.julialang.org/t/makie-rgff0-undefeined-variableerror/74882)

<div class="topic-metadata">

**Author:** [@rajmac](https://discourse.julialang.org/u/rajmac)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 7:50pm UTC](https://discourse.julialang.org/t/makie-rgff0-undefeined-variableerror/74882 "2022-01-20T19:50:39Z")

</div>

I am new to JUlia and have been working my way in with different tutorials. So far I have been able to find sources for most of my problems. However using GLMakie to draw figures I have had difficulty in using a color =(…

---

## [Need some help with FluxOpt](https://discourse.julialang.org/t/need-some-help-with-fluxopt/74904)

<div class="topic-metadata">

**Author:** [@stochastic\_guy](https://discourse.julialang.org/u/stochastic_guy)\
**Replies:** 1\
**Last updated:** [January 20, 2022, 6:59pm UTC](https://discourse.julialang.org/t/need-some-help-with-fluxopt/74904 "2022-01-20T18:59:36Z")

</div>

I am trying to use the FluxOptTools (https://github.com/baggepinnen/FluxOptTools.jl) to train a Flux model using Optim . I followed the example provided in the readme. It is working as intended. But when I slightly chang…

---

## [Package set-up not propagating to workers with Distributed](https://discourse.julialang.org/t/package-set-up-not-propagating-to-workers-with-distributed/74952)

<div class="topic-metadata">

**Author:** [@danielsoutar](https://discourse.julialang.org/u/danielsoutar)\
**Replies:** 0\
**Last updated:** [January 20, 2022, 6:09pm UTC](https://discourse.julialang.org/t/package-set-up-not-propagating-to-workers-with-distributed/74952 "2022-01-20T18:09:03Z")

</div>

Info: $ julia --version julia version 1.6.0 $ lscpu ~/root/MyPackage$ lscpu Architecture: x86\_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address …

---

## [For Loop why does not working correctly](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938)

<div class="topic-metadata">

**Author:** [@vlkan](https://discourse.julialang.org/u/vlkan)\
**Replies:** 4\
**Last updated:** [January 20, 2022, 6:04pm UTC](https://discourse.julialang.org/t/for-loop-why-does-not-working-correctly/74938 "2022-01-20T18:04:27Z")

</div>

Hello everyone, I encountered a strange error while making an example for a for loop. It works correctly on the video, document and online compiler on the Internet, but on my computer it generates random numbers. What is…

---

## [Multithreading for nested loops](https://discourse.julialang.org/t/multithreading-for-nested-loops/36002)

<div class="topic-metadata">

**Author:** [@henry2004y](https://discourse.julialang.org/u/henry2004y)\
**Replies:** 42\
**Last updated:** [January 20, 2022, 6:00pm UTC](https://discourse.julialang.org/t/multithreading-for-nested-loops/36002 "2022-01-20T18:00:37Z")

</div>

Hi, I am wondering how to apply multi-threading to nested for loops. For the function nestedloop below, I guess the threads will only be launched for the outermost k loop for OMP\_JULIA\_THREADS times: function nestedlo…

---

## [Adding a new (yet to be installed) package does not seem to download the package](https://discourse.julialang.org/t/adding-a-new-yet-to-be-installed-package-does-not-seem-to-download-the-package/74894)

<div class="topic-metadata">

**Author:** [@apg](https://discourse.julialang.org/u/apg)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 5:53pm UTC](https://discourse.julialang.org/t/adding-a-new-yet-to-be-installed-package-does-not-seem-to-download-the-package/74894 "2022-01-20T17:53:17Z")

</div>

I was trying to add a new package (custom package) “P” of version 2.0, which is the latest version of the package “P” to my project environment and run into some weird issue (Julia v 1.6, macosx 11.6). The package “P” wi…

---

## [PkgTemplates. Errors after creating and deleting the package](https://discourse.julialang.org/t/pkgtemplates-errors-after-creating-and-deleting-the-package/74943)

<div class="topic-metadata">

**Author:** [@pjgorski](https://discourse.julialang.org/u/pjgorski)\
**Replies:** 1\
**Last updated:** [January 20, 2022, 5:52pm UTC](https://discourse.julialang.org/t/pkgtemplates-errors-after-creating-and-deleting-the-package/74943 "2022-01-20T17:52:35Z")

</div>

I have done the following things: I created a test package using PkgTemplates, then I deleted it, and then I wanted to create another test package and I ran into an error. ERROR: expected package Test \[caf985be\]to exi…

---

## [How to find where constants are defined](https://discourse.julialang.org/t/how-to-find-where-constants-are-defined/74936)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 6\
**Last updated:** [January 20, 2022, 4:43pm UTC](https://discourse.julialang.org/t/how-to-find-where-constants-are-defined/74936 "2022-01-20T16:43:38Z")

</div>

Is there a way to reveal the file where constants are defined? For example, we have π = 3.1415926535897..., but which file defines this constant? I am looking for something like @less for functions.

---

## [Details about allocation](https://discourse.julialang.org/t/details-about-allocation/74891)

<div class="topic-metadata">

**Author:** [@jzr](https://discourse.julialang.org/u/jzr)\
**Replies:** 4\
**Last updated:** [January 20, 2022, 3:02pm UTC](https://discourse.julialang.org/t/details-about-allocation/74891 "2022-01-20T15:02:09Z")

</div>

There is an informative post about how Julia’s garbage collection works. How does Julia 1.7’s memory allocation work?

---

## [Pmap extremely slow when function returns large object](https://discourse.julialang.org/t/pmap-extremely-slow-when-function-returns-large-object/74937)

<div class="topic-metadata">

**Author:** [@user\_231578](https://discourse.julialang.org/u/user_231578)\
**Replies:** 4\
**Last updated:** [January 20, 2022, 2:20pm UTC](https://discourse.julialang.org/t/pmap-extremely-slow-when-function-returns-large-object/74937 "2022-01-20T14:20:18Z")

</div>

I would like to parallelize a function but returning large objects makes pmap extremely slow. using Distributed using SharedArrays addprocs(length(Sys.cpu\_info())-1) @everywhere using Random @everywhere function foo(i…

---

## [Passing kwargs... can overwrite other keyword arguments](https://discourse.julialang.org/t/passing-kwargs-can-overwrite-other-keyword-arguments/74933)

<div class="topic-metadata">

**Author:** [@albheim](https://discourse.julialang.org/u/albheim)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 2:13pm UTC](https://discourse.julialang.org/t/passing-kwargs-can-overwrite-other-keyword-arguments/74933 "2022-01-20T14:13:12Z")

</div>

I recently got bitten by some behavior that was not immediately obvious to me (combined with a little sloppy coding from my side). In my case I had a function passing on some kwargs from higher up, as well as adding som…

---

## [Symbolics.jl: bug in unique() involving negative Floats?](https://discourse.julialang.org/t/symbolics-jl-bug-in-unique-involving-negative-floats/74925)

<div class="topic-metadata">

**Author:** [@jhbdiehl](https://discourse.julialang.org/u/jhbdiehl)\
**Replies:** 1\
**Last updated:** [January 20, 2022, 1:42pm UTC](https://discourse.julialang.org/t/symbolics-jl-bug-in-unique-involving-negative-floats/74925 "2022-01-20T13:42:47Z")

</div>

Hello there! I encountered the weirdest behavior of the unique() function when throwing symbols at it: using Symbolics @variables a b unique(\[-(a+1), -1.0(a+1)\]) # 1-element Vector{Num}: -1 - a unique(\[-a-b, -1(a+b)\]…

---

## [How to know the size of the mutated array in f!(F, x)?](https://discourse.julialang.org/t/how-to-know-the-size-of-the-mutated-array-in-f-f-x/74789)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 16\
**Last updated:** [January 20, 2022, 1:24pm UTC](https://discourse.julialang.org/t/how-to-know-the-size-of-the-mutated-array-in-f-f-x/74789 "2022-01-20T13:24:01Z")

</div>

Is there a way to know the size of F in function f!(F, x) F\[1\] = (x\[1\] + 3) \* (x\[2\]^3 - 7) + 18 F\[2\] = sin(x\[2\] \* exp(x\[1\]) - 1) F\[3\] = x\[1\] + x\[2\] return F end without knowing F in advance? My is to p…

---

## [CUDA global synchronization HOWTO](https://discourse.julialang.org/t/cuda-global-synchronization-howto/74920)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 9\
**Last updated:** [January 20, 2022, 12:52pm UTC](https://discourse.julialang.org/t/cuda-global-synchronization-howto/74920 "2022-01-20T12:52:47Z")

</div>

Dear Julianners, I try to create an algorithm that runs an elementwise update operation and a reduction in 10k iteration and about 1\_000\_000 times, so the kernel restarts(2-8us) are really expensive in this scenario. T…

---

## [GLMakie in VSCode on hybrid graphics laptop](https://discourse.julialang.org/t/glmakie-in-vscode-on-hybrid-graphics-laptop/74885)

<div class="topic-metadata">

**Author:** [@Sleort](https://discourse.julialang.org/u/Sleort)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 12:49pm UTC](https://discourse.julialang.org/t/glmakie-in-vscode-on-hybrid-graphics-laptop/74885 "2022-01-20T12:49:58Z")

</div>

My laptop runs Ubuntu 20.04. It has a discrete Nvidia GeForce GTX 1650 Ti GPU, which is set to be used on demand (“hybrid graphics”) following Graphics Switching (Ubuntu) - System76 Support . In an ordinary terminal, in …

---

## [How to change error bars color without changing the markerstrokecolor](https://discourse.julialang.org/t/how-to-change-error-bars-color-without-changing-the-markerstrokecolor/74868)

<div class="topic-metadata">

**Author:** [@user\_231578](https://discourse.julialang.org/u/user_231578)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 12:37pm UTC](https://discourse.julialang.org/t/how-to-change-error-bars-color-without-changing-the-markerstrokecolor/74868 "2022-01-20T12:37:03Z")

</div>

I would like to change the error bars colors to match the graph colors without changing the markerstrokecolor. If I set markerstrokecolor=:auto, also the markers’ border change. I would like the latter to remain black. W…

---

## [Arch D. Robison high performance Julia workshop from 2016 in 2022](https://discourse.julialang.org/t/arch-d-robison-high-performance-julia-workshop-from-2016-in-2022/74932)

<div class="topic-metadata">

**Author:** [@KZiemian](https://discourse.julialang.org/u/KZiemian)\
**Replies:** 0\
**Last updated:** [January 20, 2022, 12:13pm UTC](https://discourse.julialang.org/t/arch-d-robison-high-performance-julia-workshop-from-2016-in-2022/74932 "2022-01-20T12:13:07Z")

</div>

Arch D. Robison workshop Introduction to Writing High Performance Julia presented at JuliaCon 2016 thought me so many things and I believe that many Julia users still can learn valuable lessons from it. At the same time,…

---

## [Using Distributed Computing with AWS Batch/ AWS EC2](https://discourse.julialang.org/t/using-distributed-computing-with-aws-batch-aws-ec2/51815)

<div class="topic-metadata">

**Author:** [@bmalham](https://discourse.julialang.org/u/bmalham)\
**Replies:** 3\
**Last updated:** [December 14, 2020, 10:29pm UTC](https://discourse.julialang.org/t/using-distributed-computing-with-aws-batch-aws-ec2/51815 "2020-12-14T22:29:50Z")

</div>

I am currently having issues using parallel processing using Julia’s Distributed library on an EC2 instance. My script attempts to speed up a series of sequential actions by putting some parts in parallel using the remot…

---

## [Position of type definition in struct with default values](https://discourse.julialang.org/t/position-of-type-definition-in-struct-with-default-values/74909)

<div class="topic-metadata">

**Author:** [@unis](https://discourse.julialang.org/u/unis)\
**Replies:** 2\
**Last updated:** [January 20, 2022, 8:46am UTC](https://discourse.julialang.org/t/position-of-type-definition-in-struct-with-default-values/74909 "2022-01-20T08:46:50Z")

</div>

I’d like to define a struct containing field variables with default values. Am I right in assuming there is no difference between import Parameters: @with\_kw @with\_kw struct S d::Dict{Int,Int} = Dict() end and …

---

## [Out of GPU memory with user defined function](https://discourse.julialang.org/t/out-of-gpu-memory-with-user-defined-function/74914)

<div class="topic-metadata">

**Author:** [@kadir-gunel](https://discourse.julialang.org/u/kadir-gunel)\
**Replies:** 1\
**Last updated:** [January 20, 2022, 8:40am UTC](https://discourse.julialang.org/t/out-of-gpu-memory-with-user-defined-function/74914 "2022-01-20T08:40:00Z")

</div>

Hello, I am getting out of memory error with CUDA while trying to multiply 2 matrices of size (300x40k) inside a user defined function. I understand that X and Y variables are copied hence the memory is insufficient …

---

## [Length of Dict is not thread safe](https://discourse.julialang.org/t/length-of-dict-is-not-thread-safe/74906)

<div class="topic-metadata">

**Author:** [@Jason89757](https://discourse.julialang.org/u/Jason89757)\
**Replies:** 5\
**Last updated:** [January 20, 2022, 8:08am UTC](https://discourse.julialang.org/t/length-of-dict-is-not-thread-safe/74906 "2022-01-20T08:08:43Z")

</div>

I’m trying to write something providing mysql-like functions: insert one row then return id. d = Dict{Int64,Int64}() Threads.@threads for i in 1:10000 if !haskey(d,i) d\[i\] = length(d)+1 end end julia\> length(d)…

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

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