# julia lang

• ## Non-linear system of equations Julia2019-03-13

I'm trying to solve a large number (50) of non-linear simultaneous equations in Julia. For the moment I'm just trying to make this work with 2 equations to get the syntax right etc. However, I've tried a variety of packages/tools - NLsolve, nsolve in

• ## The ternary operator in a one-line function2018-09-01

In Julia, I might want to write a function that returns 0 if the input is less than 1, or returns 2 if the input is greater than or equal to 1. This is a pretty simple function, and the verbosity of a five-line if else construct is probably excessive

• ## Efficient one-liner in Julia to calculate "running" sums?2018-03-25

Is there an efficient way to do the following in Julia in one line of code? foldl((prev, x)-> [prev; prev[end] + x] , 0, block_lengths) For example, for block_lengths = [2, 2, 2, 2, 3] the desired output is [0, 2, 4, 6, 8, 11] (I presume that the way

Tags: julia lang
• ## How to change radial ticks in julia PyPlot polar plot?2016-04-27

Using julia and PyPlot (which looks like it calls matplotlib) I've got a radial log plot ranging from 0dB on the outer edge of the plot to -50dB on the interior: using PyPlot ; theta = 0:0.02:1 * pi ; n = length(theta) ; U = cos( theta ).^2 ; V = zer

Tags: python, matplotlib, plot, julia lang
• ## how to use the julia language in c++ (visual studio)2015-03-10

Is it possible to use the julia language in c++? Does the julia language provides some libraries to include? For now, I am trying to use some funcitons of the julia language in my c++ project. Is this possbile? What could I do? thanks in advance. ---

Tags: julia lang
• ## Geom.ribbon in Gadfly (Julia) does not accept Int vectors as input2015-03-10

So, I've been playing around with Gadfly in Julia and run into this issue. Geom.ribbon does't accept Int vectors as input for ymin and ymax when used in combination with Geom.smooth. I was wondering if this is a bug, is intended, or if I'm doing anyt

Tags: types, casting, julia lang, gadfly
• ## Julia is slow with cat command2015-02-16

I wanted to have a look at the julia language, so I wrote a little script to import a dataset I'm working with. But when I run and profile the script it turns out that it is much slower than a similar script in R. When I do profiling it tells me that

Tags: julia lang
• ## Why can I not use the Unicode characters √ and ∀ in assignments?2015-02-11

Julia has an interesting support for Unicode characters. The syntax allows me to run the following in the iJulia notebook. μ = 10 σ = 20 ∑ = sum a = [1,2,3,4] ∑(a) # prints 10 However, it doesn't always seem like you can use Unicode characters for fu

• ## Why is Julia asking for AVX instructions on Ubuntu 14.04?2015-02-02

On my Ubuntu 14.04 box, Julia is complaining that my machine doesn't support AVX instructions. What may be the reason for this? --------------Solutions------------- "AVX instructions" are extensions to the basic x86 instruction set, and are relativel

Tags: avx, julia lang, openblas
• ## Write a variable number of arguments for IF2015-01-19

I am trying to write a function that would solve any general version of this problem: If we list all the natural numbers below 10 that are multiples of 3 or 5, we get 3, 5, 6 and 9. The sum of these multiples is 23. Find the sum of all the multiples

Tags: julia lang
• ## allclose - How to check if two arrays are close in Julia2014-11-24

In numpy you can do np.allclose(A, B) to see if the arrays A & B are close. Is there any function in Julia to do so ? --------------Solutions------------- For single numbers, isapprox is defined. If you want to extend this to an element-wise comp

Tags: numpy, julia lang
• ## Will Julia's GC continue to stop-the-world when parallelism is introduction?2014-11-17

Julia will have multi-threading soon. I'm curious to know the impact on its GC algorithm. At one point in the thread, Stefan says that "Memory allocation will always be thread-local." If Julia will always use thread-local storage, doesn't that mean i

• ## Why is immutability set on types (rather than variables) in Julia?2014-11-17

In Julia, why is immutability a "property" of overall types (in the Julia sense of the word, so more akin to a struct or class in other languages) rather than variables? e.g. In Rust (and I think most languages with support for immutability), whether

• ## Interaction of parametric types and multiple dispatch in Julia2014-10-30

Setup: Consider a parametric type in Julia type MyType1{T1} x::T1 end I define two methods for a single function over this type using multiple dispatch and type parameters: f1(m::MyType1, i::Int64) = m.x + i #Method 1 f1{T1}(m::MyType1, i::T1) = m.x

Tags: types, parameters, julia lang
• ## No stacktrace in Julia lang for Windows2014-09-18

In Julia, I get no stack traces any time a module is loaded with errors. The module compiles fine on its own, but when a call to a method of the module gives an error, the only thing that gets printed is the exception string, but there is no line/sta

• ## Passing rng to Distributions2014-09-04

I am using Distributions.jl since the julia standard library does not support all necessary distributions Within 1 special function I need the same random numbers. I am looking for a way to use always the same random number generator for this part, b

Tags: julia lang
• ## Can I run Python code in Julia language for speed increase?2014-08-16

Ive been looking at speed comparisons of the new language Julia and have been impressed as it seems much faster than Python. The thing is so much of the underlying code I have created as well as user-contributed modules are already in Python. So I wa

Tags: performance, julia lang
• ## In Julia, how do I display the contents of a macro?2014-05-01

For example, I want to see what's "inside" of the @time macro. How would I do this? --------------Solutions------------- While it doesn't show you the macro itself, you can see the results of the macro expansion with macroexpand. For example: julia

Tags: macros, julia lang
• ## Highlight julia code in emacs2014-03-25

I would like to write julialang code in emacs. Is there an easy way to do it like, for example, when you do python code (all these reserved words in colors and indentation)? Here is what I have done so far: I created the file ~/.emacs.d/init.el with

Tags: emacs, julia lang
• ## julia llvmcall failed to parse llvm assembly2014-03-05

I am trying to add support for new intrinsics in Julia. For this I use the llvmcall fork. However, when using this in a Julia function, I always encounter the following problem: declare function: julia> function ptx_test(a,b,c) idx = Base.llvmcall

Tags: llvm, julia lang