Re: [julia-users] Re: convert array elements

2016-05-13 Thread Michael Krabbe Borregaard
Well, what do you know, it behaves differently in a function. Food for thought. Thanks a lot! On Thu, May 12, 2016 at 3:38 PM, Kristoffer Carlsson wrote: > Try it in a function. Array comprehensions are a bit annoying that the > results depend on the ability of type inference to figure out the r

[julia-users] plotting symbols in pyplot

2016-05-13 Thread Ferran Mazzanti
Dear all, I'm sure this is a simple question but can't find out the right information (manuals?) for Pyplot interfacing in Julia... I want to compare several (similar) figures in the same plot, and some of them should be plotted with lines (solid, dashed...) and colors, while other should be pl

[julia-users] Match package minor bug, it seems

2016-05-13 Thread Андрей Логунов
Match package raises a deprecation warning regarding String. Upon inspection the problem is in the following passage in matchmacro.jl # Regex strings (r"[a-z]*") elseif isexpr(expr, :macrocall) && expr.args[1] == symbol("@r_str") append!(info.tests, [:(isa($val, String)), :(Match.ism

Re: [julia-users] Match package minor bug, it seems

2016-05-13 Thread Milan Bouchet-Valat
Le vendredi 13 mai 2016 à 00:52 -0700, Андрей Логунов a écrit : > Match package raises a deprecation warning regarding String. > Upon inspection the problem is in the following passage in > matchmacro.jl > > # Regex strings (r"[a-z]*") >     elseif isexpr(expr, :macrocall) && expr.args[1] == > sym

[julia-users] Re: Compute Hashes

2016-05-13 Thread jw3126
Thanks! On Wednesday, May 11, 2016 at 2:13:51 PM UTC+2, Kristoffer Carlsson wrote: > > For SHA hashes there is this package: > https://github.com/staticfloat/SHA.jl

Re: [julia-users] Re: Julia large project example.

2016-05-13 Thread Sisyphuss
In Debug.jl: module Debug include("AST.jl")using Debug.AST end After the `include`, `AST` is already in `Debug.jl`'s global scope, why it needs to `using Debug.AST` instead of `using AST`? On Friday, May 13, 2016 at 12:25:43 AM UTC+2, Tim Holy wrote: > > It's been a while, but long ago I reme

[julia-users] Re: Julia Utopia: Share your tips and tricks to efficient coding in Julia

2016-05-13 Thread Sisyphuss
I use jupyter notebook in an aggressive way. I consider working in Atom when it releases its Linux portable version (at least without installing). I use `print` and `@show`. But I find the format of `@show` for matrix is not very friendly. And I agree with Tamas. I also program with a very incr

[julia-users] Strange behavior with docstring

2016-05-13 Thread Eric Forgy
Hi, I am stumped on this one... I'm working on a package and, for the life of me, couldn't find my bug. So, on a hunch, I started commented out my docstrings one by one. I kept getting the error until I commented out the very last docstring and then the code worked as expected. So the source o

[julia-users] Re: Strange behavior with docstring

2016-05-13 Thread Eric Forgy
Maybe a clue... Callback is a constructor, so I have many such docstrings before the constructors, e.g. # """ # Callback used to message a specified connected browser. # """ Callback("message") do args message(args...) end # """ # Callback used to broadcast to all connected browsers. # """

[julia-users] Process medium-sized files in JuliaBox (or alternative)

2016-05-13 Thread Nils Gudat
Slightly weird scenario: Have to do a small bit of analysis on a heavily locked down machine, meaning the only way for me to use any type of decent software is to use it online. First port of call was obviously JuliaBox, but unfortunately I need to process a couple of csv files on the order of

[julia-users] Re: Strange behavior with docstring

2016-05-13 Thread Michael Hatherly
Yes, do blocks can’t be documented, but perhaps a nicer error message would be more useful. Could you open an issue so this doesn’t get lost. Thanks. — Mike ​ On Friday, 13 May 2016 12:25:09 UTC+2, Eric Forgy wrote: > > Maybe a clue... > > Callback is a constructor, so I have many such docstri

[julia-users] Re: Help! Problem with repeated calling of a function that creates SharedArray.

2016-05-13 Thread Nils Gudat
This code runs for me without problems (Julia 0.4.5 64bit on an 8GB Win8.1 laptop)

[julia-users] Forming run() calls programatically

