# General Usage

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

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

**Page:** 834

---

## [Simulating CIR model with Differential Equation Package](https://discourse.julialang.org/t/simulating-cir-model-with-differential-equation-package/28569)

<div class="topic-metadata">

**Author:** [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Replies:** 13\
**Last updated:** [September 10, 2019, 8:56am UTC](https://discourse.julialang.org/t/simulating-cir-model-with-differential-equation-package/28569 "2019-09-10T08:56:18Z")

</div>

I am trying to solve CIR model DiffEq.but get the following error. Please help me resolving this issue. # dx=a(b−x)dt+σdWt Vaiscek Model # dx=a(b−x)dt+σ\*sqrt(x)\*dWt CIR model α=0.2;σ=0.2;u₀=0.04;β=0.041 f(u,p,t) = α\*(…

---

## [Plots.jl attributes can be broadcasted? Changing linestyle for example](https://discourse.julialang.org/t/plots-jl-attributes-can-be-broadcasted-changing-linestyle-for-example/19559)

<div class="topic-metadata">

**Author:** [@rveltz](https://discourse.julialang.org/u/rveltz)\
**Replies:** 9\
**Last updated:** [September 10, 2019, 7:34am UTC](https://discourse.julialang.org/t/plots-jl-attributes-can-be-broadcasted-changing-linestyle-for-example/19559 "2019-09-10T07:34:33Z")

</div>

Hi, When using Plots, I can specify the color like using Plots ls = vcat(fill(:red,5),fill(:green,5)) plot(rand(10),linecolor = ls) but somehow this does not work ls = vcat(fill(:dash,5),fill(:solid,5)) plot(rand(10)…

---

## [Solving a PDE which comes from an HJB in DifferentialEquations.jl](https://discourse.julialang.org/t/solving-a-pde-which-comes-from-an-hjb-in-differentialequations-jl/8617)

<div class="topic-metadata">

**Author:** [@MaximilianJHuber](https://discourse.julialang.org/u/MaximilianJHuber)\
**Replies:** 15\
**Last updated:** [September 9, 2019, 4:27pm UTC](https://discourse.julialang.org/t/solving-a-pde-which-comes-from-an-hjb-in-differentialequations-jl/8617 "2019-09-09T16:27:37Z")

</div>

I was wondering whether one could use the Finite Difference Method developed in the recent GSoC project DiffEqOperators.jl to solve the following PDE, which comes from an HJB that describes a household consumption/saving…

---

## [Julia for live control of USB3.0 camera and DAC/ADC boards, with GUI?](https://discourse.julialang.org/t/julia-for-live-control-of-usb3-0-camera-and-dac-adc-boards-with-gui/14195)

<div class="topic-metadata">

**Author:** [@ianshmean](https://discourse.julialang.org/u/ianshmean)\
**Replies:** 19\
**Last updated:** [September 9, 2019, 4:24pm UTC](https://discourse.julialang.org/t/julia-for-live-control-of-usb3-0-camera-and-dac-adc-boards-with-gui/14195 "2019-09-09T16:24:18Z")

</div>

I’ve prototyped a system in LabView that has the functionality I want, but I’m coming up against speed issues and would like to avoid developing further in a commercially licensed language. The current labview system co…

---

## [Best practice approach for caching data in objects](https://discourse.julialang.org/t/best-practice-approach-for-caching-data-in-objects/20419)

<div class="topic-metadata">

**Author:** [@mkborregaard](https://discourse.julialang.org/u/mkborregaard)\
**Replies:** 7\
**Last updated:** [September 9, 2019, 9:45am UTC](https://discourse.julialang.org/t/best-practice-approach-for-caching-data-in-objects/20419 "2019-09-09T09:45:07Z")

</div>

Something that’s come up repeatedly for me this last week in different contexts (and also many times before) is how do you approach the case where you sometimes want to be able to store intermediary results? For a clear…

---

## [DataFrame Manipulation](https://discourse.julialang.org/t/dataframe-manipulation/28552)

<div class="topic-metadata">

**Author:** [@Ajaychat3](https://discourse.julialang.org/u/Ajaychat3)\
**Replies:** 2\
**Last updated:** [September 9, 2019, 7:50am UTC](https://discourse.julialang.org/t/dataframe-manipulation/28552 "2019-09-09T07:50:14Z")

</div>

I am using some operation on DataFrame and getting the following warning. How am I supposed to change the syntax for col in \[:A,:B,:D\] df\[(df\[col\] .=="yy"),col\] .="xxxx" end Warning: \`getindex(df::DataFrame, col\_i…

---

## [Reading repr() string to object?](https://discourse.julialang.org/t/reading-repr-string-to-object/28548)

<div class="topic-metadata">

**Author:** [@nmatzke](https://discourse.julialang.org/u/nmatzke)\
**Replies:** 2\
**Last updated:** [September 9, 2019, 2:34am UTC](https://discourse.julialang.org/t/reading-repr-string-to-object/28548 "2019-09-09T02:34:14Z")

</div>

Hi all, In R, the functions dput() and dget() let you output an object to a string representation, and read it back in. This is handy for quickly reproducing objects for e.g. reproducible tests or for help. In Julia, …

---

## [GraphPlot: how to control the output plot size in Juno's Plots pane?](https://discourse.julialang.org/t/graphplot-how-to-control-the-output-plot-size-in-junos-plots-pane/28494)

<div class="topic-metadata">

**Author:** [@Anselm\_Jeong](https://discourse.julialang.org/u/Anselm_Jeong)\
**Replies:** 1\
**Last updated:** [September 8, 2019, 11:02pm UTC](https://discourse.julialang.org/t/graphplot-how-to-control-the-output-plot-size-in-junos-plots-pane/28494 "2019-09-08T23:02:27Z")

</div>

Dear all, I’ve been using GraphPlot in Juno IDE environment (add-on on ATOM). The output from gplot() command in Plots pane in Juno is so small so that it is hard to identify node or edge labels. Unlike ordinary outpu…

---

## [Use linear interpolation between two LLA coordinate system points](https://discourse.julialang.org/t/use-linear-interpolation-between-two-lla-coordinate-system-points/28296)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 8\
**Last updated:** [September 8, 2019, 5:00pm UTC](https://discourse.julialang.org/t/use-linear-interpolation-between-two-lla-coordinate-system-points/28296 "2019-09-08T17:00:43Z")

</div>

I have the following simple piece of code to find the position between two coordinate points using linear interpolation. I’m not sure if this is a good / feasible solution or not. So what do you think? mutable struct LL…

---

## [How do make a string from pointer to a piece memory that is in the format of a string?](https://discourse.julialang.org/t/how-do-make-a-string-from-pointer-to-a-piece-memory-that-is-in-the-format-of-a-string/28534)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 0\
**Last updated:** [September 8, 2019, 10:10am UTC](https://discourse.julialang.org/t/how-do-make-a-string-from-pointer-to-a-piece-memory-that-is-in-the-format-of-a-string/28534 "2019-09-08T10:10:35Z")

</div>

I am writing a fast serializer of strings onto disk. What I found was that a String’s memory structure is very simple. It’s basically a UInt64 followed by bytes. The first UInt64 indicates the length of the string, and t…

---

## [CUDAnative , performance drop after several timesteps](https://discourse.julialang.org/t/cudanative-performance-drop-after-several-timesteps/28495)

<div class="topic-metadata">

**Author:** [@YJC](https://discourse.julialang.org/u/YJC)\
**Replies:** 5\
**Last updated:** [September 8, 2019, 7:43am UTC](https://discourse.julialang.org/t/cudanative-performance-drop-after-several-timesteps/28495 "2019-09-08T07:43:33Z")

</div>

Hi all, I am building up a time marching simulation via using CUDAnative, I found that after several time steps , the performance drop significantly. If I “synchronize” all the thread at some point, the performance was…

---

## [Exit on first @test failure in @testset](https://discourse.julialang.org/t/exit-on-first-test-failure-in-testset/28496)

<div class="topic-metadata">

**Author:** [@milesf](https://discourse.julialang.org/u/milesf)\
**Replies:** 3\
**Last updated:** [September 7, 2019, 6:52pm UTC](https://discourse.julialang.org/t/exit-on-first-test-failure-in-testset/28496 "2019-09-07T18:52:44Z")

</div>

I am running package tests, and would like to save time and console spam by just exiting upon the first failure. The Test documentation hints that this may be possible. There’s an exit\_on\_error option, although that see…

---

## [@distributed macro in Float64 instead of Float32](https://discourse.julialang.org/t/distributed-macro-in-float64-instead-of-float32/28476)

<div class="topic-metadata">

**Author:** [@sergevic](https://discourse.julialang.org/u/sergevic)\
**Replies:** 2\
**Last updated:** [September 7, 2019, 6:23pm UTC](https://discourse.julialang.org/t/distributed-macro-in-float64-instead-of-float32/28476 "2019-09-07T18:23:20Z")

</div>

I have the following code in Julia 1.1: using Pkg; Pkg.activate(".") using Distributed using Distributions addprocs(3, exeflags="--project=.") @everywhere using Distributions samples=map(x-\>sample(1:5,5),1:5) prop=(@di…

---

## [Overriding BinaryProvider download to use local/custom build?](https://discourse.julialang.org/t/overriding-binaryprovider-download-to-use-local-custom-build/28498)

<div class="topic-metadata">

**Author:** [@oschulz](https://discourse.julialang.org/u/oschulz)\
**Replies:** 7\
**Last updated:** [September 7, 2019, 5:41pm UTC](https://discourse.julialang.org/t/overriding-binaryprovider-download-to-use-local-custom-build/28498 "2019-09-07T17:41:11Z")

</div>

Is there a standard way of overriding BinaryProviders download mechanism and make it use a custom build? I’ve encountered two cases where that would be very valuable: A custom build is necessary (e.g. I may need to bu…

---

## [What does partialsortperm! do?](https://discourse.julialang.org/t/what-does-partialsortperm-do/25656)

<div class="topic-metadata">

**Author:** [@dkarrasch](https://discourse.julialang.org/u/dkarrasch)\
**Replies:** 10\
**Last updated:** [September 7, 2019, 5:04pm UTC](https://discourse.julialang.org/t/what-does-partialsortperm-do/25656 "2019-09-07T17:04:52Z")

</div>

Judging by the docstring, I thought partialsortperm! would do the same as partialsortperm, just that it writes the permutation vector into the preallocated vector. Let’s see: julia\> x = rand(10) 10-element Array{Float64…

---

## [Where is startup.jl (v1.2)?](https://discourse.julialang.org/t/where-is-startup-jl-v1-2/28503)

<div class="topic-metadata">

**Author:** [@mthelm85](https://discourse.julialang.org/u/mthelm85)\
**Replies:** 2\
**Last updated:** [September 7, 2019, 3:16pm UTC](https://discourse.julialang.org/t/where-is-startup-jl-v1-2/28503 "2019-09-07T15:16:20Z")

</div>

I was reading a thread that shows how to add things like Revise and OhMyREPL to your startup.jl file so that they are available upon starting Julia but I can’t find my startup.jl file. I am running Julia 1.2 on Windows 1…

---

## [What is a package key? and is there any fundamental difference between a registered package and a self-written package?](https://discourse.julialang.org/t/what-is-a-package-key-and-is-there-any-fundamental-difference-between-a-registered-package-and-a-self-written-package/28473)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 8\
**Last updated:** [September 7, 2019, 12:42pm UTC](https://discourse.julialang.org/t/what-is-a-package-key-and-is-there-any-fundamental-difference-between-a-registered-package-and-a-self-written-package/28473 "2019-09-07T12:42:41Z")

</div>

I’m working on a project coding in which I need to use a Julia package downloaded from the internet. I’m not totally satisfied with the package, so some part of it needs to be changed / updated. So, I basically copy and …

---

## [Struggling with ccall](https://discourse.julialang.org/t/struggling-with-ccall/28427)

<div class="topic-metadata">

**Author:** [@giadasp](https://discourse.julialang.org/u/giadasp)\
**Replies:** 36\
**Last updated:** [September 7, 2019, 12:13pm UTC](https://discourse.julialang.org/t/struggling-with-ccall/28427 "2019-09-07T12:13:43Z")

</div>

Dear Julia developers, It’s almost a week I’m trying to call a custom C (or C++) function in Julia. In particular what I want is to call a C function I wrote which takes some matrices as arguments and modify one of the…

---

## [Merge two text file](https://discourse.julialang.org/t/merge-two-text-file/2280)

<div class="topic-metadata">

**Author:** [@schalil](https://discourse.julialang.org/u/schalil)\
**Replies:** 8\
**Last updated:** [September 7, 2019, 12:58am UTC](https://discourse.julialang.org/t/merge-two-text-file/2280 "2019-09-07T00:58:37Z")

</div>

I am trying to merge two files. Are there any command like appending a text file 2 to the end of text file 1

---

## [Keyword arguments confustion](https://discourse.julialang.org/t/keyword-arguments-confustion/28470)

<div class="topic-metadata">

**Author:** [@jasonsun0310](https://discourse.julialang.org/u/jasonsun0310)\
**Replies:** 4\
**Last updated:** [September 6, 2019, 7:45pm UTC](https://discourse.julialang.org/t/keyword-arguments-confustion/28470 "2019-09-06T19:45:35Z")

</div>

function choose(a::Type{Val{:Gaussian},b::Type{Val{:Gamma}}; data::Any = nothing,comp::Any=nothing) print(1) And I want it to dispatch on symbols and I create the following shortcut const choose(a::Symbo…

---

## [Very large compilation time (and space)](https://discourse.julialang.org/t/very-large-compilation-time-and-space/28342)

<div class="topic-metadata">

**Author:** [@aml](https://discourse.julialang.org/u/aml)\
**Replies:** 11\
**Last updated:** [September 6, 2019, 3:47pm UTC](https://discourse.julialang.org/t/very-large-compilation-time-and-space/28342 "2019-09-06T15:47:45Z")

</div>

In a previous post, I mentioned a small interpreter that I wrote both in direct style and in continuation-passing style. In the first case, Julia very quickly compiles the interpreter methods as they are being used. In t…

---

## [Is there a reason why Expressions are not subtyped?](https://discourse.julialang.org/t/is-there-a-reason-why-expressions-are-not-subtyped/28428)

<div class="topic-metadata">

**Author:** [@jonathanBieler](https://discourse.julialang.org/u/jonathanBieler)\
**Replies:** 7\
**Last updated:** [September 6, 2019, 3:10pm UTC](https://discourse.julialang.org/t/is-there-a-reason-why-expressions-are-not-subtyped/28428 "2019-09-06T15:10:42Z")

</div>

When working with expressions I often find myself writing things like: if ex.head == :call ... if ex.head == :tuple Code in Base is also full of that kind of pattern. It would be much easier to write suc…

---

## [Cfunction from 0.6 to 1.0](https://discourse.julialang.org/t/cfunction-from-0-6-to-1-0/28441)

<div class="topic-metadata">

**Author:** [@tomerarnon](https://discourse.julialang.org/u/tomerarnon)\
**Replies:** 13\
**Last updated:** [September 6, 2019, 2:31pm UTC](https://discourse.julialang.org/t/cfunction-from-0-6-to-1-0/28441 "2019-09-06T14:31:17Z")

</div>

I am upgrading a package that wraps a C library from julia 0.6 to 1.0. In principle this should be very simple, but in practice I am running into some problems (naturally). In particular, migrating from 0.6 to 0.7 as an …

---

## [Adjoint sensitivity analysis of ODE - get value of cost functional](https://discourse.julialang.org/t/adjoint-sensitivity-analysis-of-ode-get-value-of-cost-functional/28468)

<div class="topic-metadata">

**Author:** [@DR59](https://discourse.julialang.org/u/DR59)\
**Replies:** 0\
**Last updated:** [September 6, 2019, 2:22pm UTC](https://discourse.julialang.org/t/adjoint-sensitivity-analysis-of-ode-get-value-of-cost-functional/28468 "2019-09-06T14:22:27Z")

</div>

Dear all, This question is related to the DifferentialEquations.jl package. I’ve used the very helpful documentation here to implement adjoint sensitivity analysis on an ODE. Specifically, i have a cost function of the…

---

## [Turning off type inference?](https://discourse.julialang.org/t/turning-off-type-inference/28434)

<div class="topic-metadata">

**Author:** [@dlfivefifty](https://discourse.julialang.org/u/dlfivefifty)\
**Replies:** 12\
**Last updated:** [September 6, 2019, 1:23pm UTC](https://discourse.julialang.org/t/turning-off-type-inference/28434 "2019-09-06T13:23:44Z")

</div>

Is there a way to turn off type inference? I have a function that’s too keen on making union types that aren’t actually helpful, which causes compilation to take forever (in some cases it seems like I mean literally fore…

---

## [Connect to secure server using secure(SSL) sockets(plan tcp client)](https://discourse.julialang.org/t/connect-to-secure-server-using-secure-ssl-sockets-plan-tcp-client/28465)

<div class="topic-metadata">

**Author:** [@universe68](https://discourse.julialang.org/u/universe68)\
**Replies:** 0\
**Last updated:** [September 6, 2019, 12:44pm UTC](https://discourse.julialang.org/t/connect-to-secure-server-using-secure-ssl-sockets-plan-tcp-client/28465 "2019-09-06T12:44:05Z")

</div>

Hey guys :slight\_smile: I’m trying to connect to remote server(not my server) via socket(no HTTP request) with SSL(no client certificate is needed) The client should have two threads, one thread that waits for incoming…

---

## [KeyError: key \*\*\*\*\* \[86cd37e6-c0ff-550b-95fe-21d72c8d4fc9\] not found while calling "Serialization.deserialize(f)" function](https://discourse.julialang.org/t/keyerror-key-86cd37e6-c0ff-550b-95fe-21d72c8d4fc9-not-found-while-calling-serialization-deserialize-f-function/28442)

<div class="topic-metadata">

**Author:** [@bsnyh](https://discourse.julialang.org/u/bsnyh)\
**Replies:** 3\
**Last updated:** [September 6, 2019, 10:33am UTC](https://discourse.julialang.org/t/keyerror-key-86cd37e6-c0ff-550b-95fe-21d72c8d4fc9-not-found-while-calling-serialization-deserialize-f-function/28442 "2019-09-06T10:33:46Z")

</div>

Hi. I got a KeyError as the above when using the package \*\*\*\*\*. Could anyone please let me know what might be wrong?

---

## [Something(a, b) not shortcutting](https://discourse.julialang.org/t/something-a-b-not-shortcutting/27746)

<div class="topic-metadata">

**Author:** [@Charlie\_He](https://discourse.julialang.org/u/Charlie_He)\
**Replies:** 4\
**Last updated:** [September 6, 2019, 9:18am UTC](https://discourse.julialang.org/t/something-a-b-not-shortcutting/27746 "2019-09-06T09:18:56Z")

</div>

Assuming we have: function do\_work(x) sleep(2) x end It turns out something(Some(2), do\_work(3)) still invoke do\_work, which returns 2 seconds later. It would be better to define it as a macro, which retains …

---

## [Specialized Base.findfirst for ranges](https://discourse.julialang.org/t/specialized-base-findfirst-for-ranges/28460)

<div class="topic-metadata">

**Author:** [@pnalysz](https://discourse.julialang.org/u/pnalysz)\
**Replies:** 2\
**Last updated:** [September 6, 2019, 9:10am UTC](https://discourse.julialang.org/t/specialized-base-findfirst-for-ranges/28460 "2019-09-06T09:10:08Z")

</div>

As far as I see at the moment julia uses the same findfirst method for all AbstractArray which simply iterates through all the items. Would it not make sense to have specialized method for ranges that would find the item…

---

## [What's the fastest to convert a String to an \`Vector{T}\` where \`isbits(T) == true\` and back again?](https://discourse.julialang.org/t/whats-the-fastest-to-convert-a-string-to-an-vector-t-where-isbits-t-true-and-back-again/28458)

<div class="topic-metadata">

**Author:** [@xiaodai](https://discourse.julialang.org/u/xiaodai)\
**Replies:** 2\
**Last updated:** [September 6, 2019, 6:24am UTC](https://discourse.julialang.org/t/whats-the-fastest-to-convert-a-string-to-an-vector-t-where-isbits-t-true-and-back-again/28458 "2019-09-06T06:24:07Z")

</div>

I want to see what’s the fastest way to convert a String to an invertible its binary representation (which I assume will be an array of type T for some T). The codeunit should do the trick but it used to be slow. Also h…

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

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