# Latest

**URL:** https://discourse.julialang.org/latest.md?page=1481

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

**Page:** 1482

---

## [Evaluate Piecewise Functions Effciently](https://discourse.julialang.org/t/evaluate-piecewise-functions-effciently/55832)

<div class="topic-metadata">

**Author:** [@drarnau](https://discourse.julialang.org/u/drarnau)\
**Replies:** 3\
**Last updated:** [February 23, 2021, 11:54am UTC](https://discourse.julialang.org/t/evaluate-piecewise-functions-effciently/55832 "2021-02-23T11:54:46Z")

</div>

Dear all, I have a very basic (maybe stupid) question. I need to evaluate a piecewise function many times. My naive approach is to do something like: function myPiecewise(a,b) if a \< 0 return 0.5\*a + b else …

---

## [Can I use julia from Windows Subsystem for Linux in VS Code Julia Extension](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106)

<div class="topic-metadata">

**Author:** [@peregrinrm](https://discourse.julialang.org/u/peregrinrm)\
**Replies:** 4\
**Last updated:** [February 23, 2021, 11:40am UTC](https://discourse.julialang.org/t/can-i-use-julia-from-windows-subsystem-for-linux-in-vs-code-julia-extension/50106 "2021-02-23T11:40:01Z")

</div>

Hello there, Is there a way to make the julia vscode extension use the julia from the WSL? I have already setup the integrated terminal so that it opens the zsh in the WSL Ubuntu, but the julia extension seems to find o…

---

## [Best practice for managing package hierarchy](https://discourse.julialang.org/t/best-practice-for-managing-package-hierarchy/55822)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 7\
**Last updated:** [February 23, 2021, 10:38am UTC](https://discourse.julialang.org/t/best-practice-for-managing-package-hierarchy/55822 "2021-02-23T10:38:02Z")

</div>

What’s the best practice for the management of a package and its modules? Please take a look at the following example. In this example, module A is a kind of a Base module, and module B is a corresponding module. Also…

---

## ["T not defined" when defining parametric one-line function with return type](https://discourse.julialang.org/t/t-not-defined-when-defining-parametric-one-line-function-with-return-type/55827)

<div class="topic-metadata">

**Author:** [@wujinq](https://discourse.julialang.org/u/wujinq)\
**Replies:** 3\
**Last updated:** [February 23, 2021, 9:08am UTC](https://discourse.julialang.org/t/t-not-defined-when-defining-parametric-one-line-function-with-return-type/55827 "2021-02-23T09:08:27Z")

</div>

I noticed the following seemingly weird error when defining an abstract generic type: abstract type SomeAbstractType{T} end func(x::SomeAbstractType{T})::Bool where {T} = error("func is not implemented.") and getting a…

---

## [CSV.jl : mixing symbol and column number in select option](https://discourse.julialang.org/t/csv-jl-mixing-symbol-and-column-number-in-select-option/55450)

<div class="topic-metadata">

**Author:** [@Fred](https://discourse.julialang.org/u/Fred)\
**Replies:** 2\
**Last updated:** [February 23, 2021, 9:04am UTC](https://discourse.julialang.org/t/csv-jl-mixing-symbol-and-column-number-in-select-option/55450 "2021-02-23T09:04:49Z")

</div>

Hi, I am trying to read the rownames and some specific column of a CSV file (to save RAM) so I use the “select” option. The problem with this option is that rownames are dropped, so I want to include the first column us…

---

## [Getting Char bytes without allocation](https://discourse.julialang.org/t/getting-char-bytes-without-allocation/55791)

<div class="topic-metadata">

**Author:** [@sijo](https://discourse.julialang.org/u/sijo)\
**Replies:** 6\
**Last updated:** [February 23, 2021, 8:44am UTC](https://discourse.julialang.org/t/getting-char-bytes-without-allocation/55791 "2021-02-23T08:44:46Z")

</div>

How can I get the bytes in a UTF-8 character like 'é' without allocating? My use case is a for loop on all characters in a string. The loop must sometimes access the bytes directly: for c in str # Do some work …

---

## [Interactive display for graphs (graph theory)](https://discourse.julialang.org/t/interactive-display-for-graphs-graph-theory/55710)

<div class="topic-metadata">

**Author:** [@AlexanderChen](https://discourse.julialang.org/u/AlexanderChen)\
**Replies:** 7\
**Last updated:** [February 23, 2021, 8:38am UTC](https://discourse.julialang.org/t/interactive-display-for-graphs-graph-theory/55710 "2021-02-23T08:38:00Z")

</div>

The project I am working on has 3 parts. develop a workflow in which SQL tables can be represented in graph form with the relevant meta information and the ability to develop a workflow to connect columns of different…

---

## [Is there a difference between \`T::Type\` and \`::Type{T} ... where T\` in a method si](https://discourse.julialang.org/t/is-there-a-difference-between-t-type-and-type-t-where-t-in-a-method-si/55825)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 2\
**Last updated:** [February 23, 2021, 7:26am UTC](https://discourse.julialang.org/t/is-there-a-difference-between-t-type-and-type-t-where-t-in-a-method-si/55825 "2021-02-23T07:26:24Z")

</div>

Is there a difference between T::Type and ::Type{T} ... where T in a method signature? Note that the original poster on Slack cannot see your response here on Discourse. Consider transcribing the appropriate answer back…

---

## [Use @\_\_FILE\_\_ in pasted code in REPL](https://discourse.julialang.org/t/use-file-in-pasted-code-in-repl/55824)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 6\
**Last updated:** [February 23, 2021, 7:18am UTC](https://discourse.julialang.org/t/use-file-in-pasted-code-in-repl/55824 "2021-02-23T07:18:16Z")

</div>

I no longer use Atom or VSCode. My current workflow is to send codes on a Julia script to an open Julia REPL. I want to set the current folder to be my working directory. Using cd(dirname(@\_\_FILE\_\_)) in this manner does …

---

## [Conversion of properties of a NamedTuple or struct](https://discourse.julialang.org/t/conversion-of-properties-of-a-namedtuple-or-struct/55769)

<div class="topic-metadata">

**Author:** [@Philippe\_Maincon1](https://discourse.julialang.org/u/Philippe_Maincon1)\
**Replies:** 2\
**Last updated:** [February 23, 2021, 5:43am UTC](https://discourse.julialang.org/t/conversion-of-properties-of-a-namedtuple-or-struct/55769 "2021-02-23T05:43:41Z")

</div>

I want write a piece of code that will receive large arrays of “state variables” from finite element codes, and do a conversion on all the e.g. Float64 appearing in this data structure. There are many element types, I d…

---

## [Technical Program Manager/Senior Engineering Manager/More @ Beacon Biosignals](https://discourse.julialang.org/t/technical-program-manager-senior-engineering-manager-more-beacon-biosignals/55805)

<div class="topic-metadata">

**Author:** [@jrevels](https://discourse.julialang.org/u/jrevels)\
**Replies:** 1\
**Last updated:** [February 23, 2021, 4:32am UTC](https://discourse.julialang.org/t/technical-program-manager-senior-engineering-manager-more-beacon-biosignals/55805 "2021-02-23T04:32:13Z")

</div>

Hi folks! Beacon Biosignals is seeking a Technical Program Manager and/or Senior Engineering Manager to help manage the growth/direction of our Platform. The tools/services that comprise the Beacon Platform drive this …

---

## [How to pass in a function as an argument to a function?](https://discourse.julialang.org/t/how-to-pass-in-a-function-as-an-argument-to-a-function/55816)

<div class="topic-metadata">

**Author:** [@cocoa1231](https://discourse.julialang.org/u/cocoa1231)\
**Replies:** 8\
**Last updated:** [February 23, 2021, 3:48am UTC](https://discourse.julialang.org/t/how-to-pass-in-a-function-as-an-argument-to-a-function/55816 "2021-02-23T03:48:10Z")

</div>

Hello So I have this function - function late\_time\_value(slope, x\_init::Float64, y\_init::Float64, dx::Float64 = 0.01, tf::Float64 = 100) N = floor(Integer, tf/dt) sol\_x = zeros(N) sol\_y = zeros(N) …

---

## [How to plot Newton's method](https://discourse.julialang.org/t/how-to-plot-newtons-method/51160)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 45\
**Last updated:** [February 23, 2021, 3:29am UTC](https://discourse.julialang.org/t/how-to-plot-newtons-method/51160 "2021-02-23T03:29:14Z")

</div>

I’m looking at how to plot Newton’s method. I was going to add x values of each itteration, with y=0 to a DataFrame, then run a scatter plot. Is this what I should do, or is there a better way to go about this?

---

## [Agents: UndefVarError: plotabm not defined](https://discourse.julialang.org/t/agents-undefvarerror-plotabm-not-defined/54318)

<div class="topic-metadata">

**Author:** [@Carsten](https://discourse.julialang.org/u/Carsten)\
**Replies:** 12\
**Last updated:** [February 23, 2021, 3:15am UTC](https://discourse.julialang.org/t/agents-undefvarerror-plotabm-not-defined/54318 "2021-02-23T03:15:42Z")

</div>

Executing the example Game of Life given in Agents (https://juliadynamics.github.io/Agents.jl/stable/examples/game\_of\_life\_2D\_CA/) I always get the error message: UndefVarError: plotabm not defined. I started the exampl…

---

## [Variables and for loops in Pluto.jl](https://discourse.julialang.org/t/variables-and-for-loops-in-pluto-jl/55814)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 3\
**Last updated:** [February 23, 2021, 2:11am UTC](https://discourse.julialang.org/t/variables-and-for-loops-in-pluto-jl/55814 "2021-02-23T02:11:13Z")

</div>

I’m trying to run a loop in Pluto, but I’m having a problem with multiple deffinitions, from the way that Pluto passes on variables. begin f(x)=x^2-x-20 plot(f,4:.001:12,legend=false) x=11 # initial value of x # may …

---

## [Package dependency question](https://discourse.julialang.org/t/package-dependency-question/55809)

<div class="topic-metadata">

**Author:** [@Yifan\_Liu](https://discourse.julialang.org/u/Yifan_Liu)\
**Replies:** 1\
**Last updated:** [February 23, 2021, 12:11am UTC](https://discourse.julialang.org/t/package-dependency-question/55809 "2021-02-23T00:11:10Z")

</div>

Let’s say that I installed package A that depends on package B. After a while, package A no longer depends on package B. All the other packages also do not depend on package B. Will package B be uninstalled automatically…

---

## [How can I display all Float64 multidimensional arrays as vectors?](https://discourse.julialang.org/t/how-can-i-display-all-float64-multidimensional-arrays-as-vectors/55787)

<div class="topic-metadata">

**Author:** [@BridgeBot](https://discourse.julialang.org/u/BridgeBot)\
**Replies:** 3\
**Last updated:** [February 22, 2021, 11:37pm UTC](https://discourse.julialang.org/t/how-can-i-display-all-float64-multidimensional-arrays-as-vectors/55787 "2021-02-22T23:37:10Z")

</div>

How can I display all Float64 multidimensional arrays as vectors? I tried the following but it stackoverflows: Base.show(io::IO, x::Array{Float64}) = print(io, vec(x)) Probably it is running into a deadlock. Note that…

---

## [Different output of printf on Julia nightly build](https://discourse.julialang.org/t/different-output-of-printf-on-julia-nightly-build/55807)

<div class="topic-metadata">

**Author:** [@Norman](https://discourse.julialang.org/u/Norman)\
**Replies:** 0\
**Last updated:** [February 22, 2021, 10:53pm UTC](https://discourse.julialang.org/t/different-output-of-printf-on-julia-nightly-build/55807 "2021-02-22T22:53:48Z")

</div>

Hi, I find that @printf is giving me a different output on a nightly build version of Julia. For the released versions, I get the following: julia\> using Printf julia\> v = 1e-6 1.0e-6 julia\> @printf "\<1e%2.2d" ceil(I…

---

## [Some questions on Transducers.jl](https://discourse.julialang.org/t/some-questions-on-transducers-jl/55622)

<div class="topic-metadata">

**Author:** [@iHany](https://discourse.julialang.org/u/iHany)\
**Replies:** 6\
**Last updated:** [February 22, 2021, 10:43pm UTC](https://discourse.julialang.org/t/some-questions-on-transducers-jl/55622 "2021-02-22T22:43:22Z")

</div>

I’m recently interested in Transducers.jl. However, I cannot understand some methods provided in the package. For example, anybody can explain foldxl example in detail? I cannot figure out how the answer comes. Also, …

---

## [Line Segment in Plots](https://discourse.julialang.org/t/line-segment-in-plots/55800)

<div class="topic-metadata">

**Author:** [@brett\_knoss](https://discourse.julialang.org/u/brett_knoss)\
**Replies:** 14\
**Last updated:** [February 22, 2021, 10:44pm UTC](https://discourse.julialang.org/t/line-segment-in-plots/55800 "2021-02-22T22:44:47Z")

</div>

Is there a way to create a line segment in plots? f(x)=2x plot(f);vline!(\[f(3), f(4)\]) How would I get the lines to go from the y origin to f(x) only?

---

## [Calling a function from another notebook using \`my\_file.some\_function()\`](https://discourse.julialang.org/t/calling-a-function-from-another-notebook-using-my-file-some-function/55806)

<div class="topic-metadata">

**Author:** [@Michael\_Barmann](https://discourse.julialang.org/u/Michael_Barmann)\
**Replies:** 3\
**Last updated:** [February 22, 2021, 10:18pm UTC](https://discourse.julialang.org/t/calling-a-function-from-another-notebook-using-my-file-some-function/55806 "2021-02-22T22:18:38Z")

</div>

Is there a way to use the dot syntax in Jupyter Notebook to call a function that was defined in a different notebook? For example, suppose I have a notebook “test.ipynb” containing a function called square(x), and say we…

---

## [Fit histograms for multiple series in the same bar-plot](https://discourse.julialang.org/t/fit-histograms-for-multiple-series-in-the-same-bar-plot/55686)

<div class="topic-metadata">

**Author:** [@DrChainsaw](https://discourse.julialang.org/u/DrChainsaw)\
**Replies:** 12\
**Last updated:** [February 22, 2021, 10:06pm UTC](https://discourse.julialang.org/t/fit-histograms-for-multiple-series-in-the-same-bar-plot/55686 "2021-02-22T22:06:52Z")

</div>

I just ran into the age old problem of wanting to plot bar histograms (using StatsPlots.jl) from multiple series of data as a grouped bar plot (i.e bars from different series appearing next to each other in each bin). A…

---

## [CSV.read Error - provide a valid sink argument](https://discourse.julialang.org/t/csv-read-error-provide-a-valid-sink-argument/50157)

<div class="topic-metadata">

**Author:** [@Vaclav\_Dekanovsky](https://discourse.julialang.org/u/Vaclav_Dekanovsky)\
**Replies:** 11\
**Last updated:** [February 22, 2021, 10:04pm UTC](https://discourse.julialang.org/t/csv-read-error-provide-a-valid-sink-argument/50157 "2021-02-22T22:04:29Z")

</div>

I’ve just installed Julia on Win-64 and I try to read a CSV file. The following code works: using CSVFiles, FileIO, DataFrames df = load("C:\\\\...\\\\file.csv") |\> DataFrame But I wonder what is missing in this code: \[…

---

## [Hobby project: SequentialFit.jl](https://discourse.julialang.org/t/hobby-project-sequentialfit-jl/55717)

<div class="topic-metadata">

**Author:** [@gustaphe](https://discourse.julialang.org/u/gustaphe)\
**Replies:** 13\
**Last updated:** [February 22, 2021, 9:44pm UTC](https://discourse.julialang.org/t/hobby-project-sequentialfit-jl/55717 "2021-02-22T21:44:48Z")

</div>

I don’t know mathematical optimization, and this might be a tremendously dumb idea, but I couldn’t get it out of my head after working on a project where I was fitting a surrogate model to the outputs from a very expensi…

---

## [Protect Entry of a Struct](https://discourse.julialang.org/t/protect-entry-of-a-struct/55795)

<div class="topic-metadata">

**Author:** [@Ahmed\_Salih](https://discourse.julialang.org/u/Ahmed_Salih)\
**Replies:** 11\
**Last updated:** [February 22, 2021, 9:32pm UTC](https://discourse.julialang.org/t/protect-entry-of-a-struct/55795 "2021-02-22T21:32:51Z")

</div>

Hello! Suppose I have this simple example where I use the Parameters package: using Parameters @with\_kw struct MyTest a = 1 b = 2\*a end Note how b is calculated based on a. If I write: MyTest(a=4) My…

---

## [Using SCIP GCG in JuMP](https://discourse.julialang.org/t/using-scip-gcg-in-jump/55770)

<div class="topic-metadata">

**Author:** [@Kreiton\_Sitorus](https://discourse.julialang.org/u/Kreiton_Sitorus)\
**Replies:** 2\
**Last updated:** [February 22, 2021, 9:22pm UTC](https://discourse.julialang.org/t/using-scip-gcg-in-jump/55770 "2021-02-22T21:22:31Z")

</div>

Hello, I’m new to JuMP and I’ve been working on implementing a branch and price framework for the Inventory Routing Problem. I stumbled across GCG (a generic branch and price) as an extension of SCIP. Is it accessible th…

---

## [Delete post](https://discourse.julialang.org/t/delete-post/55797)

<div class="topic-metadata">

**Author:** [@Tomil](https://discourse.julialang.org/u/Tomil)\
**Replies:** 5\
**Last updated:** [February 22, 2021, 8:28pm UTC](https://discourse.julialang.org/t/delete-post/55797 "2021-02-22T20:28:35Z")

</div>

quero apagar um post meu, mas não tenho autorização, como consigo?

---

## [Questions about exporting .CSV data to Julia](https://discourse.julialang.org/t/questions-about-exporting-csv-data-to-julia/55796)

<div class="topic-metadata">

**Author:** [@RaquelSantos](https://discourse.julialang.org/u/RaquelSantos)\
**Replies:** 2\
**Last updated:** [February 22, 2021, 8:04pm UTC](https://discourse.julialang.org/t/questions-about-exporting-csv-data-to-julia/55796 "2021-02-22T20:04:29Z")

</div>

In a single file in the .CSV I created two tabs, but when I try to read this data in Julia, the following error message appears to me: ArgumentError: "filename.csv" is not a valid file Can someone help me? Thanks

---

## [Pyjulia, Django, and segfaults](https://discourse.julialang.org/t/pyjulia-django-and-segfaults/25313)

<div class="topic-metadata">

**Author:** [@evanfields](https://discourse.julialang.org/u/evanfields)\
**Replies:** 8\
**Last updated:** [February 22, 2021, 7:52pm UTC](https://discourse.julialang.org/t/pyjulia-django-and-segfaults/25313 "2021-02-22T19:52:15Z")

</div>

I work at a very small (3 devs) startup. Our backend is Python / Django. We have some computation-intensive code for demand estimation which we’ve written in Julia, and we want to integrate that code into our Django back…

---

## ['where T' vs 'where {T}'](https://discourse.julialang.org/t/where-t-vs-where-t/55794)

<div class="topic-metadata">

**Author:** [@danvenn](https://discourse.julialang.org/u/danvenn)\
**Replies:** 3\
**Last updated:** [February 22, 2021, 7:46pm UTC](https://discourse.julialang.org/t/where-t-vs-where-t/55794 "2021-02-22T19:46:48Z")

</div>

Hi, I’m really liking Julia so far, but the documentation on the usage of where has me confused (despite finding a few posts here discussing it). What would be the difference between: same\_type(x::T, y::T) where {T} = …

[Previous page](https://discourse.julialang.org/latest.md?page=1480)

[Next page](https://discourse.julialang.org/latest.md?page=1482)
