# General Usage

**URL:** https://discourse.julialang.org/c/usage/6.md?page=781

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

**Page:** 782

---

## [How to solve error while compiling custom package that uses Turing with Revise](https://discourse.julialang.org/t/how-to-solve-error-while-compiling-custom-package-that-uses-turing-with-revise/34745)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 10\
**Last updated:** [March 3, 2020, 10:25am UTC](https://discourse.julialang.org/t/how-to-solve-error-while-compiling-custom-package-that-uses-turing-with-revise/34745 "2020-03-03T10:25:49Z")

</div>

Hi, I have a custom package named MyPkg and it contains a function named test\_fun() as follows, that copied and modified from Turing documentation. function test\_fun() # Set the true probability of heads in a coin.…

---

## [Size function does not work with pairs(::NamedTuple)](https://discourse.julialang.org/t/size-function-does-not-work-with-pairs-namedtuple/35451)

<div class="topic-metadata">

**Author:** [@ravi.joshi](https://discourse.julialang.org/u/ravi.joshi)\
**Replies:** 1\
**Last updated:** [March 3, 2020, 10:11am UTC](https://discourse.julialang.org/t/size-function-does-not-work-with-pairs-namedtuple/35451 "2020-03-03T10:11:18Z")

</div>

The size function works as expected for pairs(::Array), but throws an error for pairs(::NamedTuple). Is it expected or a bug? Shouldn’t the functions on Pairs work uniformly for all underlying containers? If it is a bug…

---

## [Warning in 1.0 +?](https://discourse.julialang.org/t/warning-in-1-0/35281)

<div class="topic-metadata">

**Author:** [@programista](https://discourse.julialang.org/u/programista)\
**Replies:** 28\
**Last updated:** [March 3, 2020, 9:20am UTC](https://discourse.julialang.org/t/warning-in-1-0/35281 "2020-03-03T09:20:49Z")

</div>

Is possible switch ON Warnings: in Julia 1.0 and higher like was in 0.7 ? : julia\> sum(rand(10,10),1) ┌ Warning: \`sum(a::AbstractArray, dims)\` is deprecated, use \`sum(a, dims=dims)\` instead. │ caller = top-level sco…

---

## [Need @inline for constructors?](https://discourse.julialang.org/t/need-inline-for-constructors/35442)

<div class="topic-metadata">

**Author:** [@tomtom](https://discourse.julialang.org/u/tomtom)\
**Replies:** 1\
**Last updated:** [March 3, 2020, 7:21am UTC](https://discourse.julialang.org/t/need-inline-for-constructors/35442 "2020-03-03T07:21:04Z")

</div>

as I saw in codes of various packages, @inline is not seen for inner constructor. So, is it valid at all to annotate @inline for inner constructors? what about outer constructors? thanks.

---

## [Setting \`nthreads()\` using the .julia/config/startup.jl file](https://discourse.julialang.org/t/setting-nthreads-using-the-julia-config-startup-jl-file/35427)

<div class="topic-metadata">

**Author:** [@oliver](https://discourse.julialang.org/u/oliver)\
**Replies:** 22\
**Last updated:** [March 3, 2020, 4:33am UTC](https://discourse.julialang.org/t/setting-nthreads-using-the-julia-config-startup-jl-file/35427 "2020-03-03T04:33:18Z")

</div>

Why does setting ENV\[JULIA\_CPU\_THREADS\]=5 and ENV\[JULIA\_NUM\_THREADS\]=5 not affect nprocs() ? Here is what I get on startup: julia\> versioninfo() Julia Version 1.3.1 Commit 2d5741174c (2019-12-30 21:36 UTC) Platform Info…

---

## [How to solve warning while using custom package with Revise?](https://discourse.julialang.org/t/how-to-solve-warning-while-using-custom-package-with-revise/34743)

<div class="topic-metadata">

**Author:** [@Manu\_Francis](https://discourse.julialang.org/u/Manu_Francis)\
**Replies:** 11\
**Last updated:** [February 20, 2020, 2:23am UTC](https://discourse.julialang.org/t/how-to-solve-warning-while-using-custom-package-with-revise/34743 "2020-02-20T02:23:29Z")

</div>

Hi, When I try to use my custom package with Revise.jl, as follows, I am getting warning. using Revise using MyPkg The warning is as follows: ┌ Warning: C:\\Users\\zac\\.julia\\packages\\Plots\\qZHsp\\src\\Plots.jl\\ is not a…

---

## [Way to transform HTML into Text?](https://discourse.julialang.org/t/way-to-transform-html-into-text/35434)

<div class="topic-metadata">

**Author:** [@djsegal](https://discourse.julialang.org/u/djsegal)\
**Replies:** 1\
**Last updated:** [March 3, 2020, 12:43am UTC](https://discourse.julialang.org/t/way-to-transform-html-into-text/35434 "2020-03-03T00:43:24Z")

</div>

It seems like Gumbo.jl does a good job of parsing HTML, but there doesn’t seem to be an easy way to extract the text from it (akin to beautiful soup in python). Has anyone encountered this problem? How did you turn a wh…

---

## [Eigs does not work](https://discourse.julialang.org/t/eigs-does-not-work/35421)

<div class="topic-metadata">

**Author:** [@chakravala](https://discourse.julialang.org/u/chakravala)\
**Replies:** 4\
**Last updated:** [March 2, 2020, 11:49pm UTC](https://discourse.julialang.org/t/eigs-does-not-work/35421 "2020-03-02T23:49:33Z")

</div>

Trying to use eigs from Arpack gives me a lot of trouble, is there any alternative? https://github.com/JuliaLinearAlgebra/Arpack.jl/issues/96

---

## [Composing a constructor causes tons of allocations](https://discourse.julialang.org/t/composing-a-constructor-causes-tons-of-allocations/35405)

<div class="topic-metadata">

**Author:** [@jules](https://discourse.julialang.org/u/jules)\
**Replies:** 2\
**Last updated:** [March 2, 2020, 8:14pm UTC](https://discourse.julialang.org/t/composing-a-constructor-causes-tons-of-allocations/35405 "2020-03-02T20:14:12Z")

</div>

I’m trying to build a pipeline of transformations and noticed this weird behavior when I plugged a Point2f0 constructor into the pipeline. I’ve removed the rest of the test pipeline and replaced it with the identity func…

---

## [Push! vs pushfirst! performance](https://discourse.julialang.org/t/push-vs-pushfirst-performance/35402)

<div class="topic-metadata">

**Author:** [@anon94023334](https://discourse.julialang.org/u/anon94023334)\
**Replies:** 5\
**Last updated:** [March 2, 2020, 8:07pm UTC](https://discourse.julialang.org/t/push-vs-pushfirst-performance/35402 "2020-03-02T20:07:21Z")

</div>

I was surprised at this performance: julia\> function p(x, n) for i = 1:n push!(x, i) end x end p (generic function with 1 method) julia\> function pf(x, n) …

---

## [Function zero() with type"Any"](https://discourse.julialang.org/t/function-zero-with-type-any/27007)

<div class="topic-metadata">

**Author:** [@Dota](https://discourse.julialang.org/u/Dota)\
**Replies:** 14\
**Last updated:** [March 2, 2020, 6:56pm UTC](https://discourse.julialang.org/t/function-zero-with-type-any/27007 "2020-03-02T18:56:46Z")

</div>

Hi! Nowadays I’m learning about Julia, mainly to solve non-linear optimization problem. Because of the low efficiency of dense matrix, I transfer some of the matrix into sparse matrix. When I’m trying to multiply two ma…

---

## [Tab completion for numeric codepoints](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 6\
**Last updated:** [March 2, 2020, 5:25pm UTC](https://discourse.julialang.org/t/tab-completion-for-numeric-codepoints/35411 "2020-03-02T17:25:56Z")

</div>

Hi, is there a way to get a Unicode character from its numeric code in the REPL (without resorting to copy and paste)? I was trying to input the ace of each card suit (spade, heart, club, diamond) based on the codepoint…

---

## [Is there a Datalog library in Julia?](https://discourse.julialang.org/t/is-there-a-datalog-library-in-julia/11837)

<div class="topic-metadata">

**Author:** [@gabomgp](https://discourse.julialang.org/u/gabomgp)\
**Replies:** 3\
**Last updated:** [March 2, 2020, 12:59pm UTC](https://discourse.julialang.org/t/is-there-a-datalog-library-in-julia/11837 "2020-03-02T12:59:42Z")

</div>

I’m thinking about using Datalog for a problem I have at hand. Is there a Datalog library implemented in Julia, a la pyDatalog?

---

## [Specifying Gurobi or other linear solvers instead of NUMPS in Ipopt](https://discourse.julialang.org/t/specifying-gurobi-or-other-linear-solvers-instead-of-numps-in-ipopt/35394)

<div class="topic-metadata">

**Author:** [@Arega\_Getaneh](https://discourse.julialang.org/u/Arega_Getaneh)\
**Replies:** 1\
**Last updated:** [March 2, 2020, 10:19am UTC](https://discourse.julialang.org/t/specifying-gurobi-or-other-linear-solvers-instead-of-numps-in-ipopt/35394 "2020-03-02T10:19:31Z")

</div>

I am using Ipopt on JuMP to solve nonlinear programming. I use Ipopt and it uses numps by default. But it recommends me to use other nonlinear This is Ipopt version 3.12.10, running with linear solver mumps. NOTE: Other…

---

## [How to change u to a specific value once a value (not tstep) threshold is crossed?](https://discourse.julialang.org/t/how-to-change-u-to-a-specific-value-once-a-value-not-tstep-threshold-is-crossed/34569)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 15\
**Last updated:** [March 2, 2020, 9:31am UTC](https://discourse.julialang.org/t/how-to-change-u-to-a-specific-value-once-a-value-not-tstep-threshold-is-crossed/34569 "2020-03-02T09:31:13Z")

</div>

Hello again, Is there a way to change u (in my case bioS) in a differential equation to a specific value once a value threshold has been crossed? I am running a simulation of a food web and once a species in that food …

---

## [Plot series data by Plots](https://discourse.julialang.org/t/plot-series-data-by-plots/35377)

<div class="topic-metadata">

**Author:** [@1634](https://discourse.julialang.org/u/1634)\
**Replies:** 6\
**Last updated:** [March 2, 2020, 12:12am UTC](https://discourse.julialang.org/t/plot-series-data-by-plots/35377 "2020-03-02T00:12:28Z")

</div>

Hi commuinty, Q1: Is there a way to use x, y and legend (as below) to plot data in series? #y matrix: row corresponding to each x value, column for each series (marked by legend) of data x=\[2 4 6 8 10 12\]#correspondin…

---

## [Timestamp String with one-second resolution: fastest implementation?](https://discourse.julialang.org/t/timestamp-string-with-one-second-resolution-fastest-implementation/35378)

<div class="topic-metadata">

**Author:** [@joshua\_jones](https://discourse.julialang.org/u/joshua_jones)\
**Replies:** 0\
**Last updated:** [March 1, 2020, 10:35pm UTC](https://discourse.julialang.org/t/timestamp-string-with-one-second-resolution-fastest-implementation/35378 "2020-03-01T22:35:58Z")

</div>

I’m trying to determine the fastest way to add UTC time stamps with a resolution of 1 s to automated logs of data reading and processing. This is used frequently as data are read into memory and processed. Suggestions wo…

---

## [Different inner product if vector type is not set](https://discourse.julialang.org/t/different-inner-product-if-vector-type-is-not-set/35359)

<div class="topic-metadata">

**Author:** [@danielw2904](https://discourse.julialang.org/u/danielw2904)\
**Replies:** 8\
**Last updated:** [March 1, 2020, 9:37pm UTC](https://discourse.julialang.org/t/different-inner-product-if-vector-type-is-not-set/35359 "2020-03-01T21:37:36Z")

</div>

Hi All, EDIT: Please see simpler example in comments! I would like to ask about the precision of Float64s in a Vector of type Any vs. a vector of type Float64. It seems there is a subtle difference that I noticed as pa…

---

## [Game Development in Julia / GameZero.jl](https://discourse.julialang.org/t/game-development-in-julia-gamezero-jl/35361)

<div class="topic-metadata">

**Author:** [@scelles](https://discourse.julialang.org/u/scelles)\
**Replies:** 1\
**Last updated:** [March 1, 2020, 6:41pm UTC](https://discourse.julialang.org/t/game-development-in-julia-gamezero-jl/35361 "2020-03-01T18:41:35Z")

</div>

Hello, I noticed this meetup Our next meetup, at short notice (sorry!), will be at the Alan Turing Institute premises, within the iconic British Library building, on Monday the 24th of February. We haven’t had a metu…

---

## [Embedding PyPlot figure into a Gtk GUI](https://discourse.julialang.org/t/embedding-pyplot-figure-into-a-gtk-gui/35369)

<div class="topic-metadata">

**Author:** [@Abubaker\_Jaffer](https://discourse.julialang.org/u/Abubaker_Jaffer)\
**Replies:** 0\
**Last updated:** [March 1, 2020, 6:11pm UTC](https://discourse.julialang.org/t/embedding-pyplot-figure-into-a-gtk-gui/35369 "2020-03-01T18:11:43Z")

</div>

Hi all, Im trying to find a way to embed Pyplot figures into a Gtk GUI but cant seem to find any meaningful documentation into whether or not this is possible. The idea that I have is to embed the figure into a GtkCanv…

---

## [Jll packages](https://discourse.julialang.org/t/jll-packages/35366)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 1\
**Last updated:** [March 1, 2020, 5:50pm UTC](https://discourse.julialang.org/t/jll-packages/35366 "2020-03-01T17:50:46Z")

</div>

I noticed that several packages are available in two variants: “normal” and \*\_jll. For example FFTW, FFTW\_jll, Nettle, Nettle\_jll FFTW seems to be based on the FFTW\_jll “artifact”, whereas Nettle seems independent of N…

---

## [Type stable mapreduce over NamedTuple keys](https://discourse.julialang.org/t/type-stable-mapreduce-over-namedtuple-keys/35367)

<div class="topic-metadata">

**Author:** [@Tamas\_Papp](https://discourse.julialang.org/u/Tamas_Papp)\
**Replies:** 0\
**Last updated:** [March 1, 2020, 5:44pm UTC](https://discourse.julialang.org/t/type-stable-mapreduce-over-namedtuple-keys/35367 "2020-03-01T17:44:06Z")

</div>

I am trying to write a function that picks keys from a NamedTuple, uses each key to obtain values from two objects (not necessarily NamedTuples, they support getproperty, may have other properties not used by this func…

---

## [How to \`cumsum\` a tuple](https://discourse.julialang.org/t/how-to-cumsum-a-tuple/35347)

<div class="topic-metadata">

**Author:** [@mpf01](https://discourse.julialang.org/u/mpf01)\
**Replies:** 12\
**Last updated:** [March 1, 2020, 5:05pm UTC](https://discourse.julialang.org/t/how-to-cumsum-a-tuple/35347 "2020-03-01T17:05:55Z")

</div>

Julia has a cumsum function that operators on arrays, but not on lists. This seems to work: cumsum2(itr) = foldl((x,y)-\>(x...,x\[end\]+y), itr) Is this the best way to accomplish the task?

---

## [Tuple isa UnionAll == false](https://discourse.julialang.org/t/tuple-isa-unionall-false/35354)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 3\
**Last updated:** [March 1, 2020, 10:42am UTC](https://discourse.julialang.org/t/tuple-isa-unionall-false/35354 "2020-03-01T10:42:38Z")

</div>

this looks weird: julia\> Tuple isa UnionAll false is this a bug?

---

## [Oracle DBI driver](https://discourse.julialang.org/t/oracle-dbi-driver/8205)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 38\
**Last updated:** [March 1, 2020, 9:19am UTC](https://discourse.julialang.org/t/oracle-dbi-driver/8205 "2020-03-01T09:19:33Z")

</div>

Does anyone know if there’s any Oracle DBI package around? At my work place, Oracle is still a dominant data source and it would be nice to have an easy interface from Julia. Oracle has a well-documented C API Given…

---

## [Is it possible to have a typevariable for an upperbound?](https://discourse.julialang.org/t/is-it-possible-to-have-a-typevariable-for-an-upperbound/35274)

<div class="topic-metadata">

**Author:** [@schlichtanders](https://discourse.julialang.org/u/schlichtanders)\
**Replies:** 2\
**Last updated:** [March 1, 2020, 8:07am UTC](https://discourse.julialang.org/t/is-it-possible-to-have-a-typevariable-for-an-upperbound/35274 "2020-03-01T08:07:29Z")

</div>

Just stumbled upon that I would like to transform a specific container to another specific container, and it looks like I have to take special care about Julia’s UnionAll types. Concretely, I would like to map say Vecto…

---

## [Map function to only some columns](https://discourse.julialang.org/t/map-function-to-only-some-columns/35344)

<div class="topic-metadata">

**Author:** [@tbeason](https://discourse.julialang.org/u/tbeason)\
**Replies:** 1\
**Last updated:** [March 1, 2020, 1:23am UTC](https://discourse.julialang.org/t/map-function-to-only-some-columns/35344 "2020-03-01T01:23:06Z")

</div>

Many times I want to map a function over a DataFrame but not all of its columns. For example, suppose the first column is a Date column, but the remainder are Float64 columns, and I basically just want the first column t…

---

## [How to iterate through a StatsBase.Histogram](https://discourse.julialang.org/t/how-to-iterate-through-a-statsbase-histogram/35335)

<div class="topic-metadata">

**Author:** [@zierenberg](https://discourse.julialang.org/u/zierenberg)\
**Replies:** 3\
**Last updated:** [March 1, 2020, 1:21am UTC](https://discourse.julialang.org/t/how-to-iterate-through-a-statsbase-histogram/35335 "2020-03-01T01:21:34Z")

</div>

Hi, let me start my first post by saying thank you for all the hard work from the community. I really enjoy diving into the julia programming language. I am currently playing around with Monte Carlo simulations in juli…

---

## [Safe predictions using \`@formula\` and regression splines](https://discourse.julialang.org/t/safe-predictions-using-formula-and-regression-splines/33057)

<div class="topic-metadata">

**Author:** [@mclements](https://discourse.julialang.org/u/mclements)\
**Replies:** 6\
**Last updated:** [February 29, 2020, 10:22pm UTC](https://discourse.julialang.org/t/safe-predictions-using-formula-and-regression-splines/33057 "2020-02-29T22:22:17Z")

</div>

Dear all, As my first effort in Julia, I have written a Splines2 package for spline bases for regression modelling (https://github.com/mclements/Splines2.jl). The implementation includes equivalents to the splines::ns, s…

---

## [Why does Julia not optimize this code when C++ (LLVM) can?](https://discourse.julialang.org/t/why-does-julia-not-optimize-this-code-when-c-llvm-can/35314)

<div class="topic-metadata">

**Author:** [@kdheepak](https://discourse.julialang.org/u/kdheepak)\
**Replies:** 14\
**Last updated:** [February 29, 2020, 7:08pm UTC](https://discourse.julialang.org/t/why-does-julia-not-optimize-this-code-when-c-llvm-can/35314 "2020-02-29T19:08:32Z")

</div>

When using a C++ compiler with LLVM version 6.0.0, the following code bool isEven(int n) { bool ret = true; for (int i = 0; i \< n; i ++) { ret = !ret; } return ret; } emits the LLVM IR define z…

[Previous page](https://discourse.julialang.org/c/usage/6.md?page=780)

[Next page](https://discourse.julialang.org/c/usage/6.md?page=782)