2016-05-13 Thread Andrew Gibb
I'm trying to use metaprogramming to create two functions. Each of which includes a similar, long, call to run(). The calls are not quite identical. Some flags have different arguments, and some are only present on one call. I can't work out how to get expression interpolation to happen within

Re: [julia-users] Forming run() calls programatically

2016-05-13 Thread Tom Breloff
I think this will work: for (fn, arg) = ((:toucha, "a"), (:touchb, "b")) > cmd = `touch $arg` > @eval $fn() = run($cmd) > end On Fri, May 13, 2016 at 7:34 AM, Andrew Gibb wrote: > I'm trying to use metaprogramming to create two functions. Each of which > includes a similar, long, call

Re: [julia-users] Forming run() calls programatically

2016-05-13 Thread Yichao Yu
On Fri, May 13, 2016 at 8:37 AM, Tom Breloff wrote: > I think this will work: > >> for (fn, arg) = ((:toucha, "a"), (:touchb, "b")) >> cmd = `touch $arg` >> @eval $fn() = run($cmd) I believe `` @eval $fn() = run($`touch $arg`) `` also works >> end > > > > On Fri, May 13, 2016 at 7:34 AM,

Re: [julia-users] Forming run() calls programatically

2016-05-13 Thread Andrew Gibb
Those methods both work, and help me understand metaprogramming a little. Thanks to you both.

[julia-users] How to check whether a macro is defined

2016-05-13 Thread lovebufan
to suppress some annoying method overwritten warnings, I found a useful @nowarn macro. However, I need to check whether this macro is defined and include the definition if not. Question, how to check whether a macro is defined? If one thread can ask multiple questions, I'm also interested in ho

Re: [julia-users] Process medium-sized files in JuliaBox (or alternative)

