# General Usage

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

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

**Page:** 848

---

## [Issues with println buffering output when redirecting stdout to a txt file](https://discourse.julialang.org/t/issues-with-println-buffering-output-when-redirecting-stdout-to-a-txt-file/23738)

<div class="topic-metadata">

**Author:** [@jonbarkerlondon](https://discourse.julialang.org/u/jonbarkerlondon)\
**Replies:** 14\
**Last updated:** [July 23, 2019, 12:48pm UTC](https://discourse.julialang.org/t/issues-with-println-buffering-output-when-redirecting-stdout-to-a-txt-file/23738 "2019-07-23T12:48:03Z")

</div>

Hey all, I’m attempting to find the julia definition for the println method as I want to replace it with my own custom println method that performs a flush(stdout) after every println I’ve found this but it doesn’t see…

---

## [How to redirect output with error function to log.err file?](https://discourse.julialang.org/t/how-to-redirect-output-with-error-function-to-log-err-file/26680)

<div class="topic-metadata">

**Author:** [@Martin\_Florek](https://discourse.julialang.org/u/Martin_Florek)\
**Replies:** 0\
**Last updated:** [July 23, 2019, 12:39pm UTC](https://discourse.julialang.org/t/how-to-redirect-output-with-error-function-to-log-err-file/26680 "2019-07-23T12:39:43Z")

</div>

For instance: sqrt(-1) p.s.: I don’t need to see it in the console. It’s App. Thanks

---

## [Ways to make slow/sluggish REPL/interactive development experience faster?](https://discourse.julialang.org/t/ways-to-make-slow-sluggish-repl-interactive-development-experience-faster/25293)

<div class="topic-metadata">

**Author:** [@abe](https://discourse.julialang.org/u/abe)\
**Replies:** 35\
**Last updated:** [July 23, 2019, 11:56am UTC](https://discourse.julialang.org/t/ways-to-make-slow-sluggish-repl-interactive-development-experience-faster/25293 "2019-07-23T11:56:36Z")

</div>

New to Julia from R and so far very disappointed with the interactive experience. I get that compiles will take time, but it seems like everything is slow. I don’t get why something like “using mycoolpackage” or “add ano…

---

## [Changing legend of plot after calling plot using Plots.jl](https://discourse.julialang.org/t/changing-legend-of-plot-after-calling-plot-using-plots-jl/26537)

<div class="topic-metadata">

**Author:** [@gobs](https://discourse.julialang.org/u/gobs)\
**Replies:** 3\
**Last updated:** [July 23, 2019, 8:19am UTC](https://discourse.julialang.org/t/changing-legend-of-plot-after-calling-plot-using-plots-jl/26537 "2019-07-23T08:19:06Z")

</div>

I would like to do something like the following: x = 1:10 y = 2.\*x for p = 1:3 plot(x,y, lab = "Data") p == 1 ? legend(:topright) : legend(false) Except for the life of me I can’t find out how to change the le…

---

## [How to convert parsed equation to its source format?](https://discourse.julialang.org/t/how-to-convert-parsed-equation-to-its-source-format/26665)

<div class="topic-metadata">

**Author:** [@Islam0mar](https://discourse.julialang.org/u/Islam0mar)\
**Replies:** 2\
**Last updated:** [July 23, 2019, 6:34am UTC](https://discourse.julialang.org/t/how-to-convert-parsed-equation-to-its-source-format/26665 "2019-07-23T06:34:20Z")

</div>

I want to change the following equation: 11 x² - 484 x + 12358 to (11 \* x ^ 2 - 484x) + 12358 Is there any package or builtin function to do that? Note: My use case is for JuMP package and I have a work around for…

---

## [Assertion: jl\_TargetMachine](https://discourse.julialang.org/t/assertion-jl-targetmachine/26483)

<div class="topic-metadata">

**Author:** [@Orbots](https://discourse.julialang.org/u/Orbots)\
**Replies:** 4\
**Last updated:** [July 23, 2019, 1:24am UTC](https://discourse.julialang.org/t/assertion-jl-targetmachine/26483 "2019-07-23T01:24:03Z")

</div>

Summary of situation: built julia-1.2.0-rc2 from source for centos6 with gcc 6.4.0 and -DGLIBCXX\_USE\_CXX11\_ABI=0 dlopen an .so which embeds some simple julia code. “Lifted” into global namespace with dlopen(RTLD\_NOW |…

---

## [Dict merge without promoting](https://discourse.julialang.org/t/dict-merge-without-promoting/26648)

<div class="topic-metadata">

**Author:** [@grahamas](https://discourse.julialang.org/u/grahamas)\
**Replies:** 4\
**Last updated:** [July 22, 2019, 11:52pm UTC](https://discourse.julialang.org/t/dict-merge-without-promoting/26648 "2019-07-22T23:52:24Z")

</div>

Is there any existing way to merge without promotion? Maybe with constructing a dict that has union type? Right now I’m trying to merge dicts that may have values of Int or Float type, in an arbitrary order, and I need t…

---

## [Sqlite3 interface problem](https://discourse.julialang.org/t/sqlite3-interface-problem/26653)

<div class="topic-metadata">

**Author:** [@purplishrock](https://discourse.julialang.org/u/purplishrock)\
**Replies:** 3\
**Last updated:** [July 22, 2019, 11:18pm UTC](https://discourse.julialang.org/t/sqlite3-interface-problem/26653 "2019-07-22T23:18:19Z")

</div>

i have an sqlite db and did the following. Did the very obvious thing: db=SQLite.DB("test.db") s=SQLite.Query(db, "select distinct date from table") I should point out that i ran both SQLite.tables and SQLite.columns …

---

## [Copying variable to all remote processes?](https://discourse.julialang.org/t/copying-variable-to-all-remote-processes/26518)

<div class="topic-metadata">

**Author:** [@vlandau](https://discourse.julialang.org/u/vlandau)\
**Replies:** 5\
**Last updated:** [July 19, 2019, 4:18pm UTC](https://discourse.julialang.org/t/copying-variable-to-all-remote-processes/26518 "2019-07-19T16:18:16Z")

</div>

Hello all, I’m working on some code where each remote worker needs to compute an array by accumulating values, and the arrays then need to be summed. Below is an absolute minimum working example to demonstrate the probl…

---

## [Split an Int128 to two Int64](https://discourse.julialang.org/t/split-an-int128-to-two-int64/26625)

<div class="topic-metadata">

**Author:** [@hros](https://discourse.julialang.org/u/hros)\
**Replies:** 2\
**Last updated:** [July 22, 2019, 12:31pm UTC](https://discourse.julialang.org/t/split-an-int128-to-two-int64/26625 "2019-07-22T12:31:46Z")

</div>

Edit: this post started as a question and as a I found an answer turned into a suggestion to update the documentation I have to multiply two Int64 values and split the result into the high and low 64 bit values. This i…

---

## [Nested parallel loop](https://discourse.julialang.org/t/nested-parallel-loop/26623)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 4\
**Last updated:** [July 22, 2019, 10:34am UTC](https://discourse.julialang.org/t/nested-parallel-loop/26623 "2019-07-22T10:34:34Z")

</div>

Is there an easy way, to make the example below work? using Distributed addprocs(3) @sync @distributed (+) for x in collect(1:10), y in collect(1:10) sum(rand(x,y)) end

---

## [Makie interaction: Slider with animation](https://discourse.julialang.org/t/makie-interaction-slider-with-animation/25179)

<div class="topic-metadata">

**Author:** [@neuralian](https://discourse.julialang.org/u/neuralian)\
**Replies:** 10\
**Last updated:** [July 22, 2019, 10:12am UTC](https://discourse.julialang.org/t/makie-interaction-slider-with-animation/25179 "2019-07-22T10:12:19Z")

</div>

(Edited for clarity in the light of feedback (thanks, yakir12) about how to post on this forum) I’m struggling to figure out how to use a slider to interact with an animation in Makie. I’m using v1.1.1 in Atom under W…

---

## [ErrorException("Task cannot be serialized") with TaskWrapper struct](https://discourse.julialang.org/t/errorexception-task-cannot-be-serialized-with-taskwrapper-struct/26617)

<div class="topic-metadata">

**Author:** [@Jasha10](https://discourse.julialang.org/u/Jasha10)\
**Replies:** 3\
**Last updated:** [July 22, 2019, 3:39am UTC](https://discourse.julialang.org/t/errorexception-task-cannot-be-serialized-with-taskwrapper-struct/26617 "2019-07-22T03:39:49Z")

</div>

I’ve got a TaskWrappers.jl package whose source file looks like this. module TaskWrappers struct TaskWrapper task::Task end t = @async sleep(10) example = TaskWrapper(t) end My directory layout is simple: |- Proje…

---

## [Include command inconsistent with isfile result](https://discourse.julialang.org/t/include-command-inconsistent-with-isfile-result/26578)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 17\
**Last updated:** [July 21, 2019, 8:26pm UTC](https://discourse.julialang.org/t/include-command-inconsistent-with-isfile-result/26578 "2019-07-21T20:26:52Z")

</div>

I am having trouble to include a file. More precisely isfile(fi) returns true, but include(fi) errors ERROR: LoadError: could not open file C:\\temp\\a\\SomePackage\\src\\src\\file.jl I created an MWE here. I simply run jul…

---

## [How can I make a package run in its own environment](https://discourse.julialang.org/t/how-can-i-make-a-package-run-in-its-own-environment/26601)

<div class="topic-metadata">

**Author:** [@Chong\_Wang](https://discourse.julialang.org/u/Chong_Wang)\
**Replies:** 5\
**Last updated:** [July 21, 2019, 8:13am UTC](https://discourse.julialang.org/t/how-can-i-make-a-package-run-in-its-own-environment/26601 "2019-07-21T08:13:53Z")

</div>

If I create a package Foo depending on Bar@0.1.0, and the default environment (say, v1.1) has Bar@0.2.0, how can I use the package Foo in the default environment? Here’s what I did: In the environment Foo, I \]add Bar@…

---

## [New behaviour due to an update of the package CSV when using CSV.read](https://discourse.julialang.org/t/new-behaviour-due-to-an-update-of-the-package-csv-when-using-csv-read/26565)

<div class="topic-metadata">

**Author:** [@steph\_de\_paris](https://discourse.julialang.org/u/steph_de_paris)\
**Replies:** 5\
**Last updated:** [July 21, 2019, 7:49am UTC](https://discourse.julialang.org/t/new-behaviour-due-to-an-update-of-the-package-csv-when-using-csv-read/26565 "2019-07-21T07:49:51Z")

</div>

Hello, When the file tmp.csv just contains the string “INFI\_”, the code using CSV data = CSV.read("tmp.csv",header=false,delim=';'); data gives the result 1×1 DataFrames.DataFrame │ Row │ Column1 │ │ │ String …

---

## [What is the main purpose of this hash function in the following code?](https://discourse.julialang.org/t/what-is-the-main-purpose-of-this-hash-function-in-the-following-code/26586)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 2\
**Last updated:** [July 21, 2019, 5:33am UTC](https://discourse.julialang.org/t/what-is-the-main-purpose-of-this-hash-function-in-the-following-code/26586 "2019-07-21T05:33:29Z")

</div>

The following is the code, excerpted from OpenStreetMapX package. I do not quite understand what is the purpose of the hash function here? Based on the help of the hash function from REPL, the hash function hash(x\[, h::U…

---

## [Row and column with multiple plots in VegaLite.jl](https://discourse.julialang.org/t/row-and-column-with-multiple-plots-in-vegalite-jl/26426)

<div class="topic-metadata">

**Author:** [@yanivab](https://discourse.julialang.org/u/yanivab)\
**Replies:** 1\
**Last updated:** [July 20, 2019, 10:03pm UTC](https://discourse.julialang.org/t/row-and-column-with-multiple-plots-in-vegalite-jl/26426 "2019-07-20T22:03:10Z")

</div>

Trying to make a plot with a line and error band, and subplots in rows and columns. However, when I try this: dat |\> @vlplot(row = "sess:o", column = "PID:n") + @vlplot(:errorband, y = "rand\_lb:q", y2 = "rand\_ub:q", x =…

---

## [What is the relation between Array{Int64,1} and AbstractSet{Int64}?](https://discourse.julialang.org/t/what-is-the-relation-between-array-int64-1-and-abstractset-int64/26590)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 1\
**Last updated:** [July 20, 2019, 5:19pm UTC](https://discourse.julialang.org/t/what-is-the-relation-between-array-int64-1-and-abstractset-int64/26590 "2019-07-20T17:19:10Z")

</div>

Hi, the following is the code, which confuses me. function myF( a::AbstractSet{Int} ) for element in a print(element) end end b = Dict( 1 =\> 2, 2 =\> 3, 3 =\>4 ) myF(collec…

---

## [How to understand the following crop! function excerpted from the OpenStreetMapX package?](https://discourse.julialang.org/t/how-to-understand-the-following-crop-function-excerpted-from-the-openstreetmapx-package/26585)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 0\
**Last updated:** [July 20, 2019, 3:12pm UTC](https://discourse.julialang.org/t/how-to-understand-the-following-crop-function-excerpted-from-the-openstreetmapx-package/26585 "2019-07-20T15:12:47Z")

</div>

Hi, I was reading the following function excerpted from OpenStreetMapX package and got a bit confused. Could anyone please let me know how to understand the following function, especially new\_node = OpenStreetMapX.bound…

---

## [Is this superfluous](https://discourse.julialang.org/t/is-this-superfluous/26571)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 5\
**Last updated:** [July 20, 2019, 2:55pm UTC](https://discourse.julialang.org/t/is-this-superfluous/26571 "2019-07-20T14:55:02Z")

</div>

I have seen some code in a package that includes this method: SOME(v::T) where {T} = v Another method of SOME is defined as: SOME(::Type{String}, p::Parser) = String(take!(p.charbuffer)) The first method appears to d…

---

## [Help to build shared library Using PackageCompiler.jl](https://discourse.julialang.org/t/help-to-build-shared-library-using-packagecompiler-jl/23117)

<div class="topic-metadata">

**Author:** [@Ronis\_BR](https://discourse.julialang.org/u/Ronis_BR)\
**Replies:** 5\
**Last updated:** [July 20, 2019, 10:00am UTC](https://discourse.julialang.org/t/help-to-build-shared-library-using-packagecompiler-jl/23117 "2019-07-20T10:00:58Z")

</div>

Hi guys! I need help. I want to build a shared library (.dylib, .dll) so that I can send it with my code to be loaded by another ground in a C++ software. I know that I can use PackageCompiler.jl to build a shared libra…

---

## [HTTP 404 Error when building CxxWrap](https://discourse.julialang.org/t/http-404-error-when-building-cxxwrap/25228)

<div class="topic-metadata">

**Author:** [@Coralie](https://discourse.julialang.org/u/Coralie)\
**Replies:** 1\
**Last updated:** [July 20, 2019, 12:55am UTC](https://discourse.julialang.org/t/http-404-error-when-building-cxxwrap/25228 "2019-07-20T00:55:54Z")

</div>

Hi, I’m trying to install CxxWrap but I have this error: (v1.1) pkg\> add C:\\\\Users\\\\Coralie\\\\CxxWrap.jl Updating git-repo \`C:\\\\Users\\\\Coralie\\\\CxxWrap.jl\` Resolving package versions... Updating \`C:\\Users\\Coralie\\.…

---

## [Trouble importing a module that depends on another globally imported module](https://discourse.julialang.org/t/trouble-importing-a-module-that-depends-on-another-globally-imported-module/26482)

<div class="topic-metadata">

**Author:** [@zachmatson](https://discourse.julialang.org/u/zachmatson)\
**Replies:** 9\
**Last updated:** [July 19, 2019, 9:53pm UTC](https://discourse.julialang.org/t/trouble-importing-a-module-that-depends-on-another-globally-imported-module/26482 "2019-07-19T21:53:16Z")

</div>

I have a project which is structured like: Connect4Solver: -\>Connect4Board.jl -\>MCTS.jl Connect4Board.jl defines a module Connect4Board which defines a type Board. MCTS.jl defines a module MCTS which imports Connect4B…

---

## [Puzzled by the difference in performance when summing an array in different ways](https://discourse.julialang.org/t/puzzled-by-the-difference-in-performance-when-summing-an-array-in-different-ways/26555)

<div class="topic-metadata">

**Author:** [@Nicolas\_Gagne](https://discourse.julialang.org/u/Nicolas_Gagne)\
**Replies:** 4\
**Last updated:** [July 19, 2019, 6:59pm UTC](https://discourse.julialang.org/t/puzzled-by-the-difference-in-performance-when-summing-an-array-in-different-ways/26555 "2019-07-19T18:59:12Z")

</div>

Hi everybody, While trying to test my understanding of “views vs slice of arrays” and “row-major vs column major”, I time (using @time) the following functions : A = rand(10000,10000); function sum\_1(x) counter = 0…

---

## [Terminology confusion: environment vs project](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547)

<div class="topic-metadata">

**Author:** [@ianfiske](https://discourse.julialang.org/u/ianfiske)\
**Replies:** 5\
**Last updated:** [July 19, 2019, 6:50pm UTC](https://discourse.julialang.org/t/terminology-confusion-environment-vs-project/26547 "2019-07-19T18:50:44Z")

</div>

Hi, I’ve been using Julia’s Pkg for almost a year with plenty of success. However, I’m giving a presentation at my workplace on Julia workflow and package development next week and realized that I’m pretty confused abou…

---

## [Making plots with background bands](https://discourse.julialang.org/t/making-plots-with-background-bands/26549)

<div class="topic-metadata">

**Author:** [@gerycruz](https://discourse.julialang.org/u/gerycruz)\
**Replies:** 0\
**Last updated:** [July 19, 2019, 4:20pm UTC](https://discourse.julialang.org/t/making-plots-with-background-bands/26549 "2019-07-19T16:20:08Z")

</div>

I’m trying to plot something similar to the leftmost plot in the image below. With the horizontal bands defined by y-axis values. Specifically, I want to do three bands one from Y1 to Y2, one from Y2 to Y3, and the last …

---

## [Fluctuations when measuring execution time of linear algebra code](https://discourse.julialang.org/t/fluctuations-when-measuring-execution-time-of-linear-algebra-code/26385)

<div class="topic-metadata">

**Author:** [@henrik227](https://discourse.julialang.org/u/henrik227)\
**Replies:** 12\
**Last updated:** [July 19, 2019, 2:07pm UTC](https://discourse.julialang.org/t/fluctuations-when-measuring-execution-time-of-linear-algebra-code/26385 "2019-07-19T14:07:08Z")

</div>

I’m trying to measure the execution time of linear algebra expressions, and I’m seeing strange patterns in the results. This is a MWE that reproduces this behavior for me: using DelimitedFiles using LinearAlgebra BLAS.s…

---

## [GTK: AssertionError: xor(prev, current\_task() !== g\_stack)](https://discourse.julialang.org/t/gtk-assertionerror-xor-prev-current-task-g-stack/26519)

<div class="topic-metadata">

**Author:** [@pixel27](https://discourse.julialang.org/u/pixel27)\
**Replies:** 2\
**Last updated:** [July 19, 2019, 1:25pm UTC](https://discourse.julialang.org/t/gtk-assertionerror-xor-prev-current-task-g-stack/26519 "2019-07-19T13:25:59Z")

</div>

I’m getting this exception when calling GAccessor.text(buffer, "", -1) while handling an file-activated signal. I’ve spent the last 2 hours trying to recreate it with a single example, and so far I cannot reproduce it. …

---

## [How to generate methods based on different types of the parameter?](https://discourse.julialang.org/t/how-to-generate-methods-based-on-different-types-of-the-parameter/26530)

<div class="topic-metadata">

**Author:** [@singularitti](https://discourse.julialang.org/u/singularitti)\
**Replies:** 4\
**Last updated:** [July 19, 2019, 9:43am UTC](https://discourse.julialang.org/t/how-to-generate-methods-based-on-different-types-of-the-parameter/26530 "2019-07-19T09:43:47Z")

</div>

For example, I have the following code using FilePaths macro iostream\_to\_lines(methodname) return quote function $methodname(io::IOStream) $methodname(readlines(io)) end end end # m…

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

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