# General Usage

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

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

**Page:** 721

---

## [Emacsclient doesn't work with @edit](https://discourse.julialang.org/t/emacsclient-doesnt-work-with-edit/43673)

<div class="topic-metadata">

**Author:** [@NightMachinary](https://discourse.julialang.org/u/NightMachinary)\
**Replies:** 8\
**Last updated:** [July 31, 2020, 3:26pm UTC](https://discourse.julialang.org/t/emacsclient-doesnt-work-with-edit/43673 "2020-07-31T15:26:38Z")

</div>

I have tried setting EDITOR and VISUAL to emacsclient -t, and to point to this wrapper: #!/usr/bin/env dash emacsclient -t "$@" But they don’t work. I get this error when I try @edit someFunc(): emacsclient: could no…

---

## [Pinning package without updating other packages](https://discourse.julialang.org/t/pinning-package-without-updating-other-packages/43900)

<div class="topic-metadata">

**Author:** [@manweic](https://discourse.julialang.org/u/manweic)\
**Replies:** 8\
**Last updated:** [July 31, 2020, 1:02pm UTC](https://discourse.julialang.org/t/pinning-package-without-updating-other-packages/43900 "2020-07-31T13:02:50Z")

</div>

Hi, I’m building off of someone else’s project, so I use their Manifest and Project files. I want to pin the dependencies to prevent it from breaking in the future. However, when I use the pin command, it installs and u…

---

## [Efficient parsing of arrays of arrays of arrays or arbitrary number of arrays of arrays?](https://discourse.julialang.org/t/efficient-parsing-of-arrays-of-arrays-of-arrays-or-arbitrary-number-of-arrays-of-arrays/43972)

<div class="topic-metadata">

**Author:** [@Marcell\_Havlik](https://discourse.julialang.org/u/Marcell_Havlik)\
**Replies:** 7\
**Last updated:** [July 31, 2020, 11:56am UTC](https://discourse.julialang.org/t/efficient-parsing-of-arrays-of-arrays-of-arrays-or-arbitrary-number-of-arrays-of-arrays/43972 "2020-07-31T11:56:04Z")

</div>

Hey Julianers, I parsed a JSON file with JSON2.jl and now I have to postprocess the results it into an Array{Array{Float32, N},1}. The problem is that, the JSON parsed struct is an arrays of arrays of arrays of … and so…

---

## [Promotion for arithmetic operations on @enum types](https://discourse.julialang.org/t/promotion-for-arithmetic-operations-on-enum-types/43881)

<div class="topic-metadata">

**Author:** [@disberd](https://discourse.julialang.org/u/disberd)\
**Replies:** 8\
**Last updated:** [July 31, 2020, 11:04am UTC](https://discourse.julialang.org/t/promotion-for-arithmetic-operations-on-enum-types/43881 "2020-07-31T11:04:05Z")

</div>

if I have an @enum defined like this: @enum CircPolType RightPol=1 LeftPol=-1, And would like to then uses instances RightPol and LeftPol directly with their integer values in mathematical operations without having to w…

---

## [Broadcasting not on all arguments](https://discourse.julialang.org/t/broadcasting-not-on-all-arguments/44027)

<div class="topic-metadata">

**Author:** [@drhouse82](https://discourse.julialang.org/u/drhouse82)\
**Replies:** 1\
**Last updated:** [July 31, 2020, 10:06am UTC](https://discourse.julialang.org/t/broadcasting-not-on-all-arguments/44027 "2020-07-31T10:06:38Z")

</div>

I find myself thinking in common OOP terms and trying to have object representing a model that has some method to do something to outside data. So I thought, in Julia, the model should likely be a struct and the method …

---

## [How to print exceptions with multiple @async tasks](https://discourse.julialang.org/t/how-to-print-exceptions-with-multiple-async-tasks/43992)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 0\
**Last updated:** [July 30, 2020, 4:56pm UTC](https://discourse.julialang.org/t/how-to-print-exceptions-with-multiple-async-tasks/43992 "2020-07-30T16:56:34Z")

</div>

Say I have two @async long-running tasks. How can I know if one of them throws an exception? For example, no error message is ever printed from @sync begin @async error() @async while true sleep(1) end end EDIT: …

---

## [DataFrame row to Dict](https://discourse.julialang.org/t/dataframe-row-to-dict/44003)

<div class="topic-metadata">

**Author:** [@Samuel\_Collie](https://discourse.julialang.org/u/Samuel_Collie)\
**Replies:** 5\
**Last updated:** [July 30, 2020, 8:08pm UTC](https://discourse.julialang.org/t/dataframe-row-to-dict/44003 "2020-07-30T20:08:13Z")

</div>

I’d like to query a row of a DataFrame and return the result as a Dict. I was able to do it but the code isn’t pretty (converting Python programmer here). Here is a MWE: Input DataFrame: DataFrame(name=\["John", "Sally"…

---

## [At a glance, why don't I have better performances between Julia and PHP?](https://discourse.julialang.org/t/at-a-glance-why-dont-i-have-better-performances-between-julia-and-php/43804)

<div class="topic-metadata">

**Author:** [@Darione](https://discourse.julialang.org/u/Darione)\
**Replies:** 24\
**Last updated:** [July 30, 2020, 5:41pm UTC](https://discourse.julialang.org/t/at-a-glance-why-dont-i-have-better-performances-between-julia-and-php/43804 "2020-07-30T17:41:16Z")

</div>

Hi everyone! I manage an automatic warehouse, where there are trays with a certain number of items inside. I was trying to do a count with Julia, elaborating some csv files that I export from my management and that repr…

---

## [Why is my @animate loop super slow?](https://discourse.julialang.org/t/why-is-my-animate-loop-super-slow/43685)

<div class="topic-metadata">

**Author:** [@aramirezreyes](https://discourse.julialang.org/u/aramirezreyes)\
**Replies:** 9\
**Last updated:** [July 30, 2020, 6:30pm UTC](https://discourse.julialang.org/t/why-is-my-animate-loop-super-slow/43685 "2020-07-30T18:30:40Z")

</div>

Hi! I’m trying to understand why is the using the Plots.jl @animate macro slower than plotting and saving many times. I destilled my real case into this hopefully MWE. I have a function that creates a plot with several…

---

## [Mapreduce dataframe columns elementwise AND](https://discourse.julialang.org/t/mapreduce-dataframe-columns-elementwise-and/43982)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 2\
**Last updated:** [July 30, 2020, 6:17pm UTC](https://discourse.julialang.org/t/mapreduce-dataframe-columns-elementwise-and/43982 "2020-07-30T18:17:10Z")

</div>

Is there a specific reason why I need to define myop in the snippet below? Otherwise things do not work for me. using DataFrames dff=DataFrame(a=trues(4),b=trues(4),c=2\*ones(4)) cnms = \[:a, :b\] #fails mapreduce(x-\>d…

---

## [DataFrames: hcat](https://discourse.julialang.org/t/dataframes-hcat/43928)

<div class="topic-metadata">

**Author:** [@bsmith](https://discourse.julialang.org/u/bsmith)\
**Replies:** 3\
**Last updated:** [July 30, 2020, 5:59pm UTC](https://discourse.julialang.org/t/dataframes-hcat/43928 "2020-07-30T17:59:51Z")

</div>

Sorry for the newbie question. I want to do a hcat with a dataframe and an array, such that the column name is the name of the vector (rather than the default ‘X1’): df = DataFrame(A = 1:4, B = \[2,4,3,5 \]) newCol = \[7,8…

---

## [Is there a newer version of a package?](https://discourse.julialang.org/t/is-there-a-newer-version-of-a-package/43986)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 4\
**Last updated:** [July 30, 2020, 4:37pm UTC](https://discourse.julialang.org/t/is-there-a-newer-version-of-a-package/43986 "2020-07-30T16:37:25Z")

</div>

Is there a way of finding out when updating (\]up) that newer versions of packages are available? I found that if one does not proactively delete the compatibility section in the Project.toml file and runs update from ti…

---

## [Performance problem to apply a set of functions to one data](https://discourse.julialang.org/t/performance-problem-to-apply-a-set-of-functions-to-one-data/43974)

<div class="topic-metadata">

**Author:** [@Ronneesley](https://discourse.julialang.org/u/Ronneesley)\
**Replies:** 3\
**Last updated:** [July 30, 2020, 1:30pm UTC](https://discourse.julialang.org/t/performance-problem-to-apply-a-set-of-functions-to-one-data/43974 "2020-07-30T13:30:07Z")

</div>

Hello, When we have a variable number of functions fs = \[f\_1, f\_2, ..., f\_3\] and we want to apply these functions to only one value of x. I’m struggling with performance problems. See: julia\> f1(x) = x^2 julia\> f2(x) =…

---

## [Importing a system image dll with c#/c++/c](https://discourse.julialang.org/t/importing-a-system-image-dll-with-c-c-c/43836)

<div class="topic-metadata">

**Author:** [@joschv](https://discourse.julialang.org/u/joschv)\
**Replies:** 3\
**Last updated:** [July 30, 2020, 12:02pm UTC](https://discourse.julialang.org/t/importing-a-system-image-dll-with-c-c-c/43836 "2020-07-30T12:02:36Z")

</div>

Greetings! I am trying to embed Julia code using C# (or C/C++) and a generated Julia System Image (DLL, on Windows). The system image contains a few (selfmade) functions i am trying to call from C#. These are decorated …

---

## [ERROR using StataCall.jl](https://discourse.julialang.org/t/error-using-statacall-jl/43968)

<div class="topic-metadata">

**Author:** [@Lucius\_Cornelius\_Min](https://discourse.julialang.org/u/Lucius_Cornelius_Min)\
**Replies:** 0\
**Last updated:** [July 30, 2020, 11:48am UTC](https://discourse.julialang.org/t/error-using-statacall-jl/43968 "2020-07-30T11:48:57Z")

</div>

Hi I am getting errors when using StataCall: julia\> using StataCall julia\> df = DataFrame(myint = Int64.(floor.(100 .\* rand(Float64, 10))), myfloat = rand(Float64, 10)) julia\> instructions = \[“gen newvar1 = myint + my…

---

## [Running a code for multiple values of the same variable](https://discourse.julialang.org/t/running-a-code-for-multiple-values-of-the-same-variable/43843)

<div class="topic-metadata">

**Author:** [@marouane1994](https://discourse.julialang.org/u/marouane1994)\
**Replies:** 4\
**Last updated:** [July 30, 2020, 9:35am UTC](https://discourse.julialang.org/t/running-a-code-for-multiple-values-of-the-same-variable/43843 "2020-07-30T09:35:28Z")

</div>

I wanna know if there is a simple way to run a code containing a variable x that should take more than one value and then store these values with the outputs of the code, for example x takes more than one value like 1 an…

---

## [Different program outputs under the same Random.seed!](https://discourse.julialang.org/t/different-program-outputs-under-the-same-random-seed/43923)

<div class="topic-metadata">

**Author:** [@Ken\_Lin](https://discourse.julialang.org/u/Ken_Lin)\
**Replies:** 2\
**Last updated:** [July 30, 2020, 9:24am UTC](https://discourse.julialang.org/t/different-program-outputs-under-the-same-random-seed/43923 "2020-07-30T09:24:26Z")

</div>

I have a Julia program that sometimes produces different results even if I set Random.seed!(1234). What could be the reasons? Here is one possible reason I have found: In my program, I’m using a function c(x) from a pac…

---

## [Creating ranges from findall](https://discourse.julialang.org/t/creating-ranges-from-findall/43885)

<div class="topic-metadata">

**Author:** [@HelgavonLichtenstein](https://discourse.julialang.org/u/HelgavonLichtenstein)\
**Replies:** 4\
**Last updated:** [July 30, 2020, 8:59am UTC](https://discourse.julialang.org/t/creating-ranges-from-findall/43885 "2020-07-30T08:59:09Z")

</div>

Do you know of a way to turn the results of findall into Vector{UnitRange{Int64}}? searching = DataFrame(A = 1:5:1000) searching\_specific = searching\[:,:A\] findall(x -\> isodd(x), searching\_specific) The results look …

---

## [Matrix-vector multiplication slower than a 'naive' for loop?](https://discourse.julialang.org/t/matrix-vector-multiplication-slower-than-a-naive-for-loop/43910)

<div class="topic-metadata">

**Author:** [@barankarakus](https://discourse.julialang.org/u/barankarakus)\
**Replies:** 7\
**Last updated:** [July 30, 2020, 8:29am UTC](https://discourse.julialang.org/t/matrix-vector-multiplication-slower-than-a-naive-for-loop/43910 "2020-07-30T08:29:20Z")

</div>

Hi, I’m new to Julia and have been playing around with it to test its performance claims. I am looking to multiply a matrix X by a sparse vector β, generated via the following code: n = 500 p = 100000 β = rand(p); z…

---

## [Failed to precompile Pkg because Quat not defined](https://discourse.julialang.org/t/failed-to-precompile-pkg-because-quat-not-defined/43897)

<div class="topic-metadata">

**Author:** [@wangyubin11](https://discourse.julialang.org/u/wangyubin11)\
**Replies:** 2\
**Last updated:** [July 30, 2020, 8:18am UTC](https://discourse.julialang.org/t/failed-to-precompile-pkg-because-quat-not-defined/43897 "2020-07-30T08:18:23Z")

</div>

I try to use the branch of Pkg，but actually stuck in this trouble. It is a problem of the Pkg itself? I definitely guess that global variable causes the mistake . Any tips? Thank u :heart:

---

## [Plots -- bug in LaTeX symbol of PyPlot?](https://discourse.julialang.org/t/plots-bug-in-latex-symbol-of-pyplot/43889)

<div class="topic-metadata">

**Author:** [@BLI](https://discourse.julialang.org/u/BLI)\
**Replies:** 2\
**Last updated:** [July 30, 2020, 8:18am UTC](https://discourse.julialang.org/t/plots-bug-in-latex-symbol-of-pyplot/43889 "2020-07-30T08:18:06Z")

</div>

I want to “check” a symbol in Plots legends, e.g., \\check{S}. However, in plots generated by Julia with PyPlot back-end, this appears as: If I replace “check” with, say, “hat”, \\hat{S}, the symbol is rendered correctl…

---

## [How to migrate old julia code that called a function with a range](https://discourse.julialang.org/t/how-to-migrate-old-julia-code-that-called-a-function-with-a-range/43944)

<div class="topic-metadata">

**Author:** [@Peeter\_Joot](https://discourse.julialang.org/u/Peeter_Joot)\
**Replies:** 3\
**Last updated:** [July 30, 2020, 3:40am UTC](https://discourse.julialang.org/t/how-to-migrate-old-julia-code-that-called-a-function-with-a-range/43944 "2020-07-30T03:40:41Z")

</div>

I’d used some really old versions of julia circa 2015, and recently installed 1.4.2 to play around with the current version. I used to be able to compute arrays of function call values (at least for some types of functi…

---

## [Changing values and type of JuliaDB column](https://discourse.julialang.org/t/changing-values-and-type-of-juliadb-column/43921)

<div class="topic-metadata">

**Author:** [@john\_b](https://discourse.julialang.org/u/john_b)\
**Replies:** 0\
**Last updated:** [July 29, 2020, 8:46pm UTC](https://discourse.julialang.org/t/changing-values-and-type-of-juliadb-column/43921 "2020-07-29T20:46:06Z")

</div>

As a newcomer to Julia and JuliaDB, I have a simple question. Given a JuliaDB table, how would I map a function to a column that changes the column values and type? For example: import JuliaDB import Dates function col…

---

## [Error Read File after package update](https://discourse.julialang.org/t/error-read-file-after-package-update/33861)

<div class="topic-metadata">

**Author:** [@alequa](https://discourse.julialang.org/u/alequa)\
**Replies:** 6\
**Last updated:** [July 30, 2020, 12:16am UTC](https://discourse.julialang.org/t/error-read-file-after-package-update/33861 "2020-07-30T00:16:09Z")

</div>

Hi, after Pkg.update() in Julia v1.3.1 I had issues during recompiling of whichever package, for example: Precompiling Plots \[91a5bcdd-55d7-5caf-9e0b-520d859cae80\] ERROR: LoadError: EOFError: read end of file Stack…

---

## [@enum persistence in Pluto.jl](https://discourse.julialang.org/t/enum-persistence-in-pluto-jl/43703)

<div class="topic-metadata">

**Author:** [@perseid28](https://discourse.julialang.org/u/perseid28)\
**Replies:** 9\
**Last updated:** [July 29, 2020, 6:59pm UTC](https://discourse.julialang.org/t/enum-persistence-in-pluto-jl/43703 "2020-07-29T18:59:18Z")

</div>

When using a Pluto notebook, I realised that I cannot modify an @enum that I have created, either in the same or other cell. For example, executing a cell with: @enum myRainbow R=1 O Y G B I V followed by executing thi…

---

## [Why is functor slower than eval'ed function?](https://discourse.julialang.org/t/why-is-functor-slower-than-evaled-function/43840)

<div class="topic-metadata">

**Author:** [@kevbonham](https://discourse.julialang.org/u/kevbonham)\
**Replies:** 8\
**Last updated:** [July 29, 2020, 2:48pm UTC](https://discourse.julialang.org/t/why-is-functor-slower-than-evaled-function/43840 "2020-07-29T14:48:25Z")

</div>

I have a situation where I’d like to build some functions based on different inputs - using a callable function seems really clear to me, and has the functionality I want. I’d rather not use eval and other metaprogrammin…

---

## [Is there a package for package info?](https://discourse.julialang.org/t/is-there-a-package-for-package-info/43875)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 0\
**Last updated:** [July 29, 2020, 12:05pm UTC](https://discourse.julialang.org/t/is-there-a-package-for-package-info/43875 "2020-07-29T12:05:16Z")

</div>

As a packakge developer I often want to find out if the dependencies of my packakge is at the latest version as I want to support the latest features. CompatHelper.jl helps but I still feel something is missing. Is ther…

---

## [Fuzzy inexact merge](https://discourse.julialang.org/t/fuzzy-inexact-merge/43666)

<div class="topic-metadata">

**Author:** [@bernhard](https://discourse.julialang.org/u/bernhard)\
**Replies:** 5\
**Last updated:** [July 29, 2020, 11:04am UTC](https://discourse.julialang.org/t/fuzzy-inexact-merge/43666 "2020-07-29T11:04:38Z")

</div>

I am looking for a tool/approach to perform an inexact merge. I have two (or more) dataframes with datetime columns (and value columns) that do not correspond. I imagine specifying a tolerance value (say 5 minutes) for …

---

## [Understanding IR representation and argument values](https://discourse.julialang.org/t/understanding-ir-representation-and-argument-values/43863)

<div class="topic-metadata">

**Author:** [@mespinosami](https://discourse.julialang.org/u/mespinosami)\
**Replies:** 0\
**Last updated:** [July 29, 2020, 9:32am UTC](https://discourse.julialang.org/t/understanding-ir-representation-and-argument-values/43863 "2020-07-29T09:32:51Z")

</div>

I am trying to understand how the IR representation exactly works and its structure. More specifically, would like to know if it is possible to access the values of the arguments passed to a function through the IR. Say…

---

## [Different ways to initialize an array of specified type](https://discourse.julialang.org/t/different-ways-to-initialize-an-array-of-specified-type/43818)

<div class="topic-metadata">

**Author:** [@anon37204545](https://discourse.julialang.org/u/anon37204545)\
**Replies:** 10\
**Last updated:** [July 29, 2020, 8:09am UTC](https://discourse.julialang.org/t/different-ways-to-initialize-an-array-of-specified-type/43818 "2020-07-29T08:09:05Z")

</div>

Let’s benchmark the following three: julia\> function a() x = Vector{Int}() x end a (generic function with 1 method) julia\> function b() x::Vector{Int} = \[\] x en…

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

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