# General Usage

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

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

**Page:** 767

---

## [Problem: extracting a row from an array, returns a column](https://discourse.julialang.org/t/problem-extracting-a-row-from-an-array-returns-a-column/37331)

<div class="topic-metadata">

**Author:** [@AIRoebl](https://discourse.julialang.org/u/AIRoebl)\
**Replies:** 13\
**Last updated:** [April 11, 2020, 9:11pm UTC](https://discourse.julialang.org/t/problem-extracting-a-row-from-an-array-returns-a-column/37331 "2020-04-11T21:11:41Z")

</div>

In Julia 1.4.0, attempting to extract a row from an array returns a vector/column, and not a row. From array: N = \[1 2;3 4\] 2×2 Array{Int64,2}: 1 2 3 4 N\[1,:\] 2-element Array{Int64,1}: 1 2 It returns a colum…

---

## [Extracting kwargs from anonymous function](https://discourse.julialang.org/t/extracting-kwargs-from-anonymous-function/37350)

<div class="topic-metadata">

**Author:** [@pablosanjose](https://discourse.julialang.org/u/pablosanjose)\
**Replies:** 12\
**Last updated:** [April 11, 2020, 4:08pm UTC](https://discourse.julialang.org/t/extracting-kwargs-from-anonymous-function/37350 "2020-04-11T16:08:44Z")

</div>

EDIT: original title was “Confused about escaping in macros” I’m trying metaprogramming in Julia for the first time, and I’m having some trouble grasping the escaping and hygiene discussion in the manual. I’m trying to…

---

## [Can not add new packages on Manjaro Linux](https://discourse.julialang.org/t/can-not-add-new-packages-on-manjaro-linux/37373)

<div class="topic-metadata">

**Author:** [@Tofi](https://discourse.julialang.org/u/Tofi)\
**Replies:** 8\
**Last updated:** [April 11, 2020, 12:45pm UTC](https://discourse.julialang.org/t/can-not-add-new-packages-on-manjaro-linux/37373 "2020-04-11T12:45:14Z")

</div>

I just installed Julia 1.4 from the Manjaro Linux repository. When I try to add new packages to Julia, I get an error message: (@v1.4) pkg\> add Plots Cloning default registries into \`~/.julia\` Cloning registry f…

---

## [How to test the value of a variable from info log](https://discourse.julialang.org/t/how-to-test-the-value-of-a-variable-from-info-log/37380)

<div class="topic-metadata">

**Author:** [@tk3369](https://discourse.julialang.org/u/tk3369)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 7:27am UTC](https://discourse.julialang.org/t/how-to-test-the-value-of-a-variable-from-info-log/37380 "2020-04-11T07:27:00Z")

</div>

Is there any way to test the appearance of a string inside one of the variables being printed from @info? In the example below, I want to test the string world appearing in the info log. I don’t really care where it ap…

---

## [What did I do wrong with LAPACK.potri!?](https://discourse.julialang.org/t/what-did-i-do-wrong-with-lapack-potri/37293)

<div class="topic-metadata">

**Author:** [@kai](https://discourse.julialang.org/u/kai)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 7:15am UTC](https://discourse.julialang.org/t/what-did-i-do-wrong-with-lapack-potri/37293 "2020-04-11T07:15:49Z")

</div>

Somehow potri is not giving me the inverse. What did I do wrong? Here is an example: using LinearAlgebra, Random Random.seed!(1) x = rand(5, 5) V = x'x LinearAlgebra.copytri!(V, 'U') Vcopy = rand(5, 5) copyto!(Vcopy, V…

---

## [Magic incantations to make a local module work](https://discourse.julialang.org/t/magic-incantations-to-make-a-local-module-work/36994)

<div class="topic-metadata">

**Author:** [@lewis](https://discourse.julialang.org/u/lewis)\
**Replies:** 10\
**Last updated:** [April 11, 2020, 6:42am UTC](https://discourse.julialang.org/t/magic-incantations-to-make-a-local-module-work/36994 "2020-04-11T06:42:29Z")

</div>

I have some complex code that makes more sense as a module. I have done this before with 2 other “local”–as in in my file system–modules and everything works fine. This one just won’t work. The filename and the module…

---

## [Running task on background thread slows performance and increases jitter](https://discourse.julialang.org/t/running-task-on-background-thread-slows-performance-and-increases-jitter/37320)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 2\
**Last updated:** [April 11, 2020, 12:34am UTC](https://discourse.julialang.org/t/running-task-on-background-thread-slows-performance-and-increases-jitter/37320 "2020-04-11T00:34:15Z")

</div>

I’ve been testing to see if Julia is appropriate for recording high volumes of market data arriving over the network with precise timestamps. I ran the simple loop below to simulate parsing strings and to create a littl…

---

## [Best way to parse custom formatted text file](https://discourse.julialang.org/t/best-way-to-parse-custom-formatted-text-file/37069)

<div class="topic-metadata">

**Author:** [@jonjilla](https://discourse.julialang.org/u/jonjilla)\
**Replies:** 3\
**Last updated:** [April 10, 2020, 8:13pm UTC](https://discourse.julialang.org/t/best-way-to-parse-custom-formatted-text-file/37069 "2020-04-10T20:13:47Z")

</div>

Hello I’m trying to parse a custom text file. It looks like the CSV.File command works well, but because of the custom nature of the file, that has a lot of extraneous text, I have to first read the file into memory, fi…

---

## [Problem with grid of plots in StatsPlots](https://discourse.julialang.org/t/problem-with-grid-of-plots-in-statsplots/37362)

<div class="topic-metadata">

**Author:** [@Christopher\_Fisher](https://discourse.julialang.org/u/Christopher_Fisher)\
**Replies:** 2\
**Last updated:** [April 10, 2020, 7:20pm UTC](https://discourse.julialang.org/t/problem-with-grid-of-plots-in-statsplots/37362 "2020-04-10T19:20:29Z")

</div>

I encountered a problem generating a grid of plots with StatsPlots. Here is a MWE. The x and y ranges are incorrect in the 2nd and 3rd rows: using DataFrames, StatsPlots title = \[string("f1: ",i," ","f2: ",j) for i in…

---

## [Rewriting Python code using Images.jl](https://discourse.julialang.org/t/rewriting-python-code-using-images-jl/37323)

<div class="topic-metadata">

**Author:** [@Christian](https://discourse.julialang.org/u/Christian)\
**Replies:** 2\
**Last updated:** [April 10, 2020, 5:38pm UTC](https://discourse.julialang.org/t/rewriting-python-code-using-images-jl/37323 "2020-04-10T17:38:10Z")

</div>

Hello, I’m trying to convert some Python to Julia but I’m having an issue with the following lines. The code takes an array of gradients (all with nxm dims) and returns the median gradient (in nxm dims). In Python the…

---

## [Problem with random generator](https://discourse.julialang.org/t/problem-with-random-generator/37311)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 8\
**Last updated:** [April 10, 2020, 5:04pm UTC](https://discourse.julialang.org/t/problem-with-random-generator/37311 "2020-04-10T17:04:24Z")

</div>

I’m completely puzzled with a problem concerning my code: using LinearAlgebra using DeterminantalPointProcesses L=Symmetric(rand(100,100)) variables=collect(1:100) dpp=DPP(eigen(L)) M0=rand(dpp,1) function proposal(Mt:…

---

## [Join Deprecation Warning Pairs](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329)

<div class="topic-metadata">

**Author:** [@compleat](https://discourse.julialang.org/u/compleat)\
**Replies:** 4\
**Last updated:** [April 10, 2020, 3:47pm UTC](https://discourse.julialang.org/t/join-deprecation-warning-pairs/37329 "2020-04-10T15:47:14Z")

</div>

I have been using ‘join’ in accordance with the example given on https://juliadata.github.io/DataFrames.jl/stable/man/joins/ julia\> join(a, b, on = \[(:City, :Location), (:Job, :Work)\]) Which seems straightforward enou…

---

## [What package\[s\] are state-of-the art OR attract you to Julia, and make you stay there (not easily replicateable in e.g. Python, R, MATLAB)?](https://discourse.julialang.org/t/what-package-s-are-state-of-the-art-or-attract-you-to-julia-and-make-you-stay-there-not-easily-replicateable-in-e-g-python-r-matlab/11294)

<div class="topic-metadata">

**Author:** [@Palli](https://discourse.julialang.org/u/Palli)\
**Replies:** 61\
**Last updated:** [April 10, 2020, 3:09pm UTC](https://discourse.julialang.org/t/what-package-s-are-state-of-the-art-or-attract-you-to-julia-and-make-you-stay-there-not-easily-replicateable-in-e-g-python-r-matlab/11294 "2020-04-10T15:09:44Z")

</div>

You tend to see Julia described as “immature” “but developing very fast”. I believe “immature” is just not correct, when applied to the language, nor it seems to the package ecosystem. I think Julia may just need more …

---

## [Error using Agents.jl](https://discourse.julialang.org/t/error-using-agents-jl/37314)

<div class="topic-metadata">

**Author:** [@ennvvy](https://discourse.julialang.org/u/ennvvy)\
**Replies:** 8\
**Last updated:** [April 10, 2020, 11:24am UTC](https://discourse.julialang.org/t/error-using-agents-jl/37314 "2020-04-10T11:24:38Z")

</div>

I am trying to simulate the example that is published in the documentation of Agents.jl - Continuous Space Social Distancing for COVID 19. Despite installing the required packages, I still get the following error, ERROR…

---

## [Current timestamp with microsecond precision](https://discourse.julialang.org/t/current-timestamp-with-microsecond-precision/37317)

<div class="topic-metadata">

**Author:** [@robsmith11](https://discourse.julialang.org/u/robsmith11)\
**Replies:** 1\
**Last updated:** [April 10, 2020, 9:22am UTC](https://discourse.julialang.org/t/current-timestamp-with-microsecond-precision/37317 "2020-04-10T09:22:40Z")

</div>

I’m recording events arriving over the network and would like a little more precision than milliseconds. Dates.now() only provides a milliscond timestamp. Has anyone already written a function to wrap the Linux system …

---

## [How to configure IP address in Franklin.jl](https://discourse.julialang.org/t/how-to-configure-ip-address-in-franklin-jl/37312)

<div class="topic-metadata">

**Author:** [@Sijun](https://discourse.julialang.org/u/Sijun)\
**Replies:** 4\
**Last updated:** [April 10, 2020, 8:49am UTC](https://discourse.julialang.org/t/how-to-configure-ip-address-in-franklin-jl/37312 "2020-04-10T08:49:19Z")

</div>

First of all, thanks to creators of Franklin.jl (https://franklinjl.org/) for the wonderful package. I would like to know how to configure server IP address. The method serve() takes port number but I can’t find in the …

---

## [How to draw a pixel in Julia Graphics?](https://discourse.julialang.org/t/how-to-draw-a-pixel-in-julia-graphics/37316)

<div class="topic-metadata">

**Author:** [@Neeraj\_Verma\_ASETRAI](https://discourse.julialang.org/u/Neeraj_Verma_ASETRAI)\
**Replies:** 1\
**Last updated:** [April 10, 2020, 7:55am UTC](https://discourse.julialang.org/t/how-to-draw-a-pixel-in-julia-graphics/37316 "2020-04-10T07:55:58Z")

</div>

How to draw a pixel in Julia Graphics? eg - in C programming we draw a pixel by function putpixel(x,y) which modules or Pkg i need to install please help me I am using Plots Pkg and GR as backend

---

## [Benchmarking Julia vs. Python vs. R with PyCall and RCall](https://discourse.julialang.org/t/benchmarking-julia-vs-python-vs-r-with-pycall-and-rcall/37308)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 3\
**Last updated:** [April 10, 2020, 7:09am UTC](https://discourse.julialang.org/t/benchmarking-julia-vs-python-vs-r-with-pycall-and-rcall/37308 "2020-04-10T07:09:58Z")

</div>

I’m putting together an Intro to Julia Jupyter notebook and in my section on Why you should learn Julia I’m emphasizing Julia’s performance. This notebook is for colleagues of mine who primarily use R and a few that use …

---

## [Lazy database join](https://discourse.julialang.org/t/lazy-database-join/37304)

<div class="topic-metadata">

**Author:** [@e3c6](https://discourse.julialang.org/u/e3c6)\
**Replies:** 4\
**Last updated:** [April 10, 2020, 6:54am UTC](https://discourse.julialang.org/t/lazy-database-join/37304 "2020-04-10T06:54:05Z")

</div>

I have a very large database A, and a much smaller one B. Since A is so large, I cannot load it in memory at once. I keep A as a gzip compressed CSV file on disk, and I want to load it lazily. On the other hand B is smal…

---

## [Send output of show to file](https://discourse.julialang.org/t/send-output-of-show-to-file/37287)

<div class="topic-metadata">

**Author:** [@harven](https://discourse.julialang.org/u/harven)\
**Replies:** 1\
**Last updated:** [April 9, 2020, 10:59pm UTC](https://discourse.julialang.org/t/send-output-of-show-to-file/37287 "2020-04-09T22:59:41Z")

</div>

How do I send the output of show to a file? I tried the following with several mime types without success. julia\> open("file.jl", "w") do io show(io, MIME"plain/text", \[\[1,2\],\[3,4\]\]) end

---

## [Keeping Up With The Cartesians - Findall Return Type](https://discourse.julialang.org/t/keeping-up-with-the-cartesians-findall-return-type/37298)

<div class="topic-metadata">

**Author:** [@blackeneth](https://discourse.julialang.org/u/blackeneth)\
**Replies:** 4\
**Last updated:** [April 9, 2020, 9:31pm UTC](https://discourse.julialang.org/t/keeping-up-with-the-cartesians-findall-return-type/37298 "2020-04-09T21:31:29Z")

</div>

I was writing Julia code yesterday and came across a bug in my code – the return from findall(f,A) came back with type Array{CartesianIndex{2},1} instead of what I expected, type Array{Int64,1}. Working in the REPL, I al…

---

## [Wrapping simple structures with CxxWrap](https://discourse.julialang.org/t/wrapping-simple-structures-with-cxxwrap/36945)

<div class="topic-metadata">

**Author:** [@xor0110](https://discourse.julialang.org/u/xor0110)\
**Replies:** 1\
**Last updated:** [April 9, 2020, 6:38pm UTC](https://discourse.julialang.org/t/wrapping-simple-structures-with-cxxwrap/36945 "2020-04-09T18:38:24Z")

</div>

I’m trying to use CxxWrap, and my C++ library contains a simple structure like this: struct Address { uint8\_t a; uint8\_t b; uint8\_t c; uint8\_t d; }; Right now I’m getting this problem when I try to comp…

---

## [Efficient way for looping over off-diagonal terms](https://discourse.julialang.org/t/efficient-way-for-looping-over-off-diagonal-terms/37282)

<div class="topic-metadata">

**Author:** [@jmcastro2109](https://discourse.julialang.org/u/jmcastro2109)\
**Replies:** 4\
**Last updated:** [April 9, 2020, 6:37pm UTC](https://discourse.julialang.org/t/efficient-way-for-looping-over-off-diagonal-terms/37282 "2020-04-09T18:37:54Z")

</div>

Hello, What is the most efficient way of doing the following double loop? function test(N,T) νtemp = rand(N,T) v = zeros(N,T) println(νtemp) @inbounds for n=1:N, t=1:T ν\[n,t\] = νtemp\[n,t\] …

---

## [Custom plots](https://discourse.julialang.org/t/custom-plots/37259)

<div class="topic-metadata">

**Author:** [@JohnZ](https://discourse.julialang.org/u/JohnZ)\
**Replies:** 7\
**Last updated:** [April 9, 2020, 6:22pm UTC](https://discourse.julialang.org/t/custom-plots/37259 "2020-04-09T18:22:04Z")

</div>

Hello, I would like to understand how I can mark highest and lowest value on the y-axis in a plot. Assume a simple plot using Plots x = 1:10; y = rand(10) plot(x, y) I will appreciate your guidance on, how a. I can m…

---

## [Hessian-vector product in place with ReverseDiff](https://discourse.julialang.org/t/hessian-vector-product-in-place-with-reversediff/37280)

<div class="topic-metadata">

**Author:** [@dpo](https://discourse.julialang.org/u/dpo)\
**Replies:** 7\
**Last updated:** [April 9, 2020, 3:56pm UTC](https://discourse.julialang.org/t/hessian-vector-product-in-place-with-reversediff/37280 "2020-04-09T15:56:28Z")

</div>

I posted this question of the autodiff Slack channel but haven’t heard back. I’m trying to compute Hessian-vector products in place with ReverseDiff. I tried the following julia\> function arglina(x) n = length…

---

## [Julia 1.3: unable to add/update packages](https://discourse.julialang.org/t/julia-1-3-unable-to-add-update-packages/37278)

<div class="topic-metadata">

**Author:** [@mike\_k](https://discourse.julialang.org/u/mike_k)\
**Replies:** 2\
**Last updated:** [April 9, 2020, 3:05pm UTC](https://discourse.julialang.org/t/julia-1-3-unable-to-add-update-packages/37278 "2020-04-09T15:05:47Z")

</div>

Dear folks, when I try to add packages or to update existing ones in v(1.3) pkg\> the procedures hang in Resolving package versions... When I abort manually with ctrl+c the following error appears: ERROR: Unable to aut…

---

## [Can I add registry dependency of a package?](https://discourse.julialang.org/t/can-i-add-registry-dependency-of-a-package/37268)

<div class="topic-metadata">

**Author:** [@paalon](https://discourse.julialang.org/u/paalon)\
**Replies:** 3\
**Last updated:** [April 9, 2020, 9:14am UTC](https://discourse.julialang.org/t/can-i-add-registry-dependency-of-a-package/37268 "2020-04-09T09:14:50Z")

</div>

I know I can add registry (not only General) by Pkg.Registry.add but can I add the dependency on the registry to a package or a project (like Project.toml ) ?

---

## [Recommended replacement for Pkg.installed()](https://discourse.julialang.org/t/recommended-replacement-for-pkg-installed/37240)

<div class="topic-metadata">

**Author:** [@Gaston](https://discourse.julialang.org/u/Gaston)\
**Replies:** 2\
**Last updated:** [April 8, 2020, 9:34pm UTC](https://discourse.julialang.org/t/recommended-replacement-for-pkg-installed/37240 "2020-04-08T21:34:59Z")

</div>

Hi, I’m using Pkg.installed() to check if I have what I need in two different machines that run the same code. After upgrading to julia 1.4 I get the following warning: Warning: Pkg.installed() is deprecated But don’t…

---

## [Avoid error message for function name conflict](https://discourse.julialang.org/t/avoid-error-message-for-function-name-conflict/37176)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 9\
**Last updated:** [April 8, 2020, 8:57pm UTC](https://discourse.julialang.org/t/avoid-error-message-for-function-name-conflict/37176 "2020-04-08T20:57:27Z")

</div>

Hi, Is there a convenient way to avoid the error message when using two modules which export a function the same name? Scenario is that package A depends on B and C. C just added a function which collides with one in B…

---

## [Possible to have a type of discrete values/floats?](https://discourse.julialang.org/t/possible-to-have-a-type-of-discrete-values-floats/37158)

<div class="topic-metadata">

**Author:** [@mlanghinrichs](https://discourse.julialang.org/u/mlanghinrichs)\
**Replies:** 7\
**Last updated:** [April 8, 2020, 6:13pm UTC](https://discourse.julialang.org/t/possible-to-have-a-type-of-discrete-values-floats/37158 "2020-04-08T18:13:15Z")

</div>

Hi all, Maybe it’s a silly question, but I have some code where I naturally pass around Float64s into my functions. For some part of the operations however, these are always discrete (so in this part alone they could as…

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

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