# General Usage

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

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

**Page:** 651

---

## [Unsatisfiable requirements detected for package](https://discourse.julialang.org/t/unsatisfiable-requirements-detected-for-package/54336)

<div class="topic-metadata">

**Author:** [@iamsuddhasattwa](https://discourse.julialang.org/u/iamsuddhasattwa)\
**Replies:** 2\
**Last updated:** [January 31, 2021, 7:04pm UTC](https://discourse.julialang.org/t/unsatisfiable-requirements-detected-for-package/54336 "2021-01-31T19:04:38Z")

</div>

I am getting the above error when trying to install the basic DataStructures package. I tries \] gc but that did not work. julia\> VERSION v"1.2.0" julia\> Pkg.add("DataStructures") Resolving package versions... ERROR: Un…

---

## [When working on a project (not a package, not intention of re-use), I started usin](https://discourse.julialang.org/t/when-working-on-a-project-not-a-package-not-intention-of-re-use-i-started-usin/54331)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [January 31, 2021, 4:28pm UTC](https://discourse.julialang.org/t/when-working-on-a-project-not-a-package-not-intention-of-re-use-i-started-usin/54331 "2021-01-31T16:28:21Z")

</div>

When working on a project (not a package, not intention of re-use), I started using Revise and includet. Once my project got larger, I figured it was best to put it into a module. Everything is in functions already. I do…

---

## [I’m trying to create a docker container that has some of the packages already inst](https://discourse.julialang.org/t/i-m-trying-to-create-a-docker-container-that-has-some-of-the-packages-already-inst/54324)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [January 31, 2021, 3:26pm UTC](https://discourse.julialang.org/t/i-m-trying-to-create-a-docker-container-that-has-some-of-the-packages-already-inst/54324 "2021-01-31T15:26:29Z")

</div>

I’m trying to create a docker container that has some of the packages already installed for later Julia execution. The idea is that the current directory is something you want to run in docker, and it has a Project.toml…

---

## [Stack Overflow Error in Julia itself (type-inference)?](https://discourse.julialang.org/t/stack-overflow-error-in-julia-itself-type-inference/54228)

<div class="topic-metadata">

**Author:** [@Henrique\_Becker](https://discourse.julialang.org/u/Henrique_Becker)\
**Replies:** 2\
**Last updated:** [January 31, 2021, 2:56pm UTC](https://discourse.julialang.org/t/stack-overflow-error-in-julia-itself-type-inference/54228 "2021-01-31T14:56:31Z")

</div>

I have done the following test in Julia 1.5.3 and Julia 1.6.0-beta1. $ git clone https://github.com/henriquebecker91/GuillotineModels.jl $ cd GuillotineModels.jl/examples $ git checkout 2c979b7f $ wget https://pastebin.…

---

## [Program design: Types with only fixed Parameters?](https://discourse.julialang.org/t/program-design-types-with-only-fixed-parameters/54316)

<div class="topic-metadata">

**Author:** [@florian](https://discourse.julialang.org/u/florian)\
**Replies:** 1\
**Last updated:** [January 31, 2021, 12:42pm UTC](https://discourse.julialang.org/t/program-design-types-with-only-fixed-parameters/54316 "2021-01-31T12:42:45Z")

</div>

Hi everyone, I’m trying to get used to programming with custom types and am in the following situation: Suppose I want to write a Program that calls an API, and there are different types of calls. First, I made a struc…

---

## [Eltype vs typeof what is the difference?](https://discourse.julialang.org/t/eltype-vs-typeof-what-is-the-difference/54319)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 3\
**Last updated:** [January 31, 2021, 12:27pm UTC](https://discourse.julialang.org/t/eltype-vs-typeof-what-is-the-difference/54319 "2021-01-31T12:27:48Z")

</div>

Hey Julianners, I want to understand what is the use of eltype. Is it always equal with: x not iterable: eltype(x) == typeof(x) x is iterable: eltype(x) == typeof(x\[1\]) and some size checking? Or eltype if specifica…

---

## [Obtaining the last element of a ProductIterator](https://discourse.julialang.org/t/obtaining-the-last-element-of-a-productiterator/54259)

<div class="topic-metadata">

**Author:** [@jishnub](https://discourse.julialang.org/u/jishnub)\
**Replies:** 3\
**Last updated:** [January 31, 2021, 10:16am UTC](https://discourse.julialang.org/t/obtaining-the-last-element-of-a-productiterator/54259 "2021-01-31T10:16:09Z")

</div>

Currently there is no way to obtain the last element of an iterator product, for example: julia\> it = Iterators.product(1:3, 2:3) Base.Iterators.ProductIterator{Tuple{UnitRange{Int64}, UnitRange{Int64}}}((1:3, 2:3)) ju…

---

## [If almost all ODE solvers fail, how can we trust the results from the other solvers?](https://discourse.julialang.org/t/if-almost-all-ode-solvers-fail-how-can-we-trust-the-results-from-the-other-solvers/54299)

<div class="topic-metadata">

**Author:** [@Xiaodong\_Liang](https://discourse.julialang.org/u/Xiaodong_Liang)\
**Replies:** 6\
**Last updated:** [January 31, 2021, 8:13am UTC](https://discourse.julialang.org/t/if-almost-all-ode-solvers-fail-how-can-we-trust-the-results-from-the-other-solvers/54299 "2021-01-31T08:13:32Z")

</div>

I want to introduce Julia to one course. We have been using MATLAB in this course for many years, which are very robust. For these special problems, I tried Python and it seems not as robust as MATLAB (I am also a beginn…

---

## [Serialize a Instance of mutable type into Json using JSON3?](https://discourse.julialang.org/t/serialize-a-instance-of-mutable-type-into-json-using-json3/54300)

<div class="topic-metadata">

**Author:** [@DataPsycho](https://discourse.julialang.org/u/DataPsycho)\
**Replies:** 2\
**Last updated:** [January 31, 2021, 5:02am UTC](https://discourse.julialang.org/t/serialize-a-instance-of-mutable-type-into-json-using-json3/54300 "2021-01-31T05:02:34Z")

</div>

Hi, Lets say i have defined a struct and StructType method for unmarshaling from json string as follows: mutable struct Request from::String message::String requesttime::String end # Outer Constructor func…

---

## [Splitting Int8s?](https://discourse.julialang.org/t/splitting-int8s/54290)

<div class="topic-metadata">

**Author:** [@Ian\_Slagle](https://discourse.julialang.org/u/Ian_Slagle)\
**Replies:** 12\
**Last updated:** [January 31, 2021, 4:31am UTC](https://discourse.julialang.org/t/splitting-int8s/54290 "2021-01-31T04:31:00Z")

</div>

I have a struct that is copied a lot in my program, so reducing the size of this struct has very noticeable impacts on performance. Of the variables I have, some are an integer (currently represented as Int8) that are bo…

---

## [Error running distributed code inside of a module](https://discourse.julialang.org/t/error-running-distributed-code-inside-of-a-module/54283)

<div class="topic-metadata">

**Author:** [@patrick-kidger](https://discourse.julialang.org/u/patrick-kidger)\
**Replies:** 6\
**Last updated:** [January 31, 2021, 4:20am UTC](https://discourse.julialang.org/t/error-running-distributed-code-inside-of-a-module/54283 "2021-01-31T04:20:27Z")

</div>

The following works just fine: using Distributed procs = addprocs(10) futures = \[\] for proc in procs push!(futures, @spawnat proc sleep(2)) end for fut in futures fetch(fut) end The following: module A using D…

---

## [Passing password from Base.getpass\\Base.winprompt to HTTP.request](https://discourse.julialang.org/t/passing-password-from-base-getpass-base-winprompt-to-http-request/53579)

<div class="topic-metadata">

**Author:** [@dannofthursday](https://discourse.julialang.org/u/dannofthursday)\
**Replies:** 6\
**Last updated:** [January 31, 2021, 1:36am UTC](https://discourse.julialang.org/t/passing-password-from-base-getpass-base-winprompt-to-http-request/53579 "2021-01-31T01:36:38Z")

</div>

I am trying to convert a few python scripts to julia. I wrote a simple script, in Python, wherein it asks for the username and password and uses them with Basic Authentication to request data from our company website. Th…

---

## [Profiled JIT dump lacks machine code](https://discourse.julialang.org/t/profiled-jit-dump-lacks-machine-code/54307)

<div class="topic-metadata">

**Author:** [@bicycle1885](https://discourse.julialang.org/u/bicycle1885)\
**Replies:** 0\
**Last updated:** [January 31, 2021, 12:52am UTC](https://discourse.julialang.org/t/profiled-jit-dump-lacks-machine-code/54307 "2021-01-31T00:52:24Z")

</div>

Hi all, I would like to profile Julia functions at instruction level using Linux perf. However, I cannot see disassembled machine code in the result. As you can see below, the disassembled code just after julia\_partitio…

---

## [Start Julia directly in shell\> or pkg\> mode?](https://discourse.julialang.org/t/start-julia-directly-in-shell-or-pkg-mode/54296)

<div class="topic-metadata">

**Author:** [@QuantumBits](https://discourse.julialang.org/u/QuantumBits)\
**Replies:** 5\
**Last updated:** [January 30, 2021, 11:24pm UTC](https://discourse.julialang.org/t/start-julia-directly-in-shell-or-pkg-mode/54296 "2021-01-30T23:24:29Z")

</div>

Hi! Is it possible to start a Julia REPL from the command line directly in shell\> or pkg\> mode without having to type ; or \], respectively, after the REPL loads? For example, something like: $ julia julia\> $ julia --she…

---

## [.xls Files on Julia](https://discourse.julialang.org/t/xls-files-on-julia/54245)

<div class="topic-metadata">

**Author:** [@Rodrigo\_Roa](https://discourse.julialang.org/u/Rodrigo_Roa)\
**Replies:** 5\
**Last updated:** [January 30, 2021, 9:45pm UTC](https://discourse.julialang.org/t/xls-files-on-julia/54245 "2021-01-30T21:45:32Z")

</div>

Hi, im looking for a package that allows you read a .xls file, if possible similar to the ones that works whit .xlsx.

---

## [Rebinding local variable inside function and type stability: does it matter?](https://discourse.julialang.org/t/rebinding-local-variable-inside-function-and-type-stability-does-it-matter/54159)

<div class="topic-metadata">

**Author:** [@Shuhua](https://discourse.julialang.org/u/Shuhua)\
**Replies:** 8\
**Last updated:** [January 30, 2021, 4:08pm UTC](https://discourse.julialang.org/t/rebinding-local-variable-inside-function-and-type-stability-does-it-matter/54159 "2021-01-30T16:08:50Z")

</div>

Based on my limited understanding of the documentation here, type stability mainly pertains to the return type. However, if I change the type of a local variable (essentially rebinding) inside a function as follows: g(x…

---

## [Counter-intuitive behaviour of the & function. Is it working as intended?](https://discourse.julialang.org/t/counter-intuitive-behaviour-of-the-function-is-it-working-as-intended/54246)

<div class="topic-metadata">

**Author:** [@CaFe](https://discourse.julialang.org/u/CaFe)\
**Replies:** 4\
**Last updated:** [January 30, 2021, 3:35pm UTC](https://discourse.julialang.org/t/counter-intuitive-behaviour-of-the-function-is-it-working-as-intended/54246 "2021-01-30T15:35:36Z")

</div>

Hello Everyone, I am a beginner to Julia and found the following behaviour of the & bitwise and operator rather perplexing. When I type in the REPL something like: julia\> 1 & 3 Everything goes ok and I get an answer: …

---

## [Plots and clibrary(:colorcet)?](https://discourse.julialang.org/t/plots-and-clibrary-colorcet/54180)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 1\
**Last updated:** [January 30, 2021, 3:17pm UTC](https://discourse.julialang.org/t/plots-and-clibrary-colorcet/54180 "2021-01-30T15:17:27Z")

</div>

I feel stupid for asking this… Some 9 months ago, I worked with some Jupyter notebooks with plotting (using Plots; pyplot()). At that time, I had to include a command: clibrary(:colorcet) to make my code/plots work. (…

---

## [For-loop in function is faster than global scope?](https://discourse.julialang.org/t/for-loop-in-function-is-faster-than-global-scope/54279)

<div class="topic-metadata">

**Author:** [@anon74562486](https://discourse.julialang.org/u/anon74562486)\
**Replies:** 3\
**Last updated:** [January 30, 2021, 2:37pm UTC](https://discourse.julialang.org/t/for-loop-in-function-is-faster-than-global-scope/54279 "2021-01-30T14:37:27Z")

</div>

Why are loops faster in functions? This: a = \[1:10\_000\_000;\] b = zeros(Int64, length(a)) function double!(x, y) L = length(x) for i in 1:L @inbounds y\[i\] = 2x\[i\] end nothing end @time double!(…

---

## [Meta.parse failes on double newlines](https://discourse.julialang.org/t/meta-parse-failes-on-double-newlines/54272)

<div class="topic-metadata">

**Author:** [@feanor12](https://discourse.julialang.org/u/feanor12)\
**Replies:** 1\
**Last updated:** [January 30, 2021, 1:38pm UTC](https://discourse.julialang.org/t/meta-parse-failes-on-double-newlines/54272 "2021-01-30T13:38:21Z")

</div>

Why do double newlines throw an error when parsing a string? I had problems with this when running files using DaemonMode. julia\> Meta.parse("begin end") quote #= none:1 =# end julia\> Meta.parse("begin end\\n") quo…

---

## [Compiling specialized functions for large set of user-passed options](https://discourse.julialang.org/t/compiling-specialized-functions-for-large-set-of-user-passed-options/54255)

<div class="topic-metadata">

**Author:** [@MilesCranmer](https://discourse.julialang.org/u/MilesCranmer)\
**Replies:** 4\
**Last updated:** [January 30, 2021, 1:27pm UTC](https://discourse.julialang.org/t/compiling-specialized-functions-for-large-set-of-user-passed-options/54255 "2021-01-30T13:27:02Z")

</div>

Hi, I’m optimizing my package SymbolicRegression.jl, the backend for PySR, a GA-based gradient-free symbolic regression code. The normal workflow for this package is to configure the options—such as choice of operators…

---

## [Plots for 3 values](https://discourse.julialang.org/t/plots-for-3-values/54270)

<div class="topic-metadata">

**Author:** [@Tomas\_Berky](https://discourse.julialang.org/u/Tomas_Berky)\
**Replies:** 0\
**Last updated:** [January 30, 2021, 1:02pm UTC](https://discourse.julialang.org/t/plots-for-3-values/54270 "2021-01-30T13:02:17Z")

</div>

Hello, is there a possibility o make this example (https://juliaacademy.com/courses/deep-learning-with-flux-jl/lectures/9624892) work with all colours? I tried it by myself and the model seems to work fine. But i am not…

---

## [How can I get back the original string after I converted it to codeunits?](https://discourse.julialang.org/t/how-can-i-get-back-the-original-string-after-i-converted-it-to-codeunits/54267)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [January 30, 2021, 12:46pm UTC](https://discourse.julialang.org/t/how-can-i-get-back-the-original-string-after-i-converted-it-to-codeunits/54267 "2021-01-30T12:46:44Z")

</div>

How can I get back the original string after I converted it to codeunits, e.g. f(codeunits("test")) = "test" ? Note that the poster on Slack cannot see your response here on Discourse. Consider answering the question th…

---

## [Method to supress multiple warnings](https://discourse.julialang.org/t/method-to-supress-multiple-warnings/54189)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 4\
**Last updated:** [January 30, 2021, 8:55am UTC](https://discourse.julialang.org/t/method-to-supress-multiple-warnings/54189 "2021-01-30T08:55:15Z")

</div>

Suppose one has code structured a bit like this (kinda exaggerated for clarity): solvemyproblem(array) = map(solveone, array) solveone(x) = ...stuff... function somedeepdownfunction(x) if nogood(x) @…

---

## [Running unit tests for Julia proper on home PC stalls computer](https://discourse.julialang.org/t/running-unit-tests-for-julia-proper-on-home-pc-stalls-computer/54248)

<div class="topic-metadata">

**Author:** [@BioTurboNick](https://discourse.julialang.org/u/BioTurboNick)\
**Replies:** 4\
**Last updated:** [January 30, 2021, 4:37am UTC](https://discourse.julialang.org/t/running-unit-tests-for-julia-proper-on-home-pc-stalls-computer/54248 "2021-01-30T04:37:37Z")

</div>

Whenever I try running the tests for Julia itself on my home computer, the system completely stalls out. Is there a way to keep it from blowing up my system and complete normally?

---

## [Will I run into performance issues if I use a matrix of different distributions?](https://discourse.julialang.org/t/will-i-run-into-performance-issues-if-i-use-a-matrix-of-different-distributions/54240)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 1\
**Last updated:** [January 30, 2021, 1:37am UTC](https://discourse.julialang.org/t/will-i-run-into-performance-issues-if-i-use-a-matrix-of-different-distributions/54240 "2021-01-30T01:37:26Z")

</div>

Will I run into performance issues if I use a matrix of different distributions? My understanding is that this will be an abstract typed matrix which will be slow. What is a better way to do this? Note that the poster …

---

## [Bash errors on launch (Launch\_JuliaPro)](https://discourse.julialang.org/t/bash-errors-on-launch-launch-juliapro/45214)

<div class="topic-metadata">

**Author:** [@jaleone33](https://discourse.julialang.org/u/jaleone33)\
**Replies:** 1\
**Last updated:** [January 29, 2021, 11:28pm UTC](https://discourse.julialang.org/t/bash-errors-on-launch-launch-juliapro/45214 "2021-01-29T23:28:49Z")

</div>

I have installed JuliaPro 1.0.5-2 on mxlinux (based on Debian). When I start the application (./LaunchJulia), the following errors appear in the terminal window: bash: cannot set terminal process group (-1): Inappropri…

---

## [Invalidating sysimages?](https://discourse.julialang.org/t/invalidating-sysimages/53922)

<div class="topic-metadata">

**Author:** [@airpmb](https://discourse.julialang.org/u/airpmb)\
**Replies:** 7\
**Last updated:** [January 29, 2021, 9:46pm UTC](https://discourse.julialang.org/t/invalidating-sysimages/53922 "2021-01-29T21:46:09Z")

</div>

If I’m not mistaken if you use a custom sysimage and then make any changes to any of the packages included in said sysimage, then these won’t be reflected in any Julia sessions where you use that sysimage. What I’m wonde…

---

## [Discussion of ccall( (:function, "library"), ...)](https://discourse.julialang.org/t/discussion-of-ccall-function-library/53887)

<div class="topic-metadata">

**Author:** [@lyonsquark](https://discourse.julialang.org/u/lyonsquark)\
**Replies:** 8\
**Last updated:** [January 29, 2021, 8:04pm UTC](https://discourse.julialang.org/t/discussion-of-ccall-function-library/53887 "2021-01-29T20:04:06Z")

</div>

Hi, I’d like to hear people’s thoughts about the use of ccall( (:function, "library"), ...) as opposed to ccall( :function, ...) (see Calling C and Fortran Code · The Julia Language) and whether the former variant should…

---

## [VSCode & Distributed](https://discourse.julialang.org/t/vscode-distributed/54216)

<div class="topic-metadata">

**Author:** [@smogendrr](https://discourse.julialang.org/u/smogendrr)\
**Replies:** 0\
**Last updated:** [January 29, 2021, 7:21pm UTC](https://discourse.julialang.org/t/vscode-distributed/54216 "2021-01-29T19:21:17Z")

</div>

Hello, everyone! All executions of REPL or Debugger in VSCode crashes, then i add “-p 2” argument to julia.additionalArgs in Julia extension settings in VSCode. ┌ Info: waiting for lock on pidfile └ path = "C:\\\\User…

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

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