# General Usage

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

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

**Page:** 366

---

## [Cannot write txt file on julia(distance map)](https://discourse.julialang.org/t/cannot-write-txt-file-on-julia-distance-map/90626)

<div class="topic-metadata">

**Author:** [@dangda](https://discourse.julialang.org/u/dangda)\
**Replies:** 2\
**Last updated:** [November 22, 2022, 8:32pm UTC](https://discourse.julialang.org/t/cannot-write-txt-file-on-julia-distance-map/90626 "2022-11-22T20:32:34Z")

</div>

print(dm) Distance map of size (398, 398) julia\> using DelimitedFiles julia\> writedlm(“dmdm.txt”,dm) ERROR: MethodError: no method matching iterate(::DistanceMap) Closest candidates are: iterate(::Union{LinRange, S…

---

## [Why my Cosecant Plot different from the Textbook?](https://discourse.julialang.org/t/why-my-cosecant-plot-different-from-the-textbook/90660)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [November 22, 2022, 6:09pm UTC](https://discourse.julialang.org/t/why-my-cosecant-plot-different-from-the-textbook/90660 "2022-11-22T18:09:15Z")

</div>

Hi all, I am trying to plot: f(x) = 8csc(x) + 8csc(75-x) plot(f, 0, 75) But the plot is different from the textbook, can anyone explain why? t

---

## [How to Draw This Spiral Solution Curve?](https://discourse.julialang.org/t/how-to-draw-this-spiral-solution-curve/90510)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 12\
**Last updated:** [November 22, 2022, 5:55pm UTC](https://discourse.julialang.org/t/how-to-draw-this-spiral-solution-curve/90510 "2022-11-22T17:55:22Z")

</div>

Hi all, I read this topic and it is still confusing since the differential equation is a bit different: I use only variable of t. That topic use dx/dt and dy/dt, thus I can’t really use it to my problem at hand. Thi…

---

## [Save image meshcat](https://discourse.julialang.org/t/save-image-meshcat/90650)

<div class="topic-metadata">

**Author:** [@ga72kud](https://discourse.julialang.org/u/ga72kud)\
**Replies:** 0\
**Last updated:** [November 22, 2022, 3:47pm UTC](https://discourse.julialang.org/t/save-image-meshcat/90650 "2022-11-22T15:47:25Z")

</div>

Save images meshcat. I use the MeshCat.jl package and want to save a png image taken from the Visualizer-Scene and save it to a specific path: I read this from the documentation save\_image(vis::Visualizer) -\> Visualize…

---

## [How to write this Boolean operator?](https://discourse.julialang.org/t/how-to-write-this-boolean-operator/90607)

<div class="topic-metadata">

**Author:** [@Leon6](https://discourse.julialang.org/u/Leon6)\
**Replies:** 6\
**Last updated:** [November 22, 2022, 2:05pm UTC](https://discourse.julialang.org/t/how-to-write-this-boolean-operator/90607 "2022-11-22T14:05:09Z")

</div>

Y is latitude and I want those that are falling within -90 and 90 degrees. Indx = Y .\> -90 .& Y.\< 90; I tried &, &&, .&. All of them gave me headaches. What should be the correct way of expressing this in Julia? Thank…

---

## [OpenCV cannot be precompiled for Julia 1.8](https://discourse.julialang.org/t/opencv-cannot-be-precompiled-for-julia-1-8/90611)

<div class="topic-metadata">

**Author:** [@prittjam](https://discourse.julialang.org/u/prittjam)\
**Replies:** 3\
**Last updated:** [November 22, 2022, 10:56am UTC](https://discourse.julialang.org/t/opencv-cannot-be-precompiled-for-julia-1-8/90611 "2022-11-22T10:56:03Z")

</div>

julia\> using OpenCV \[ Info: Precompiling OpenCV \[f878e3a2-a245-4720-8660-60795d644f2a\] ERROR: LoadError: ccall method definition: argument 2 type doesn't correspond to a C type Stacktrace: \[1\] top-level scope @ non…

---

## [Precompilation and finalizers](https://discourse.julialang.org/t/precompilation-and-finalizers/90635)

<div class="topic-metadata">

**Author:** [@thautwarm](https://discourse.julialang.org/u/thautwarm)\
**Replies:** 0\
**Last updated:** [November 22, 2022, 10:00am UTC](https://discourse.julialang.org/t/precompilation-and-finalizers/90635 "2022-11-22T10:00:51Z")

</div>

I wanted to register a finalizer for instances of some specific type. The final requirement is to achieve the following features simultaneously: invoking some callback once the object is gc-ed keeping the object precom…

---

## [Why does this function allocate memory?](https://discourse.julialang.org/t/why-does-this-function-allocate-memory/90624)

<div class="topic-metadata">

**Author:** [@Nathaniel](https://discourse.julialang.org/u/Nathaniel)\
**Replies:** 6\
**Last updated:** [November 22, 2022, 9:18am UTC](https://discourse.julialang.org/t/why-does-this-function-allocate-memory/90624 "2022-11-22T09:18:17Z")

</div>

The Performance tips page in the documentation gives the following example of a function that allocates memory unexpectedly: julia\> x = rand(1000); julia\> function sum\_global() s = 0.0 for i in x …

---

## [Predefined path in Agents.jl](https://discourse.julialang.org/t/predefined-path-in-agents-jl/90625)

<div class="topic-metadata">

**Author:** [@SDA](https://discourse.julialang.org/u/SDA)\
**Replies:** 0\
**Last updated:** [November 22, 2022, 4:32am UTC](https://discourse.julialang.org/t/predefined-path-in-agents-jl/90625 "2022-11-22T04:32:55Z")

</div>

I would like to implement an agent-based model where some agents have predefined paths. These agents will effectively be blind to other agents, who would operate under normal movement rules. For example, with the Flockin…

---

## [Some questions about eachoverlap in GenomicFeatures](https://discourse.julialang.org/t/some-questions-about-eachoverlap-in-genomicfeatures/85975)

<div class="topic-metadata">

**Author:** [@zhangchunyong](https://discourse.julialang.org/u/zhangchunyong)\
**Replies:** 1\
**Last updated:** [August 30, 2022, 11:31am UTC](https://discourse.julialang.org/t/some-questions-about-eachoverlap-in-genomicfeatures/85975 "2022-08-30T11:31:55Z")

</div>

During using the eachoverlap function in GenomicFeatures,I cannot know how to solve this problem. My problem is :if each interval in “col” contains any interval in “hhh” ,I will output interval "col ".Here is the pict…

---

## [Colormap logscale using Plot](https://discourse.julialang.org/t/colormap-logscale-using-plot/44759)

<div class="topic-metadata">

**Author:** [@sriharitn](https://discourse.julialang.org/u/sriharitn)\
**Replies:** 7\
**Last updated:** [November 22, 2022, 3:26am UTC](https://discourse.julialang.org/t/colormap-logscale-using-plot/44759 "2022-11-22T03:26:17Z")

</div>

I’m trying to build a 3D surface plot with color in log10 scale. I just want the color to be in the log10 scale NOT the actual values itself. N = 51 x = range(-10, stop = 10, length = N) y = x f(x,y)=x^2+y^2 Plots.plot(…

---

## [How to find zeroes of an equation containing definite integration effectively?](https://discourse.julialang.org/t/how-to-find-zeroes-of-an-equation-containing-definite-integration-effectively/90618)

<div class="topic-metadata">

**Author:** [@f1974939505](https://discourse.julialang.org/u/f1974939505)\
**Replies:** 0\
**Last updated:** [November 22, 2022, 2:08am UTC](https://discourse.julialang.org/t/how-to-find-zeroes-of-an-equation-containing-definite-integration-effectively/90618 "2022-11-22T02:08:09Z")

</div>

The equation is shaped like ∫ \[0,1\] f(x,t) dt = 0 How to find the solution x effectively with numerical methods?

---

## [Looping through binary numbers](https://discourse.julialang.org/t/looping-through-binary-numbers/90597)

<div class="topic-metadata">

**Author:** [@lrnv](https://discourse.julialang.org/u/lrnv)\
**Replies:** 16\
**Last updated:** [November 21, 2022, 11:40pm UTC](https://discourse.julialang.org/t/looping-through-binary-numbers/90597 "2022-11-21T23:40:06Z")

</div>

Hey, In Copulas.jl, I want to compute the measure a copula assignes to a hyperbox \[u,v\]. Basically, the following function is doing what i want : using Copulas # Based on Computing the {{Volume}} of {\\emph{n}} -{{Dim…

---

## [Overwritten method warning during precompilation](https://discourse.julialang.org/t/overwritten-method-warning-during-precompilation/90603)

<div class="topic-metadata">

**Author:** [@wsshin](https://discourse.julialang.org/u/wsshin)\
**Replies:** 3\
**Last updated:** [November 21, 2022, 10:40pm UTC](https://discourse.julialang.org/t/overwritten-method-warning-during-precompilation/90603 "2022-11-21T22:40:43Z")

</div>

Here is a simplified example demonstrating my problem. I have a package named MyPkg2: module MyPkg2 # defined in MyPkg2.jl using StaticArrays const SBool{K} = SVector{K,Bool} SBool(x::Number...) = SVector(Bool.(x)..…

---

## [Can you obtain the solution of an ODE symbolically in Julia?](https://discourse.julialang.org/t/can-you-obtain-the-solution-of-an-ode-symbolically-in-julia/90583)

<div class="topic-metadata">

**Author:** [@RayleighLord](https://discourse.julialang.org/u/RayleighLord)\
**Replies:** 1\
**Last updated:** [November 21, 2022, 4:07pm UTC](https://discourse.julialang.org/t/can-you-obtain-the-solution-of-an-ode-symbolically-in-julia/90583 "2022-11-21T16:07:25Z")

</div>

I would like to know if it is currently possible to solve an ODE symbolically in Julia using some of the packages of the SciML organization. The tutorials show that you can define a system symbollically and then solve i…

---

## [Disable code depending on optimsation level](https://discourse.julialang.org/t/disable-code-depending-on-optimsation-level/90589)

<div class="topic-metadata">

**Author:** [@jlbosse](https://discourse.julialang.org/u/jlbosse)\
**Replies:** 2\
**Last updated:** [November 21, 2022, 2:57pm UTC](https://discourse.julialang.org/t/disable-code-depending-on-optimsation-level/90589 "2022-11-21T14:57:26Z")

</div>

I have input and consistency checks that I need during development but want to disable for final runs of my code. Is there a way to annotate these checks s.t. they are not included at higher optimisation levels or depend…

---

## [Print all columns of a dataframe](https://discourse.julialang.org/t/print-all-columns-of-a-dataframe/8520)

<div class="topic-metadata">

**Author:** [@sam81](https://discourse.julialang.org/u/sam81)\
**Replies:** 11\
**Last updated:** [November 21, 2022, 2:15pm UTC](https://discourse.julialang.org/t/print-all-columns-of-a-dataframe/8520 "2022-11-21T14:15:53Z")

</div>

The latest version of the DataFrames package omits columns that don’t fit the screen when printing. Is there a way to print all columns of a dataframe? Can this be made the default behavior on a given user’s system?

---

## [What is sympy (python) equivalent differentiation method in Julia?](https://discourse.julialang.org/t/what-is-sympy-python-equivalent-differentiation-method-in-julia/90522)

<div class="topic-metadata">

**Author:** [@Madan](https://discourse.julialang.org/u/Madan)\
**Replies:** 17\
**Last updated:** [November 21, 2022, 12:59pm UTC](https://discourse.julialang.org/t/what-is-sympy-python-equivalent-differentiation-method-in-julia/90522 "2022-11-21T12:59:33Z")

</div>

i have been struggling to find out what is the equivalent sympy method in Julia. actually i made finite element method solver (numerical method to solve partial differential equation, parabolic, elliptical and hyperbolic…

---

## [Customizing Output Units of Dates.canonicalize](https://discourse.julialang.org/t/customizing-output-units-of-dates-canonicalize/90569)

<div class="topic-metadata">

**Author:** [@notaprogrammer](https://discourse.julialang.org/u/notaprogrammer)\
**Replies:** 4\
**Last updated:** [November 21, 2022, 12:30pm UTC](https://discourse.julialang.org/t/customizing-output-units-of-dates-canonicalize/90569 "2022-11-21T12:30:36Z")

</div>

Working on some exercises to learn programming and Julia, and I am attempting to calculate my little one’s age. I see that Julia does almost all of the work compared to the solution I wrote yesterday in Perl where I had…

---

## [Should Juliaup 1.7.26 become « release »?](https://discourse.julialang.org/t/should-juliaup-1-7-26-become-release/90557)

<div class="topic-metadata">

**Author:** [@jdad](https://discourse.julialang.org/u/jdad)\
**Replies:** 4\
**Last updated:** [November 21, 2022, 7:48am UTC](https://discourse.julialang.org/t/should-juliaup-1-7-26-become-release/90557 "2022-11-21T07:48:24Z")

</div>

I am currently waiting for using Julia 1.8.3 through Juliaup. I see in the Juliaup GitHub website that it is incorporated in the Juliaup version 1.7.26 . But this version is « pre-release », not « release », so not ident…

---

## [How to Plot with gr() at the same time with showing computation result at the terminal Julia REPL?](https://discourse.julialang.org/t/how-to-plot-with-gr-at-the-same-time-with-showing-computation-result-at-the-terminal-julia-repl/90545)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 4\
**Last updated:** [November 21, 2022, 7:27am UTC](https://discourse.julialang.org/t/how-to-plot-with-gr-at-the-same-time-with-showing-computation-result-at-the-terminal-julia-repl/90545 "2022-11-21T07:27:38Z")

</div>

Hi all, this is a double problems but want to be combined as one. I want to show a plot of function (just simple plot, no need for the Newton’s method iteration shown, but if it is possible you can tell me). Plus the …

---

## [How to export contact map/distance map in Julia?](https://discourse.julialang.org/t/how-to-export-contact-map-distance-map-in-julia/90574)

<div class="topic-metadata">

**Author:** [@dangda](https://discourse.julialang.org/u/dangda)\
**Replies:** 0\
**Last updated:** [November 21, 2022, 6:47am UTC](https://discourse.julialang.org/t/how-to-export-contact-map-distance-map-in-julia/90574 "2022-11-21T06:47:15Z")

</div>

I draw a protein contact map and distance map in Julia. I want to export it in a csv/png form but it doesn’t work at all. This is how I write the code using BioStructures julia\> struc=read(“ranked\_0.pdb”,PDB) cPro…

---

## [MLJ Tuning and Hyperparameters , Regression](https://discourse.julialang.org/t/mlj-tuning-and-hyperparameters-regression/90546)

<div class="topic-metadata">

**Author:** [@Mr.Benz](https://discourse.julialang.org/u/Mr.Benz)\
**Replies:** 0\
**Last updated:** [November 20, 2022, 4:16pm UTC](https://discourse.julialang.org/t/mlj-tuning-and-hyperparameters-regression/90546 "2022-11-20T16:16:01Z")

</div>

I started with julia , new to data science. i have a quetion on MLJ tuning ang iteratied model. in a loop , Do we need to do TunedModel + IteratedModel +evaluate or IteratedModel +TunedModel +evaluate which is best wa…

---

## [Why is qr! not available for a view?](https://discourse.julialang.org/t/why-is-qr-not-available-for-a-view/90563)

<div class="topic-metadata">

**Author:** [@PetrKryslUCSD](https://discourse.julialang.org/u/PetrKryslUCSD)\
**Replies:** 2\
**Last updated:** [November 21, 2022, 3:24am UTC](https://discourse.julialang.org/t/why-is-qr-not-available-for-a-view/90563 "2022-11-21T03:24:24Z")

</div>

I tried to use qr! on a view of a dense matrix, but apparently there is no method for that: LoadError: MethodError: no method matching qr!(::SubArray{Float64, 1, Matrix{Float64}, Tuple{Base.Slice{Base.OneTo{Int64}}, I…

---

## [Image File Type Conversions](https://discourse.julialang.org/t/image-file-type-conversions/90554)

<div class="topic-metadata">

**Author:** [@GameDungeon](https://discourse.julialang.org/u/GameDungeon)\
**Replies:** 1\
**Last updated:** [November 21, 2022, 1:57am UTC](https://discourse.julialang.org/t/image-file-type-conversions/90554 "2022-11-21T01:57:32Z")

</div>

Are there any good ways to convert between image file types? For example SVG to JPG, or even a simple PNG to JPG? Edit: I guess with PNG to JPG I could just load the file and then save it. Not sure about SVG to other ty…

---

## [Plots.jl GKS failing](https://discourse.julialang.org/t/plots-jl-gks-failing/90424)

<div class="topic-metadata">

**Author:** [@alexsss](https://discourse.julialang.org/u/alexsss)\
**Replies:** 12\
**Last updated:** [November 21, 2022, 1:26am UTC](https://discourse.julialang.org/t/plots-jl-gks-failing/90424 "2022-11-21T01:26:07Z")

</div>

Hi Having issues with the Plots.jl package after a Windows update. I receive error messages of the following form whenever I try to run any GUI command (e.g. scatter(1:10,1:10)): GKS: GKS not in proper state. GKS must …

---

## [Julia 1.9.alpha1 multi thread](https://discourse.julialang.org/t/julia-1-9-alpha1-multi-thread/90526)

<div class="topic-metadata">

**Author:** [@Mr.Benz](https://discourse.julialang.org/u/Mr.Benz)\
**Replies:** 5\
**Last updated:** [November 20, 2022, 3:00pm UTC](https://discourse.julialang.org/t/julia-1-9-alpha1-multi-thread/90526 "2022-11-20T15:00:16Z")

</div>

I have installed julia 1.8.3 and julia 1.9.0 alpha1. when enter julia -t auto command ,julia 1.8.3 is running. how to start julia 1.9.alpha1 with mulit threads. Also,Julia 1.9.alpha1 is not supporting vs code with jup…

---

## [Ask Whether The Plot Step function variation $x + \\lfloor x \\rfloor$ is Correct](https://discourse.julialang.org/t/ask-whether-the-plot-step-function-variation-x-lfloor-x-rfloor-is-correct/90529)

<div class="topic-metadata">

**Author:** [@Freya\_the\_Goddess](https://discourse.julialang.org/u/Freya_the_Goddess)\
**Replies:** 2\
**Last updated:** [November 20, 2022, 12:14pm UTC](https://discourse.julialang.org/t/ask-whether-the-plot-step-function-variation-x-lfloor-x-rfloor-is-correct/90529 "2022-11-20T12:14:42Z")

</div>

Hi all I try to plot this function: x + \\lfloor x \\rfloor I have this code: using Plots,LaTeXStrings,Colors gr() f(x) = x + floor(x) x = -2:1:4 y = f.(x) plot(x\[1:2\], \[y\[1\], y\[1\]\], label=L"f(x) = x + \\lfloor x \\rfloo…

---

## [Llvm code excess line?](https://discourse.julialang.org/t/llvm-code-excess-line/90532)

<div class="topic-metadata">

**Author:** [@andrey2185](https://discourse.julialang.org/u/andrey2185)\
**Replies:** 2\
**Last updated:** [November 20, 2022, 11:22am UTC](https://discourse.julialang.org/t/llvm-code-excess-line/90532 "2022-11-20T11:22:48Z")

</div>

hello, what is this line for? %3 = and i8 %2, 1 in this: julia\> @code\_llvm true | false define i8 @"julia\_|\_7397"(i8 zeroext %0, i8 zeroext %1) #0 { top: %2 = or i8 %1, %0 %3 = and i8 %2, 1 ret i8 %3 } it is wo…

---

## [Using views with CartesianIndices: Is this a bug?](https://discourse.julialang.org/t/using-views-with-cartesianindices-is-this-a-bug/19823)

<div class="topic-metadata">

**Author:** [@Sean\_McBane](https://discourse.julialang.org/u/Sean_McBane)\
**Replies:** 3\
**Last updated:** [November 20, 2022, 8:01am UTC](https://discourse.julialang.org/t/using-views-with-cartesianindices-is-this-a-bug/19823 "2022-11-20T08:01:56Z")

</div>

I want to do something analogous to the following snippet: function reverse\_first\_dim(A::AbstractArray) B = similar(A) trailing = size(A)\[2:end\] |\> CartesianIndices N = size(A, 1) @views B\[N:-1:1, traili…

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

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