# Latest

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

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

**Page:** 1216

---

## [Unable to connect to postgress with libPQ](https://discourse.julialang.org/t/unable-to-connect-to-postgress-with-libpq/70906)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 7\
**Last updated:** [November 6, 2021, 12:44am UTC](https://discourse.julialang.org/t/unable-to-connect-to-postgress-with-libpq/70906 "2021-11-06T00:44:26Z")

</div>

conn2 = LibPQ.Connection("dbname=postgres") tells me that I can’t find Unix domain socket "/tmp/.s.PGSQL.5432"? I’m using Ubuntu 20.04.3 LTS on an x86 Xeon machine. I’ve had the same issue with Crystal. Postgress i…

---

## [I guess \`@threads\` dosen't work in windows11](https://discourse.julialang.org/t/i-guess-threads-dosent-work-in-windows11/71016)

<div class="topic-metadata">

**Author:** [@rmsmsgood](https://discourse.julialang.org/u/rmsmsgood)\
**Replies:** 4\
**Last updated:** [November 6, 2021, 12:23am UTC](https://discourse.julialang.org/t/i-guess-threads-dosent-work-in-windows11/71016 "2021-11-06T00:23:55Z")

</div>

Any error or warning dosen’t occur, silence, just like number of thread is 1. I tested three different enviroment: :white\_check\_mark: Windows10 Intel(R) Xeon(R) CPU E3-1270 v5 @ 3.60GHz(8 threads) :x: Windows11 Intel(…

---

## [Taking \`push!\` and \`pop!\` seriously](https://discourse.julialang.org/t/taking-push-and-pop-seriously/34326)

<div class="topic-metadata">

**Author:** [@kevin.squire](https://discourse.julialang.org/u/kevin.squire)\
**Replies:** 19\
**Last updated:** [November 5, 2021, 6:13pm UTC](https://discourse.julialang.org/t/taking-push-and-pop-seriously/34326 "2021-11-05T18:13:49Z")

</div>

TL;DR: currently, push! and pop! conflate two different meanings (adding/removing elements to unordered/sorted collections vs. adding elements to the end of Vectors, Stacks, Deques, etc). These meanings should be split i…

---

## [Can this be more Juliesque?](https://discourse.julialang.org/t/can-this-be-more-juliesque/70684)

<div class="topic-metadata">

**Author:** [@Niceno](https://discourse.julialang.org/u/Niceno)\
**Replies:** 13\
**Last updated:** [November 5, 2021, 8:07pm UTC](https://discourse.julialang.org/t/can-this-be-more-juliesque/70684 "2021-11-05T20:07:54Z")

</div>

Dear all, I am a relative newbie in Julia, and what I am about to ask might sound ludicrously simple to you. So, here is the situation. I would like to introduce physical properties in a simulation program I am develo…

---

## [Initialize multiple variables in one line](https://discourse.julialang.org/t/initialize-multiple-variables-in-one-line/28916)

<div class="topic-metadata">

**Author:** [@ufechner7](https://discourse.julialang.org/u/ufechner7)\
**Replies:** 20\
**Last updated:** [November 5, 2021, 8:04pm UTC](https://discourse.julialang.org/t/initialize-multiple-variables-in-one-line/28916 "2021-11-05T20:04:53Z")

</div>

Hello, I would like to initialize multiple variables in one line. The following code does not work: a = b = c = Set{Symbol}() If I do: push!(a, :test) all three variables get the same value. I just want to initial…

---

## [Abusing operators](https://discourse.julialang.org/t/abusing-operators/71018)

<div class="topic-metadata">

**Author:** [@dodoplus](https://discourse.julialang.org/u/dodoplus)\
**Replies:** 2\
**Last updated:** [November 5, 2021, 7:10pm UTC](https://discourse.julialang.org/t/abusing-operators/71018 "2021-11-05T19:10:39Z")

</div>

was surprised to find this is a valid Julia code: julia\> ==(==,==) true This fails, though: julia\> == == == ERROR: syntax: "==" is not a unary operator I think both should parse the same, not that anyone sane would w…

---

## [Use of \`Perm\` to find sorted subset of indices?](https://discourse.julialang.org/t/use-of-perm-to-find-sorted-subset-of-indices/70912)

<div class="topic-metadata">

**Author:** [@mehdi](https://discourse.julialang.org/u/mehdi)\
**Replies:** 7\
**Last updated:** [November 5, 2021, 7:07pm UTC](https://discourse.julialang.org/t/use-of-perm-to-find-sorted-subset-of-indices/70912 "2021-11-05T19:07:00Z")

</div>

I want to use sortperm on only a subset of indices of an array a, I couldn’t find how to do it with the sortperm function, I can simply use sort on the subset of indices s\_subs this way: sort(s\_subs, by = x -\> a\[x\]) It…

---

## [Set parameters to Gurobi](https://discourse.julialang.org/t/set-parameters-to-gurobi/70794)

<div class="topic-metadata">

**Author:** [@wiz21b](https://discourse.julialang.org/u/wiz21b)\
**Replies:** 4\
**Last updated:** [November 5, 2021, 6:51pm UTC](https://discourse.julialang.org/t/set-parameters-to-gurobi/70794 "2021-11-05T18:51:10Z")

</div>

Hello, I use Gurobi 9.1.2; Julia 1.6.2 and these packages: Gurobi v0.9.14 JuMP v0.21.10 (I’ve seen that the C API has changed) I try to tell Gurobi to use a specific optimizer (the PRIMAL (simplex) one): LP\_model =…

---

## [Using package / install automatically](https://discourse.julialang.org/t/using-package-install-automatically/70896)

<div class="topic-metadata">

**Author:** [@gitboy16](https://discourse.julialang.org/u/gitboy16)\
**Replies:** 5\
**Last updated:** [November 5, 2021, 6:14pm UTC](https://discourse.julialang.org/t/using-package-install-automatically/70896 "2021-11-05T18:14:42Z")

</div>

Hi, If I do using DataFrames and the package is not install, Julia 1.7 will ask me if I want to install it and I will have to type y or n. Is there a way to skip that step and have Julia installed the package if it is …

---

## [Trying to install packages on a server that is airgapped - HELP!](https://discourse.julialang.org/t/trying-to-install-packages-on-a-server-that-is-airgapped-help/70970)

<div class="topic-metadata">

**Author:** [@damonhimself](https://discourse.julialang.org/u/damonhimself)\
**Replies:** 3\
**Last updated:** [November 5, 2021, 6:03pm UTC](https://discourse.julialang.org/t/trying-to-install-packages-on-a-server-that-is-airgapped-help/70970 "2021-11-05T18:03:20Z")

</div>

We are working to install packages using pkg on a system that is airgapped. We have mirrored roughly 200 github repos locally to a system that we have internal access to. When installing the package, it attempts to pull …

---

## [Gradient rise was obtained by optim.jl package optimization](https://discourse.julialang.org/t/gradient-rise-was-obtained-by-optim-jl-package-optimization/69548)

<div class="topic-metadata">

**Author:** [@F-YF](https://discourse.julialang.org/u/F-YF)\
**Replies:** 10\
**Last updated:** [November 5, 2021, 5:10pm UTC](https://discourse.julialang.org/t/gradient-rise-was-obtained-by-optim-jl-package-optimization/69548 "2021-11-05T17:10:30Z")

</div>

When I was doing optimization calculations with the Optim package\[Optim.jl\], , I found that the objective function sometimes unexpectedly tended to go up. I don’t know why this happens, hope someone can answer for me, th…

---

## [Why does "filter" use an uncommon position for the input dataframe?](https://discourse.julialang.org/t/why-does-filter-use-an-uncommon-position-for-the-input-dataframe/71004)

<div class="topic-metadata">

**Author:** [@Juan](https://discourse.julialang.org/u/Juan)\
**Replies:** 9\
**Last updated:** [November 5, 2021, 4:58pm UTC](https://discourse.julialang.org/t/why-does-filter-use-an-uncommon-position-for-the-input-dataframe/71004 "2021-11-05T16:58:04Z")

</div>

df = DataFrame(x = \[1.0,2.0,3.1, 44\], y = 4.0:7.0, z = \[1,1,2,2\]) filter(:y =\> \>=(3), df) # df must be written at the end. While other functions use the first position. subset(df, :y =\> x → x .\>= 5) select(df, \[:x,…

---

## [Collecting all solutions in a recursive branching algorithm](https://discourse.julialang.org/t/collecting-all-solutions-in-a-recursive-branching-algorithm/70936)

<div class="topic-metadata">

**Author:** [@Eugeleo](https://discourse.julialang.org/u/Eugeleo)\
**Replies:** 13\
**Last updated:** [November 5, 2021, 3:09pm UTC](https://discourse.julialang.org/t/collecting-all-solutions-in-a-recursive-branching-algorithm/70936 "2021-11-05T15:09:32Z")

</div>

Moved this from the New to Julia to a more fitting section I’m trying to translate a divide and conquer algorithm for a modified subset sum problem from Python. A simplified version might look like this: You are given a…

---

## [How to reduce memory allocations in the Sieve of Eratosthenes?](https://discourse.julialang.org/t/how-to-reduce-memory-allocations-in-the-sieve-of-eratosthenes/70679)

<div class="topic-metadata">

**Author:** [@vini-fda](https://discourse.julialang.org/u/vini-fda)\
**Replies:** 8\
**Last updated:** [November 5, 2021, 2:57pm UTC](https://discourse.julialang.org/t/how-to-reduce-memory-allocations-in-the-sieve-of-eratosthenes/70679 "2021-11-05T14:57:17Z")

</div>

Hello there! So I was trying to implement a cache-friendly version of the famous Sieve of Erathostenes in julia, and came up with this: function sieve\_cache\_optim(limit::UInt32; block\_size = 2^15) max\_primes = isqr…

---

## [Is there an in-place alternative to +=, \*=, etc.?](https://discourse.julialang.org/t/is-there-an-in-place-alternative-to-etc/70520)

<div class="topic-metadata">

**Author:** [@failedentertainment](https://discourse.julialang.org/u/failedentertainment)\
**Replies:** 1\
**Last updated:** [November 5, 2021, 3:47pm UTC](https://discourse.julialang.org/t/is-there-an-in-place-alternative-to-etc/70520 "2021-11-05T15:47:09Z")

</div>

Using += with arbitrary precision integers seems to end up using much more memory (and takes much longer) than the equivalent in-place operator (for my test, I used addeq! from Nemo and add! from Base.GMP.MPZ). Result: …

---

## [Combine two color channels in a plot / heatmap / image?](https://discourse.julialang.org/t/combine-two-color-channels-in-a-plot-heatmap-image/71008)

<div class="topic-metadata">

**Author:** [@thompsonmj](https://discourse.julialang.org/u/thompsonmj)\
**Replies:** 2\
**Last updated:** [November 5, 2021, 3:27pm UTC](https://discourse.julialang.org/t/combine-two-color-channels-in-a-plot-heatmap-image/71008 "2021-11-05T15:27:48Z")

</div>

I have an image with two grayscale color channels I would like to visualize in the same plot. How can I combine them? I think I would need to add an alpha or something that scales with the gray value … Or instead of c…

---

## [Is there a polyhedra package that will meet my need](https://discourse.julialang.org/t/is-there-a-polyhedra-package-that-will-meet-my-need/71010)

<div class="topic-metadata">

**Author:** [@XLVII](https://discourse.julialang.org/u/XLVII)\
**Replies:** 1\
**Last updated:** [November 5, 2021, 3:24pm UTC](https://discourse.julialang.org/t/is-there-a-polyhedra-package-that-will-meet-my-need/71010 "2021-11-05T15:24:22Z")

</div>

I need to implement this algorithm, but need exact same constructor of polyhedra. I don’t know julia, can someone help? or for “I\_s” , rigt kernel of matrix, power set … are there functions for these?

---

## [Improving performance of a number of functions for large scale gradient based optimization](https://discourse.julialang.org/t/improving-performance-of-a-number-of-functions-for-large-scale-gradient-based-optimization/70980)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 11\
**Last updated:** [November 5, 2021, 2:59pm UTC](https://discourse.julialang.org/t/improving-performance-of-a-number-of-functions-for-large-scale-gradient-based-optimization/70980 "2021-11-05T14:59:30Z")

</div>

Hello, I am trying to conduct a large-scale Maximum Likelihood Estimation. Luckily, I have analytical gradients and Hessians and therefore I can speed up my optimization routine by using derivative based methods. Howev…

---

## [Automatic separating variables when printing](https://discourse.julialang.org/t/automatic-separating-variables-when-printing/70993)

<div class="topic-metadata">

**Author:** [@vmuser](https://discourse.julialang.org/u/vmuser)\
**Replies:** 9\
**Last updated:** [November 5, 2021, 2:45pm UTC](https://discourse.julialang.org/t/automatic-separating-variables-when-printing/70993 "2021-11-05T14:45:45Z")

</div>

One (very minor) thing that bothers me in Julia is that print and println do not put spaces between the arguments. So for example print(1,2,3) prints 123. I wrote my own (probably not ideal) function that does it: func…

---

## [Read labeled image with Images.jl](https://discourse.julialang.org/t/read-labeled-image-with-images-jl/70934)

<div class="topic-metadata">

**Author:** [@tsobako](https://discourse.julialang.org/u/tsobako)\
**Replies:** 7\
**Last updated:** [November 5, 2021, 2:11pm UTC](https://discourse.julialang.org/t/read-labeled-image-with-images-jl/70934 "2021-11-05T14:11:13Z")

</div>

Hi. I have made segmentation labeling of images with the following tool (Labelme repo). It allows to export labels as a PNG image with every pixel as a single byte and it could be possible to load it properly with Pytho…

---

## [Whats the easiest way to create correlation matrices in Julia?](https://discourse.julialang.org/t/whats-the-easiest-way-to-create-correlation-matrices-in-julia/71006)

<div class="topic-metadata">

**Author:** [@SubTer](https://discourse.julialang.org/u/SubTer)\
**Replies:** 5\
**Last updated:** [November 5, 2021, 2:09pm UTC](https://discourse.julialang.org/t/whats-the-easiest-way-to-create-correlation-matrices-in-julia/71006 "2021-11-05T14:09:55Z")

</div>

Basically what the topic title says - suppose I have an array/df thats 5 columns (5 variables) by 100 rows of data values. I got it to do a good job doing covariance matrix output with the GLM package: lm1 = lm(@formul…

---

## [Bug? Plots + pyplot()](https://discourse.julialang.org/t/bug-plots-pyplot/70940)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 7\
**Last updated:** [November 4, 2021, 11:47am UTC](https://discourse.julialang.org/t/bug-plots-pyplot/70940 "2021-11-04T11:47:21Z")

</div>

I’m on Windows 11 (64bit), latest update as of now. I use Julia v1.6.3, latest update as of today with all packages. When I do simple plots using the pyplot() backend, my Jupyter notebook crashes with the following erro…

---

## [Threads.@threads over an iterator does not work - is there an reason?](https://discourse.julialang.org/t/threads-threads-over-an-iterator-does-not-work-is-there-an-reason/71003)

<div class="topic-metadata">

**Author:** [@Impressium](https://discourse.julialang.org/u/Impressium)\
**Replies:** 1\
**Last updated:** [November 5, 2021, 1:02pm UTC](https://discourse.julialang.org/t/threads-threads-over-an-iterator-does-not-work-is-there-an-reason/71003 "2021-11-05T13:02:36Z")

</div>

julia\> Threads.@threads for (index, value) in enumerate(\[1,2\]) end ERROR: TaskFailedException Stacktrace: \[1\] wait @ .\\task.jl:322 \[inlined\] \[2\] threading\_run(func::Function) @ Base.Threads .\\threadingcons…

---

## [Initialize AbstractArray?](https://discourse.julialang.org/t/initialize-abstractarray/70988)

<div class="topic-metadata">

**Author:** [@amrods](https://discourse.julialang.org/u/amrods)\
**Replies:** 15\
**Last updated:** [November 5, 2021, 12:26pm UTC](https://discourse.julialang.org/t/initialize-abstractarray/70988 "2021-11-05T12:26:19Z")

</div>

Is there a way to initialize an array that is a subtype of AbstractArray? For example, x = \[\] initializes Vectors, but how can I initialize an object that can be any arbitrary subtype of AbstractArray? is it possible?

---

## [POSIXct format in Julia](https://discourse.julialang.org/t/posixct-format-in-julia/70998)

<div class="topic-metadata">

**Author:** [@jnewbie](https://discourse.julialang.org/u/jnewbie)\
**Replies:** 1\
**Last updated:** [November 5, 2021, 10:41am UTC](https://discourse.julialang.org/t/posixct-format-in-julia/70998 "2021-11-05T10:41:38Z")

</div>

Hello everyone I am translating an R program into Julia. I have a problem because I assign the type POSIXct (POSIXct class stores date/time values as the number of seconds since January 1, 1970) to one of the columns o…

---

## [Can't see anything in HDF5 file I create from Julia](https://discourse.julialang.org/t/cant-see-anything-in-hdf5-file-i-create-from-julia/70992)

<div class="topic-metadata">

**Author:** [@Niceno](https://discourse.julialang.org/u/Niceno)\
**Replies:** 4\
**Last updated:** [November 5, 2021, 10:28am UTC](https://discourse.julialang.org/t/cant-see-anything-in-hdf5-file-i-create-from-julia/70992 "2021-11-05T10:28:50Z")

</div>

Hi all, I have a question about HDF5 files created from Julia with HDF5.jl package. I create files with the following commands: # Open the HDF5 file for writing fid =…

---

## [Dataframe filtering based on conditions comparing one column to other columns](https://discourse.julialang.org/t/dataframe-filtering-based-on-conditions-comparing-one-column-to-other-columns/70802)

<div class="topic-metadata">

**Author:** [@CompulsoryCoffee](https://discourse.julialang.org/u/CompulsoryCoffee)\
**Replies:** 6\
**Last updated:** [November 5, 2021, 10:23am UTC](https://discourse.julialang.org/t/dataframe-filtering-based-on-conditions-comparing-one-column-to-other-columns/70802 "2021-11-05T10:23:08Z")

</div>

Hi, I am trying to apply a condition to a selection of columns based on one column and the resulting dataframe. Here is an example: df 10×5 DataFrame Row │ x1 x2 x3 x4 x5 │…

---

## [UsingMerge: merge method definitions when using a package](https://discourse.julialang.org/t/usingmerge-merge-method-definitions-when-using-a-package/61885)

<div class="topic-metadata">

**Author:** [@Jean\_Michel](https://discourse.julialang.org/u/Jean_Michel)\
**Replies:** 0\
**Last updated:** [May 26, 2021, 8:40pm UTC](https://discourse.julialang.org/t/usingmerge-merge-method-definitions-when-using-a-package/61885 "2021-05-26T20:40:37Z")

</div>

This package (now registered) exports a single macro @usingmerge which differs from using in that it “merges” the exported definitions automatically. The wish for this started in this thread. At the time I was v…

---

## [Namespace problems when running Optim in parallel?](https://discourse.julialang.org/t/namespace-problems-when-running-optim-in-parallel/2275)

<div class="topic-metadata">

**Author:** [@Elrod](https://discourse.julialang.org/u/Elrod)\
**Replies:** 2\
**Last updated:** [November 5, 2021, 10:11am UTC](https://discourse.julialang.org/t/namespace-problems-when-running-optim-in-parallel/2275 "2021-11-05T10:11:33Z")

</div>

Hi, I keep running into errors such as: ERROR: LoadError: On worker 2: MethodError: no method matching minimizer(::Optim.MultivariateOptimizationResults{Float64,1,Optim.NewtonTrustRegion{Float64}}) or, the comical E…

---

## [Barplot in Julia](https://discourse.julialang.org/t/barplot-in-julia/70982)

<div class="topic-metadata">

**Author:** [@dadaforpeace](https://discourse.julialang.org/u/dadaforpeace)\
**Replies:** 2\
**Last updated:** [November 5, 2021, 9:34am UTC](https://discourse.julialang.org/t/barplot-in-julia/70982 "2021-11-05T09:34:32Z")

</div>

Hi, I would like to make a really simple Bar Plot, but the Data especially the Name of a Column is quite long and thus for me impossible to address. I am following the following instructions: Bar charts in Julia The da…

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

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