2016-05-13 Thread Isaiah Norton
You could try uploading files to your own AWS bucket and access them using AWS.jl. (I don't know what the transfer speed / latency would be like). SageMathCloud supports Julia (or did in the past; not sure about current version), and they have a generous free account (3 GB). Their subscription is

Re: [julia-users] How to check whether a macro is defined

2016-05-13 Thread Isaiah Norton
julia> isdefined(symbol("@inline")) true On Fri, May 13, 2016 at 6:11 AM, wrote: > to suppress some annoying method overwritten warnings, I found a useful > @nowarn macro. > However, I need to check whether this macro is defined and include the > definition if not. > > Question, how to check whe

Re: [julia-users] old objects and new code

2016-05-13 Thread Isaiah Norton
> > It seems to me that when I execute one of the module functions on x the > original version of the function, not the revised version, gets called. First, is my understanding of what's going on correct? Yes, if you are holding an alias to the "old" module, it doesn't get updated. Second, any

[julia-users] Beginner question: contour-style plot in gadfly of density data?

2016-05-13 Thread ameliafitzsimmons1
Dear Julia users, I have a rookie question about plotting in Gadfly. I have some density data in a plain-text file in the form of x y d, where d is the density at the point (x,y). I have about 10,000 lines of this data. I'm currently plotting old-school using gnuplot and since I don't like th

[julia-users] matlab vs julia slower fft

2016-05-13 Thread baillot maxime
Hello I'm using julia to do some fft in for loops and I notice that julia fft is slower than matlab fft 2.18s for matlab and 3.06s for julia. I did some test to see what's going on. I first used the FFTW.set_num_threads(n) to spead up the code tat I'm using and noticed that the code was slower

[julia-users] Re: matlab vs julia slower fft

2016-05-13 Thread Steven G. Johnson
I think Matlab caches precomputed plans (FFTW "wisdom") for power-of-two sizes, maybe that is making the difference here. Also, for real arrays Matlab might be using FFTW's real-data FFT by default. Try it for a complex input array in both cases, and try it with and without precomputed plans

[julia-users] utils

2016-05-13 Thread Sisyphuss
In many repository, we can find a file naming "utils". What does it stands for? Some small functions used frequently and everywhere?

[julia-users] Re: plotting symbols in pyplot

2016-05-13 Thread Patrick Belliveau
You might be looking for something more sophisticated but a very simple example of this is: julia> using PyPlot julia> x = collect(0:0.1:5); julia> y = 2*x; julia> y2 = y + 0.2*randn(length(x)); julia> plot(x,y,"b-") julia> plot(x,y2,"r--") julia> xlabel("the x-axis") julia> ylabel("the y-axis")

[julia-users] utils

2016-05-13 Thread Kristoffer Carlsson
Utilities.

[julia-users] uv-unix.h not found on windows

2016-05-13 Thread Primitivo Roman
I try to run code for embedding julia in C with msys2 system environment: #include int main(int argc, char *argv[]) { /* required: setup the julia context */ jl_init(NULL); printf("Calling julia from C:\n"); /* run julia commands */ jl_eval_string("print(sqrt(2.0))");

Re: [julia-users] uv-unix.h not found on windows

2016-05-13 Thread Isaiah Norton
How did you install Julia? The issue is that the compiler is incorrectly identifying as unix, so libuv looks for headers which are not available. You could try compiling with `gcc ... -mwin32`. But most likely you will need to get a supported toolchain. See the windows build instructions: https:/

Re: [julia-users] Re: static compilation

2016-05-13 Thread Ján Adamčák
Thanks @Jameson, I have successfully built .so with "--compile=all" flag on 0.5-dev on ubuntu 16.04, but my .so library is 110MB. The same compilation on Win10 crashes. I can call my function in c++ code using jl_init and jl_get_function. My primary goal is to compile a dll with my own exp

[julia-users] Re: matlab vs julia slower fft

2016-05-13 Thread baillot maxime
I remember seeing some thing about the power of sizes array. I will try to the complex array and I will give you the results Thank you!

Re: [julia-users] uv-unix.h not found on windows

2016-05-13 Thread Tony Kelman
x86_64-linux-gnu/libstc++-6.dll is a very strange combination. Most likely you're attempting to compile with the MSYS2 posix-layer (cygwin like) gcc, which is not capable of building Julia. You need to use a x86_64-w64-mingw32 version of gcc. On Friday, May 13, 2016 at 11:17:45 AM UTC-7, Isai

[julia-users] Splatting speed

2016-05-13 Thread Brandon Taylor
I was wondering why the following code is so slow: @time broadcast( (x...) -> +(x...), [1:1000], [1001:2000] ) In comparison to @time broadcast(+, [1:1000], [1001:2000] ) and what would be a faster way to define an anonymous function with a variable number of arguments? Note, I can't use zip b

Re: [julia-users] Julia text editor on iPad?

2016-05-13 Thread cdm
an alternative to JuliaBox is the SageMathCloud: https://cloud.sagemath.com/ there are members servers available for a monthly subscription. On Wednesday, May 11, 2016 at 5:15:44 PM UTC-7, Sheehan Olver wrote: > > > The arrows sometimes work for me…and sometimes not.It’s too bad the >

[julia-users] Re: Julia Utopia: Share your tips and tricks to efficient coding in Julia

2016-05-13 Thread Penn Taylor
I don't have much to add to what others have said about workflow. Lots of good advice so far, especially about putting things into modules early on and putting effort into getting short, tightly-focused functions. Here's the one piece of advice I wish I had been given early on: Multiple dispat

[julia-users] Re: matlab vs julia slower fft

2016-05-13 Thread baillot maxime
I did quickly some more test for matlab it's the same time xomplex or real data array nbp = 2^12; M = rand(nbp); tic fft(M); toc Mp = exp(1i*M); tic fft(Mp); toc I got Elapsed time is 0.041000 seconds. Elapsed time is 0.054349 seconds. I'm on a different computer now so the time is differen

Re: [julia-users] Splatting speed

2016-05-13 Thread Milan Bouchet-Valat
Le vendredi 13 mai 2016 à 14:54 -0700, Brandon Taylor a écrit : > I was wondering why the following code is so slow: > > @time broadcast( (x...) -> +(x...), [1:1000], [1001:2000] ) > > In comparison to > > @time broadcast(+, [1:1000], [1001:2000] ) > > and what would be a faster way to define a

[julia-users] Re: Julia Utopia: Share your tips and tricks to efficient coding in Julia

2016-05-13 Thread baillot maxime
Me I'm using 'Atom' now best IDE for me with a small problem with the workspace, it can be triqui if you want to run codes with include files in it. I don't like the way of jupyter but it's a good tool if you want to do a lectures. also I'm still looking for a Matlab type IDE (damn matlab! I'

[julia-users] NA vs NaN in DataFrames

2016-05-13 Thread Андрей Логунов
In my Win10, when reading an RDataset with NA into a DataFrames table the console shows the missing data as NaNs, hence the standard dropna function ceases to filter. Are there any clues as to how to tackle this? Filter func operates on only Array type, not DataFrame type.

Re: [julia-users] Re: static compilation

2016-05-13 Thread Jameson Nash
> without jl_init() That is not implemented at this time, although patches are welcome. > it has something to do with ccallable Yes, it also is orthogonal to compile-all. It is possible that compile-all is non-functional on v0.4 on Windows, I know master has many enhancements, which may have inc

[julia-users] Re: matlab vs julia slower fft

2016-05-13 Thread Steven G. Johnson
Do plan_fft with the FFTW_PATIENT flag, since that's probably what Matlab's cached plans use

[julia-users] Re: matlab vs julia slower fft

2016-05-13 Thread Steven G. Johnson
Also, you need to use fftn in Matlab. The Matlab fft function only transforms the columns of the array. Julia's fft function transforms all the dimensions by default (although you can tell it to transfer just the columns if you want).

[julia-users] limiting println() precision using defaults or decorators

2016-05-13 Thread Salman Haider
Hey guys, I have code littered with round() or trunc() as follows: println("β1: ", trunc(exp(results.minimum[2]), 3)) Is there a way to either set println() defaults or run it through a decorator to limit the number of decimals it dumps on screen such that i end up with code like the following

Re: [julia-users] limiting println() precision using defaults or decorators

2016-05-13 Thread Tom Breloff
Check out the Formatting package, as well as the spin-off https://github.com/ScottPJones/StringUtils.jl On Friday, May 13, 2016, Salman Haider wrote: > Hey guys, > > I have code littered with round() or trunc() as follows: > println("β1: ", trunc(exp(results.minimum[2]), 3)) > > Is there a way t

[julia-users] Re: select/poll on TCPSocket in Julia?

2016-05-13 Thread Andrei Zh
1. I found out that TCPSocket contains several conditions and callbacks, but I couldn't find any docs or example of their usage. 2. I also found #6563 that discusses exactly the problem of listening to multiple conditions / channels. So if I ma

[julia-users] Re: Beginner question: contour-style plot in gadfly of density data?

2016-05-13 Thread Scott T
Two key questions - is your data gridded? And do you plan to sample from these density values later, or are you just wanting to plot it and see what it looks like? If your data is gridded (your ~1 lines cover every combination of x and y values in the range that you are interested in), then

[julia-users] Re: Strange behavior with docstring

2016-05-13 Thread Eric Forgy
On Friday, May 13, 2016 at 6:56:43 PM UTC+8, Michael Hatherly wrote: > > Yes, do blocks can’t be documented, but perhaps a nicer error message > would be more useful. Could you open an issue so this doesn’t get lost. > Thanks. > Sure. Issue #16359

[julia-users] Re: NA vs NaN in DataFrames

2016-05-13 Thread Андрей Логунов
SOLVED. While in Linux the following works as expected: dropna(df[:FldName]) using RDatasets in Win10 automatically converts NAs to NaNs. This code tackles the issue: dropna = filter(x->!isequal(x, NaN), convert(Array, df[:fld])) but the package developers *might* provide a corresponding upda

[julia-users] ANN: AffineSpaces.jl (work in progress)

2016-05-13 Thread Alireza Nejati
https://github.com/anj1/AffineSpaces.jl If you're doing computational geometry but are tired of copy-pasting fragile stackoverflow answers to do simple things like point-line distance and so on (or choosing between that and some huge and bloated computational geometry library like CGAL), this i

[julia-users] Re: NA vs NaN in DataFrames

2016-05-13 Thread Андрей Логунов
суббота, 14 мая 2016 г., 9:09:16 UTC+10 пользователь Андрей Логунов написал: > > In my Win10, when reading an RDataset with NA into a DataFrames table the > console shows the missing data as NaNs, hence the standard dropna function > ceases to filter. Are there any clues as to how to tackle thi

Re: [julia-users] Re: NA vs NaN in DataFrames

2016-05-13 Thread Tamas Papp
On Sat, May 14 2016, Андрей Логунов wrote: > To add, fiddling with array comprehensions as per the problem with NaNs > found a buggy thing. > The following code does not work: > > [x for x in filter(!isnan, convert(Array,dataframe[:fld]))] This is not a bug. ! does not operate on functions, onl

[julia-users] Macros Hygiene

2016-05-13 Thread Ford Ox
Shouldn't macro use the same principle as functions? That is: If your macro changes the value of variable you passed as argument (say @increment x), thus it works similar to a function accepting pointer, it should be marked with "!" at the end? (@increment! x) If your macro changes variables th