# Latest

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

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

**Page:** 806

---

## [How do I find the number of bits a number needs for storage](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bits-a-number-needs-for-storage/93334)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 5\
**Last updated:** [January 21, 2023, 11:40pm UTC](https://discourse.julialang.org/t/how-do-i-find-the-number-of-bits-a-number-needs-for-storage/93334 "2023-01-21T23:40:41Z")

</div>

I was looking into compression algorithms and storage schemes (like Simple-8b and xor-based compression ) and one thing they do is determine the highest set bit for a given number. I wrote some code, but I feel this ca…

---

## [\[ANN\] PanelShift.jl: Time-aware lags and leads in panel data](https://discourse.julialang.org/t/ann-panelshift-jl-time-aware-lags-and-leads-in-panel-data/93344)

<div class="topic-metadata">

**Author:** [@RangeFu](https://discourse.julialang.org/u/RangeFu)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 11:24pm UTC](https://discourse.julialang.org/t/ann-panelshift-jl-time-aware-lags-and-leads-in-panel-data/93344 "2023-01-21T23:24:50Z")

</div>

This is a little package that performs lags and leads with respect to a time vector. Gaps in the time vector are respected. This is a particularly common operation when dealing with unbalanced panel data with irregular…

---

## [Define\_editor not found](https://discourse.julialang.org/t/define-editor-not-found/93323)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 9:40pm UTC](https://discourse.julialang.org/t/define-editor-not-found/93323 "2023-01-21T21:40:41Z")

</div>

According to the Julia documentation, define\_editor should be available by default. On my mac, Julia 1.8.3, edit is found, while define\_editor is not. As a result, I cannot use the @edit macro. Any insight is appreciated…

---

## [PyMNE for julia](https://discourse.julialang.org/t/pymne-for-julia/93315)

<div class="topic-metadata">

**Author:** [@skaarup91](https://discourse.julialang.org/u/skaarup91)\
**Replies:** 3\
**Last updated:** [January 21, 2023, 9:17pm UTC](https://discourse.julialang.org/t/pymne-for-julia/93315 "2023-01-21T21:17:31Z")

</div>

Hi. I am trying to import raw EEG data in the .cnt format to julia. I have downloaded PyMNE (the Python MNE package for julia) and I am trying with the PyMNE.io.read\_raw\_cnt function. I run: PyMNE.io.read\_raw\_cnt(“C:\\Us…

---

## [How to modify this Keras example to plot predictions on the same figure and for a longer period?](https://discourse.julialang.org/t/how-to-modify-this-keras-example-to-plot-predictions-on-the-same-figure-and-for-a-longer-period/93339)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 9:00pm UTC](https://discourse.julialang.org/t/how-to-modify-this-keras-example-to-plot-predictions-on-the-same-figure-and-for-a-longer-period/93339 "2023-01-21T21:00:58Z")

</div>

Hello. I know this is a forum about Julia but I have a question related with Python and I couldn’t get an answer on other places, and you have always been very helpful and nice. I’m new to Python and Keras. I’ve been …

---

## [Trust-region constrained optimization](https://discourse.julialang.org/t/trust-region-constrained-optimization/93077)

<div class="topic-metadata">

**Author:** [@shce](https://discourse.julialang.org/u/shce)\
**Replies:** 32\
**Last updated:** [January 21, 2023, 8:14pm UTC](https://discourse.julialang.org/t/trust-region-constrained-optimization/93077 "2023-01-21T20:14:33Z")

</div>

Hello, I was wondering if there exists a Julia package that implements a trust-region constrained optimization method. The packages I have seen so far are for unconstrained or bound-constrained problems. I am looking fo…

---

## [Minor julia upgrade -\> VSCode failures](https://discourse.julialang.org/t/minor-julia-upgrade-vscode-failures/93331)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 8:04pm UTC](https://discourse.julialang.org/t/minor-julia-upgrade-vscode-failures/93331 "2023-01-21T20:04:37Z")

</div>

I recently upgraded from julia 1.8.2 to 1.8.5 on Windows 10. I first uninstalled 1.8.2, and updated my PATH when installing 1.8.5. The julia extension in VSCode is configured to use the default julia, i.e., no special p…

---

## [Should @FastPow not make this faster?](https://discourse.julialang.org/t/should-fastpow-not-make-this-faster/93296)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 7\
**Last updated:** [January 21, 2023, 6:25pm UTC](https://discourse.julialang.org/t/should-fastpow-not-make-this-faster/93296 "2023-01-21T18:25:08Z")

</div>

Hello everyone! Suppose I have a set of parameters as: ρ₀ = 1000; c₀ = 20; γ = 7; ρ = ρ₀ .+ ρ₀\*rand(10^6)\*0.1; And I wish to evaluate the function: function Pressure(ρ,c₀,γ,ρ₀) return ((c₀^2\*ρ₀)/γ) \* ((ρ/ρ₀)^γ - …

---

## [Strange behavior of saveat with save\_start=false](https://discourse.julialang.org/t/strange-behavior-of-saveat-with-save-start-false/93294)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 4:41pm UTC](https://discourse.julialang.org/t/strange-behavior-of-saveat-with-save-start-false/93294 "2023-01-21T16:41:15Z")

</div>

I am getting strange behavior with the different versions of save\_at and save\_start and save\_end. Here is a MWE: using DifferentialEquations function exponen!(du, u, param, t) du\[1\] = -u\[1\] end tspan = (0., 3.) prob …

---

## [Julia wrapper for SU2 (The Open-Source CFD Code) (Stanford University Unstructured)](https://discourse.julialang.org/t/julia-wrapper-for-su2-the-open-source-cfd-code-stanford-university-unstructured/93318)

<div class="topic-metadata">

**Author:** [@Mr.Benz](https://discourse.julialang.org/u/Mr.Benz)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 3:40pm UTC](https://discourse.julialang.org/t/julia-wrapper-for-su2-the-open-source-cfd-code-stanford-university-unstructured/93318 "2023-01-21T15:40:20Z")

</div>

Python wrapper is available for SU2 (The Open-Source CFD Code). Please provide Julia wrapper for SU2. SU2 is a suite of open-source software tools written in C++ for the numerical solution of partial differential equat…

---

## [\[ANN\] BitPermutations.jl: efficient routines for repeated bit permutations](https://discourse.julialang.org/t/ann-bitpermutations-jl-efficient-routines-for-repeated-bit-permutations/93312)

<div class="topic-metadata">

**Author:** [@giacomogiudice](https://discourse.julialang.org/u/giacomogiudice)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 1:29pm UTC](https://discourse.julialang.org/t/ann-bitpermutations-jl-efficient-routines-for-repeated-bit-permutations/93312 "2023-01-21T13:29:45Z")

</div>

I am happy to announce BitPermutations.jl, a package to efficiently permute the bits in some bitstring, given an arbitrary permutation. Given a permutation over n bits, we can actually reshuffle bitstring in O(log n) ti…

---

## [Module scoping and macro expansion](https://discourse.julialang.org/t/module-scoping-and-macro-expansion/92914)

<div class="topic-metadata">

**Author:** [@veddox](https://discourse.julialang.org/u/veddox)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 11:10am UTC](https://discourse.julialang.org/t/module-scoping-and-macro-expansion/92914 "2023-01-21T11:10:56Z")

</div>

So I’ve been getting really confused with the interaction between nested macro expansion and module scoping… In my module MyModel I have a set of macros with which I implement a simple DSL. Things work fine in this simp…

---

## [Julia doesn't work in colab](https://discourse.julialang.org/t/julia-doesnt-work-in-colab/93295)

<div class="topic-metadata">

**Author:** [@saba](https://discourse.julialang.org/u/saba)\
**Replies:** 1\
**Last updated:** [January 21, 2023, 10:57am UTC](https://discourse.julialang.org/t/julia-doesnt-work-in-colab/93295 "2023-01-21T10:57:17Z")

</div>

I usually use this notebook to use julia on google colab. But I can’t use it recently. It doesn’t install julia on colab. I actually have tried other notebooks too but I still can’t use them.

---

## [Possible issue with struct outside constructor returning different type](https://discourse.julialang.org/t/possible-issue-with-struct-outside-constructor-returning-different-type/93305)

<div class="topic-metadata">

**Author:** [@harsh\_kumar](https://discourse.julialang.org/u/harsh_kumar)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 10:49am UTC](https://discourse.julialang.org/t/possible-issue-with-struct-outside-constructor-returning-different-type/93305 "2023-01-21T10:49:38Z")

</div>

My initial objective was to create parametric function with struct i.e., function that allow calling like f{T}(x) but julia doesn’t allow parametric function without struct. I want this syntax compare to f(x, ::Type{T}) …

---

## [Syntax Surprises](https://discourse.julialang.org/t/syntax-surprises/92369)

<div class="topic-metadata">

**Author:** [@uniment](https://discourse.julialang.org/u/uniment)\
**Replies:** 83\
**Last updated:** [January 21, 2023, 9:45am UTC](https://discourse.julialang.org/t/syntax-surprises/92369 "2023-01-21T09:45:59Z")

</div>

A fun one for the new year :wink: One of the things I really like about Julia is being able to write code how I like (and the surprisingly large number of language decisions I find myself loving). The syntax is natural,…

---

## [Why no single argument \`filter(f::function)\`?](https://discourse.julialang.org/t/why-no-single-argument-filter-f-function/92719)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 8\
**Last updated:** [January 21, 2023, 8:26am UTC](https://discourse.julialang.org/t/why-no-single-argument-filter-f-function/92719 "2023-01-21T08:26:27Z")

</div>

Is there a good reason that there is no single-argument version of filter that returns a filter-function? I.e. why is the following (or something similar) not in Base filter(f::Function) = Base.Fix1(filter, f) ? This …

---

## [Rank 1 Update for LU factors](https://discourse.julialang.org/t/rank-1-update-for-lu-factors/93298)

<div class="topic-metadata">

**Author:** [@maxchendt](https://discourse.julialang.org/u/maxchendt)\
**Replies:** 0\
**Last updated:** [January 21, 2023, 8:08am UTC](https://discourse.julialang.org/t/rank-1-update-for-lu-factors/93298 "2023-01-21T08:08:56Z")

</div>

Is there a Julia implementation? as that from the MATLAB Central File Exchange:

---

## [Struct with different-sized tuple field](https://discourse.julialang.org/t/struct-with-different-sized-tuple-field/93282)

<div class="topic-metadata">

**Author:** [@Ronan\_Gautier](https://discourse.julialang.org/u/Ronan_Gautier)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 8:04am UTC](https://discourse.julialang.org/t/struct-with-different-sized-tuple-field/93282 "2023-01-21T08:04:49Z")

</div>

What is the proper way to define a structure that would look like struct mystruct n::Int values::NTuple(n, Int) end This does not work and I get the error ERROR: UndefVarError: n not defined. In my case, it is req…

---

## [Debian/Ubuntu users: where do you install julia's?](https://discourse.julialang.org/t/debian-ubuntu-users-where-do-you-install-julias/93270)

<div class="topic-metadata">

**Author:** [@tfiers](https://discourse.julialang.org/u/tfiers)\
**Replies:** 9\
**Last updated:** [January 21, 2023, 5:05am UTC](https://discourse.julialang.org/t/debian-ubuntu-users-where-do-you-install-julias/93270 "2023-01-21T05:05:47Z")

</div>

I’m on Windows, but experimenting with running Julia (and jupyter / IJulia) from WSL2 (windows subsystem for linux), in the hopes of speeding up startup latency times.\[1\] I’m not an experienced Linux user, and Platform …

---

## [Strange results with slurping](https://discourse.julialang.org/t/strange-results-with-slurping/93273)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 6\
**Last updated:** [January 20, 2023, 10:34pm UTC](https://discourse.julialang.org/t/strange-results-with-slurping/93273 "2023-01-20T22:34:47Z")

</div>

Here is a simple example that demonstrates that the ... list expansion operator can exhibit strange behavior. Consider: function tst(args...) @show args end arg1 = (a=3, b=4) arg2 = (c=5, d=7) arg3 = (c=5, f=7) ts…

---

## [Zygote error in backprop through NN](https://discourse.julialang.org/t/zygote-error-in-backprop-through-nn/92920)

<div class="topic-metadata">

**Author:** [@LucasMSpereira](https://discourse.julialang.org/u/LucasMSpereira)\
**Replies:** 4\
**Last updated:** [January 21, 2023, 1:54am UTC](https://discourse.julialang.org/t/zygote-error-in-backprop-through-nn/92920 "2023-01-21T01:54:27Z")

</div>

Following my last post about implementing WGAN-GP, now I’m running into another problem with gradients. Changing the discriminator’s BatchNorm() to Metalhead’s ChannelLayerNorm() solves the issue with the inner gradient.…

---

## [My model can't be transfered to gpu. Adapt.jl problem?](https://discourse.julialang.org/t/my-model-cant-be-transfered-to-gpu-adapt-jl-problem/92585)

<div class="topic-metadata">

**Author:** [@Euhan](https://discourse.julialang.org/u/Euhan)\
**Replies:** 12\
**Last updated:** [January 21, 2023, 1:45am UTC](https://discourse.julialang.org/t/my-model-cant-be-transfered-to-gpu-adapt-jl-problem/92585 "2023-01-21T01:45:00Z")

</div>

I have a model I’ve been working with and when I’m trying to expand it to work with arbitrary numbers of channels (some of which can be switched off) transfer to gpu keeps choking on the line: sparams = ntuple(i-\>F.para…

---

## [Link Project.toml files (or make /test/Prokect.toml depend on main package one)](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 6\
**Last updated:** [January 21, 2023, 12:00am UTC](https://discourse.julialang.org/t/link-project-toml-files-or-make-test-prokect-toml-depend-on-main-package-one/93223 "2023-01-21T00:00:33Z")

</div>

I have a julia project that has a Project.toml file setting its dependencies. It also have a set of tests, for which I have a Project.toml file setting some additional dependencies that are needed for the tests only (lik…

---

## [Plotting only certain trajectories of ensemble solution](https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288)

<div class="topic-metadata">

**Author:** [@Torkel](https://discourse.julialang.org/u/Torkel)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 11:56pm UTC](https://discourse.julialang.org/t/plotting-only-certain-trajectories-of-ensemble-solution/93288 "2023-01-20T23:56:48Z")

</div>

If I soleve an ensemble problem: using DifferentialEquations using Plots prob = ODEProblem((u,p,t)-\>1.01u,0.5,(0.0,1.0)) function prob\_func(prob,i,repeat) remake(prob,u0=rand()\*prob.u0) end ensemble\_prob = Ensemble…

---

## [Debugging with threads](https://discourse.julialang.org/t/debugging-with-threads/93281)

<div class="topic-metadata">

**Author:** [@Ross\_Boylan](https://discourse.julialang.org/u/Ross_Boylan)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 10:04pm UTC](https://discourse.julialang.org/t/debugging-with-threads/93281 "2023-01-20T22:04:18Z")

</div>

I have code which spawns some threads with tasks = \[Threads.@spawn worker(command, ml, ev) for i in 1:nT\]. I put a breakpoint inside the worker() function using VSCode and started a higher level function with @enter fro…

---

## [Working with 2 versions of julia with the same packages installed](https://discourse.julialang.org/t/working-with-2-versions-of-julia-with-the-same-packages-installed/93261)

<div class="topic-metadata">

**Author:** [@Abdou](https://discourse.julialang.org/u/Abdou)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 9:16pm UTC](https://discourse.julialang.org/t/working-with-2-versions-of-julia-with-the-same-packages-installed/93261 "2023-01-20T21:16:17Z")

</div>

I want packages installed for preinstalled version 1.6.7 of Julia to work for newlly installed 1.8.5 version without new installation of these packages. Is that possible and what to do ? thanks for contributions.

---

## [Pkg update stuck at 100%](https://discourse.julialang.org/t/pkg-update-stuck-at-100/93283)

<div class="topic-metadata">

**Author:** [@pierre-haessig](https://discourse.julialang.org/u/pierre-haessig)\
**Replies:** 3\
**Last updated:** [January 20, 2023, 8:57pm UTC](https://discourse.julialang.org/t/pkg-update-stuck-at-100/93283 "2023-01-20T20:57:43Z")

</div>

I also got hit by this problem on Linux with Julia 1.8.5 (except that package update hangs at 100% rather than 99.9%…). I’ve updated the thread with the solution (Pkg.update in Julia 1.5 uses github - #5 by pierre-haess…

---

## [Pkg fetching takes very long at 99.9% @ v1.6 (Win 10)](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499)

<div class="topic-metadata">

**Author:** [@essenciary](https://discourse.julialang.org/u/essenciary)\
**Replies:** 16\
**Last updated:** [February 21, 2022, 4:24pm UTC](https://discourse.julialang.org/t/pkg-fetching-takes-very-long-at-99-9-v1-6-win-10/56499 "2022-02-21T16:24:59Z")

</div>

Should this be reported as a bug or is it to be expected with RC?

---

## [Return type of powermod is always a Union?](https://discourse.julialang.org/t/return-type-of-powermod-is-always-a-union/93278)

<div class="topic-metadata">

**Author:** [@gtgt](https://discourse.julialang.org/u/gtgt)\
**Replies:** 1\
**Last updated:** [January 20, 2023, 8:19pm UTC](https://discourse.julialang.org/t/return-type-of-powermod-is-always-a-union/93278 "2023-01-20T20:19:20Z")

</div>

Why is the return type of powermod always a Union{Int64, Int128, BigInt}? As a consequence the following simple code is type-unstable: julia\> function f(a, b, c) a = powermod(a, b, c) a % 2 - a …

---

## [Strange behavior of saveat (MWE)](https://discourse.julialang.org/t/strange-behavior-of-saveat-mwe/93272)

<div class="topic-metadata">

**Author:** [@erlebach](https://discourse.julialang.org/u/erlebach)\
**Replies:** 2\
**Last updated:** [January 20, 2023, 6:48pm UTC](https://discourse.julialang.org/t/strange-behavior-of-saveat-mwe/93272 "2023-01-20T18:48:30Z")

</div>

I am trying to put save related arguments in a namedtuple. Here is my experiment. using DifferentialEquations function exponen!(du, u, param, t) du\[1\] = -u\[1\] end prob = ODEProblem(exponen!, \[2.\], tspan) # This works…

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

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