Re: [julia-users] Weird behavior of median

2016-10-03 Thread Miguel Bazdresch
I can't reproduce the problem. julia> versioninfo() Julia Version 0.5.0 Commit 3c9d753 (2016-09-19 18:14 UTC) Platform Info: System: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i5-3320M CPU @ 2.60GHz WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Sandybridge)

Re: [julia-users] Tasks and STDIN

2016-07-26 Thread Miguel Bazdresch
This gets close to what you want, and works in a script (on Julia v0.4.6): exitflag = [false] @async while true g = utf8(readavailable(STDIN)) println(g) if g[1] == 'q' println("Exiting task...") exitflag[1] = true break end end while true yield() if exitflag[1] break end end This code prints

Re: [julia-users] How to make a Matrix of Matrix's?

2016-06-23 Thread Miguel Bazdresch
You can simplify the declaration as follows: MM = Matrix(Matrix(1,2)) You can use comprehensions too: MM = [ randn(5,5) for x=1:2, y=1 ] Here, MM has two rows and one column, and each of its elements is a 5x5 matrix. -- mb On Thu, Jun 23, 2016 at 9:28 PM, Sheehan Olver wrote: > Thi

Re: [julia-users] readdlm throws error for empty line

2016-06-05 Thread Miguel Bazdresch
This may be related: https://github.com/JuliaLang/julia/issues/16248 On Sun, Jun 5, 2016 at 6:16 PM, Anonymous wrote: > So I have a BysteString vector A, containing a bunch of byte strings of > varying lengths of the form: > > "1,2,\n" > "\n" > "5,2,4\n" > > etc. > > What I have set up is to do

Re: [julia-users] Re: Lack of an explicit return in Julia, heartache or happiness?

2016-05-25 Thread Miguel Bazdresch
I think this is similar to the distinction between 'function' and 'procedure' in languages like Pascal. Maybe we could leave functions as they are (which I'd prefer), and add procedures that are like functions but with an implicit 'return nothing' at the end. -- mb On Wed, May 25, 2016 at 6:40 PM

Re: [julia-users] beginner with Julia graphs

2016-05-19 Thread Miguel Bazdresch
You seem to be missing graphviz: http://www.graphviz.org/ -- mb On Thu, May 19, 2016 at 12:21 PM, Andrea Vigliotti < andrea.viglio...@gmail.com> wrote: > Hi all! > > I'm trying to run this example (taken from here : > https://github.com/JuliaLang/Graphs.jl/blob/master/doc/source/examples.rst > )

Re: [julia-users] Re: how long until vectorized code runs fast?

2016-05-12 Thread Miguel Bazdresch
The easiest way to write slow for loops is to make them row-major instead of column-major. -- mb On Thu, May 12, 2016 at 8:46 AM, Anonymous wrote: > So I guess the consensus is not that Julia's devectorized code is so much > faster than its vectorized code (in fact I keep getting slow downs whe

Re: [julia-users] Hopefully simple plotting question (for my 9 yr old son's science project!)

2016-05-09 Thread Miguel Bazdresch
> a line segment from the low_range to the high_range (with the top and bottom marked off with small horizontal lines), Gaston has support for plotting with error bars, which is exactly this type of plot. Current documentation is here: https://bitbucket.org/mbaz/gaston/downloads/gastondoc-0.5.5.p

Re: [julia-users] How to suppress output from interactive session

2016-03-26 Thread Miguel Bazdresch
That I don't know, sorry. -- mb On Sat, Mar 26, 2016 at 6:44 PM, feza wrote: > Sorry I meant without using ; > > I.e. to have it permanently without ; > > On Saturday, March 26, 2016 at 6:40:16 PM UTC-4, Miguel Bazdresch wrote: >> >> 3; >> >>

Re: [julia-users] How to suppress output from interactive session

2016-03-26 Thread Miguel Bazdresch
3; On the REPL the ; acts just like it does in Matlab, suppressing the output. -- mb On Sat, Mar 26, 2016 at 6:34 PM, feza wrote: > julia> 3 > 3 > > > How can I suppress this during an interactive julia session > > Thanks >

Re: [julia-users] Performance of rand() vs rand(1)

2016-03-13 Thread Miguel Bazdresch
2016 at 9:55 PM, Yichao Yu wrote: > On Sun, Mar 13, 2016 at 9:47 PM, Miguel Bazdresch > wrote: > > While trying to optimize some code for performance, I noticed that rand() > > and randn() generate much more code than rand(1) and randn(1). In > addition, > > It genera

[julia-users] Performance of rand() vs rand(1)

2016-03-13 Thread Miguel Bazdresch
While trying to optimize some code for performance, I noticed that rand() and randn() generate much more code than rand(1) and randn(1). In addition, rand() and randn() have type instabilities, easily seen with @code_warntype. It seems to me than rand() should be faster and generate less code than

Re: [julia-users] Interested in GSoC idea "Random number generation"

2016-03-02 Thread Miguel Bazdresch
I think it'd be great to use this PRNG in julia: http://www.pcg-random.org/ -- mb On Tue, Mar 1, 2016 at 6:28 AM, Upekshe Jayasekera < upekshej...@cse.mrt.ac.lk> wrote: > Hi All, > I am an final year CSE undergraduate in University of Moratuwa. I am new > to julia. But I have heard about julia s

Re: [julia-users] GIF 3D plot

2016-02-18 Thread Miguel Bazdresch
Gaston has support for 3D plots and can save them to GIF files. Take a look at the documentation here: https://bitbucket.org/mbaz/gaston/downloads/gastondoc-0.5.5.pdf I recommend using Gaston "master" instead of the latest release; it has a lot of bugfixes and improvements. The docs for 3-d plotti

Re: [julia-users] Read from a PipeEndpoint in a non-blocking way?

2016-02-03 Thread Miguel Bazdresch
> What I did is that I have a Task that reads from the Pipe and puts the data in an IOBuffer, then read from that in the loop instead, it seems to work. That is what I do, with strings instead of IOBuffers. It does seem to work. -- mb On Wed, Feb 3, 2016 at 11:04 AM, STAR0SS wrote: > I have so

Re: [julia-users] ANN: new blog post on array indexing, iteration, and multidimensional algorithms

2016-02-01 Thread Miguel Bazdresch
Tim, Thanks for putting this tutorial together, it was an interesting read. -- mb On Mon, Feb 1, 2016 at 1:54 PM, Tim Holy wrote: > It's come to my attention that some of the exciting capabilities of julia > 0.4 > for indexing, iteration, and writing generic multidimensional algorithms > may >

Re: [julia-users] Re: recommended graphics packages for multiple curves on a single canvas

2016-02-01 Thread Miguel Bazdresch
Gaston can do that, too. Just be sure to use master instead of the latest release; there's tons of bug fixes and improvements. The PDF documentation is here: https://bitbucket.org/mbaz/gaston/downloads/gastondoc-0.5.5.pdf. -- mb On Mon, Feb 1, 2016 at 9:45 AM, Tom Breloff wrote: > Michael: If y

Re: [julia-users] Interrupting script gives constant error

2016-01-22 Thread Miguel Bazdresch
I tend to just run Jupyter by itself from a command line, not from Julia. Interrupting Julia's notebook() doesn't work reliably. -- mb On Fri, Jan 22, 2016 at 7:32 AM, Lutfullah Tomak wrote: > I have a julia script that runs IJulia > as > > #!/bin/sh > julia -e "using IJulia; notebook()" > > In

Re: [julia-users] Re: Code review request: interacting with another program via stdin, stdout, stderr.

2016-01-20 Thread Miguel Bazdresch
ble compared to the IO cost, and b) it’s actively being worked on > <https://github.com/JuliaLang/julia/pull/13412> and will eventually be > fast. > > // T > > On Tuesday, January 12, 2016 at 3:50:04 AM UTC+1, Miguel Bazdresch wrote: > > Tomas, >> >> Thanks f

Re: [julia-users] Simultaneous audio playback / recording.

2016-01-18 Thread Miguel Bazdresch
An alternative would be to interact with the sound card using sox ( http://sox.sourceforge.net/). In the past, I used sox from Octave to record and play audio simultaneously. Let me know if you'd like to see the code; I can probably dig it out of my old backups. -- mb On Sun, Jan 17, 2016 at 1:30

Re: [julia-users] Re: Code review request: interacting with another program via stdin, stdout, stderr.

2016-01-11 Thread Miguel Bazdresch
u > just want to switch it out for an instance with other field values. If you > actually need to change the *type* of readnow, all bets are off and this > trick won’t work. > > // T > > On Friday, January 8, 2016 at 9:28:02 PM UTC+1, Miguel Bazdresch wrote: > > Hello, &g

[julia-users] Code review request: interacting with another program via stdin, stdout, stderr.

2016-01-08 Thread Miguel Bazdresch
Hello, I'd be grateful if you could take a look at some code and suggest improvements. I'm trying to interact with a long-lived process (gnuplot). This process reads commands from its STDIN; after each command is executed, it produces output on either its STDOUT or STDERR. It's impossible to pred

Re: [julia-users] Reading from open()-ed process produces silence

2015-12-09 Thread Miguel Bazdresch
Do you get different results using readavailable()? Maybe there isn't a newline on the stream and readline() blocks waiting for it. On Tue, Dec 8, 2015 at 2:51 PM, Colin Beckingham wrote: > I'm trying to launch a process from a Julia script. The process is a > socket server. > If I start the soc

Re: [julia-users] Re: How to read an external program's STDOUT using open()

2015-12-07 Thread Miguel Bazdresch
Eventually I wish to capture both stdout and stderr; first I want to learn to capture stdin using open(). And, you did mention stderr in your first reply :) Thanks for the link; I'm keeping an eye out on it, but in its current state its not useful. -- mb On Mon, Dec 7, 2015 at 4:01 PM, James Gil

Re: [julia-users] Re: How to read an external program's STDOUT using open()

2015-12-07 Thread Miguel Bazdresch
Yes, but the problem is that readandwrite() does not provide access to stderr (see https://github.com/JuliaLang/julia/issues/11824). That's why I've been trying alternative solutions. On Mon, Dec 7, 2015 at 1:17 PM, James Gilbert wrote: > Turns out that there is a function *readandwrite() >

Re: [julia-users] Re: How to read an external program's STDOUT using open()

2015-12-07 Thread Miguel Bazdresch
I didn't think that section applied to my case, since I have two processes, each reading/writing to a different pipe. I've also tried to use IOBuffer() and IOStream(), but without any success. Thanks, -- mb On Mon, Dec 7, 2015 at 8:34 AM, James Gilbert wrote: > I think the answer to your prob

[julia-users] How to read an external program's STDOUT using open()

2015-12-05 Thread Miguel Bazdresch
I need to run an external program and write to its STDIN, and read from its STDOUT. I'm trying to do this using open(). Writing to its STDIN works fine with the method below, but I cannot read from its STDOUT. To simplify my tests, I wrote a simple C program called 'stdo' that constantly generates

Re: [julia-users] Re: Code runs 500 times slower under 0.4.0

2015-10-23 Thread Miguel Bazdresch
These are my thoughts exactly. I used Matlab because it was a convenient, easy way to get results, but the warts in the design are real. Julia, besides being convenient and easy, is a pleasure to program in. -- mb On Fri, Oct 23, 2015 at 5:41 PM, Andrew wrote: > I don't think performance is the

Re: [julia-users] Re: @sprintf with a format string

2015-09-24 Thread Miguel Bazdresch
With this Julia code: x = -2.34e-12; for i in 1:5 x=-x*5000. println("$i $x") end I get this output: 1 1.17e-8 2 -5.8506e-5 3 0.29254 4 -1462.50002 5 7.3125001e6 I don't think this is too bad. True, the output is a bit longer, but I actually prefer it

Re: [julia-users] [ANN] Plots.jl, a plotting interface

2015-09-14 Thread Miguel Bazdresch
> in LaTeX, etc. So the plot itself is usually very simple, but I need to be > able to make any change requested by my supervisor, or the journal editor, > or the referee. > > Cheers, > Daniel. > > > > >> >> >> On Thursday, September 10, 2015, Migu

Re: [julia-users] Re: How to capture the output of a system command?

2015-09-12 Thread Miguel Bazdresch
t; the shell window > > rd,wr=redirect_stderr(); > run(pipeline(ignorestatus(cmd), stdout=DevNull, stderr=rd)) > > now if try to read from 'rd' > > readall(rd)# ---> IceAge > > > sábado, 12 de Setembro de 2015 às 15:35:39 UTC+1, Miguel Bazdr

Re: [julia-users] Re: How to capture the output of a system command?

2015-09-12 Thread Miguel Bazdresch
What could be happening is that `gm.exe` is printing that message to STDERR, which is not captured by `readall()`. In theory, the new pipeline infrastructure should let you capture STDERR, but I haven't had the time to figure out exactly how. Maybe somebody who knows will chime in. -- mb On Fri,

Re: [julia-users] [ANN] Plots.jl, a plotting interface

2015-09-10 Thread Miguel Bazdresch
Hi Tom, I'm the author of Gaston.jl. This looks interesting, and I'll take a closer look. I'm wondering, how do you plan to handle the different capabilities of each backend? Say, for example, that the user specifies a plot that Gaston can't handle -- maybe the marker type is not supported by Gnup

Re: [julia-users] META: What are the chances of moving this forum?

2015-09-10 Thread Miguel Bazdresch
Personally, I'd prefer to just have an old-fashioned, LISTERV-type mailing list. Yes, I'm old. -- mb On Wed, Sep 9, 2015 at 7:34 AM, Nils Gudat wrote: > Was just thinking about this as first I had to try opening a thread here a > couple of times before any posts were actually displayed, and the

Re: [julia-users] Help for 'mean' (version 0.4)

2015-09-01 Thread Miguel Bazdresch
The Segmentation Fault strongly suggests a glitch, not an Easter egg, unfortunately... :) On Tue, Sep 1, 2015 at 1:12 PM, wrote: > Using 0.4: > > help?> mean > search: mean mean! median median! SegmentationFault macroexpand > module_parent Meta enumerate Enumerate timedwait primes mask >

Re: [julia-users] Re: Too many packages?

2015-07-12 Thread Miguel Bazdresch
In terms of dependencies and size, Gaston is probably minimal; it depends on gnuplot only, which is a small binary and readily distributed on Linux, OS X and windows. It offers basic features only (but has 3-D plotting), but this may be an advantage for a default package. It is also well documented

Re: [julia-users] IJulia not working on 0.3.10

2015-06-30 Thread Miguel Bazdresch
Works for me on Linux, with julia v0.3.10, and IJulia master. -- mb On Tue, Jun 30, 2015 at 9:00 PM, Gabriel Goh wrote: > Hey everyone, > > I've upgraded to Julia v0.3.10 and did the requisite Pkg.build("IJulia") > commands. After launching an IJulia notebook, the kernel keeps timing out > (rep

Re: [julia-users] readandwrite: how can I read a line as soon as it's written by the process?

2015-06-27 Thread Miguel Bazdresch
To answer your question about Gaston first, when I wrote that code nearly 3 years ago, there was no infrastructure in julia to create pipes to external processes. That's why I went with popen from the C standard library. I will update that code, but I want to read from both Gnuplot's STDOUT and STD

Re: [julia-users] readandwrite: how can I read a line as soon as it's written by the process?

2015-06-27 Thread Miguel Bazdresch
You can make sure that there is data in `so` by looking at its 'bytes waiting' field. If there is indeed data in the pipe, maybe there is no newline character in it? Have you tried `readall` instead of `readline`? -- mb On Sat, Jun 27, 2015 at 8:45 AM, Laurent Bartholdi < laurent.bartho...@gmail.

Re: [julia-users] Re: Problem with ZMQ and Ijulia

2015-06-26 Thread Miguel Bazdresch
se for many binary package dependencies > on Windows) fixing a typo in a configure flag which changed the way > libstdc++ deals with strings. C++ is filled with this nonsense, and even > ZMQ's author regrets writing ZMQ in C++ instead of C. > > > On Thursday, June 25, 2015 at

Re: [julia-users] Re: Problem with ZMQ and Ijulia

2015-06-25 Thread Miguel Bazdresch
It doesn't, at least for me. ZMQ tests still segfault. -- mb On Thu, Jun 25, 2015 at 5:36 PM, Tony Kelman wrote: > 0.3.10 (released yesterday) should fix this error. > > > On Thursday, June 25, 2015 at 10:02:09 AM UTC-4, Miguel Bazdresch wrote: >> >> These issues

Re: [julia-users] Re: Problem with ZMQ and Ijulia

2015-06-25 Thread Miguel Bazdresch
These issues may be relevant: https://github.com/JuliaLang/ZMQ.jl/issues/83 https://github.com/JuliaLang/IJulia.jl/issues/323 -- mb On Thu, Jun 25, 2015 at 9:37 AM, Grigoriy Isaev wrote: > It seems that there is unfixed bug somewhere in Juno distribution. Latest > 64 bit Juno is version 0.3.

Re: [julia-users] Reading from and writing to a process using a pipe

2015-06-22 Thread Miguel Bazdresch
hould probably be part of readandwrite. > > Cheers, > Kevin > > > On Thursday, June 18, 2015, Miguel Bazdresch wrote: > >> Is there a way to read the spawned process' STDERR? Gnuplot likes to >> write most output to it. I've tried >> >> readandwr

Re: [julia-users] Reading from and writing to a process using a pipe

2015-06-18 Thread Miguel Bazdresch
also http://blog.leahhanson.us/running-shell-commands-from-julia.html, > which has a full rundown of reading and writing from processes. > > Cheers! >Kevin > > On Wed, Jun 17, 2015 at 9:03 AM, Miguel Bazdresch > wrote: > >> Hello, >> >> Gaston.jl

Re: [julia-users] Help: My "parallel" code 8300x slower than the serial.

2015-06-17 Thread Miguel Bazdresch
Can you arrange the problem so that you send each CPU a few seconds of work? The overhead would become negligible. -- mb On Wed, Jun 17, 2015 at 4:38 PM, Daniel Carrera wrote: > Sadly, this function is pretty close to the real workload. I do n-body > simulations of planetary systems. In this pr

Re: [julia-users] Reading from and writing to a process using a pipe

2015-06-17 Thread Miguel Bazdresch
of the >process, and the process object itself. > > Which *also* returns a tuple (but at least now you know). > > See also http://blog.leahhanson.us/running-shell-commands-from-julia.html, > which has a full rundown of reading and writing from processes. > > Cheers! >

[julia-users] Reading from and writing to a process using a pipe

2015-06-17 Thread Miguel Bazdresch
Hello, Gaston.jl is a plotting package based on gnuplot. Gnuplot is command-line tool, so I send commands to it via a pipe. I open the pipe (on Linux) with a ccall to "popen", and write gnuplot commands to the pipe using a ccall to fputs. This works fine, but I'm trying to see if Julia's native p

Re: [julia-users] Please sdvise how to plot the matrix (10x1000) with different color

2015-06-17 Thread Miguel Bazdresch
Note that in most plotting packages, `plot(vec)` is interpreted as 1000 functions of 10 elements each. That is, when given a matrix as argument, they plot the columns. -- mb On Tue, Jun 16, 2015 at 8:10 PM, Nelson Mok wrote: > HI, > > Please comment, how to plot the matrix (10x1000) with differ

Re: [julia-users] Is there a plotting package that works for a current 0.4 build?

2015-04-24 Thread Miguel Bazdresch
I haven't tried Gaston on master, but it _may_ work, if you're on Linux or MacOS. -- mb On Fri, Apr 24, 2015 at 6:58 AM, Tomas Lycken wrote: > I git pull-ed and built Julia this morning, and I can't get any of PyPlot, > Winston or Gadfly or TextPlots to show me anything (either loading the > pa

Re: [julia-users] Write your GNU Radio blocks in Julia

2015-04-20 Thread Miguel Bazdresch
, Apr 20, 2015 at 11:37 AM, Jay Kickliter wrote: > Thanks. What OS are you using, and how did you install Julia/GNU Radio? > I'll attempt to fix any major problems before you try it out. > > On Monday, April 20, 2015 at 9:33:18 AM UTC-6, Miguel Bazdresch wrote: >> >> Thi

Re: [julia-users] Write your GNU Radio blocks in Julia

2015-04-20 Thread Miguel Bazdresch
This is great, and something I wanted to do but hadn't had time for. I'll give it a try when I have a chance. On Mon, Apr 20, 2015 at 10:22 AM, Jay Kickliter wrote: > I just pushed a rough draft gr-juliaffi > to GitHub. It is not a > Julia package, b

Re: [julia-users] 3D interactive plots in IJulia

2015-03-03 Thread Miguel Bazdresch
You can do 3-D plots with Gaston.jl, and rotate them with the mouse. I haven't added the required interface to make it compatible with IJulia, though. Even doing that, I doubt that the plot would still be interactive, since that functionality is provided by Gnuplot. -- mb On Tue, Mar 3, 2015 at 1

Re: [julia-users] Displaying a polygon mesh

2014-11-11 Thread Miguel Bazdresch
Gaston has support for 3-D plotting via meshes (it uses gnuplot's surf command). I don't know if this does what you need, though. The documentation is here: https://bitbucket.org/mbaz/gaston/downloads/gastondoc-0.5.5.pdf -- mb On Mon, Nov 10, 2014 at 9:09 PM, Simon Kornblith wrote: > Is there

Re: [julia-users] How Julia do math operations

2014-11-04 Thread Miguel Bazdresch
On Matlab R2013b: >> 2*10.97 + 23.9985 ans = 45.9385 >> 2*10.97 + 23.9985 == 45.9385 ans = 0 >> -- mb On Tue, Nov 4, 2014 at 7:48 PM, Stefan Karpinski wrote: > Some systems round their answers as John said but it's easy to check that > it's a lie: > > R version 3.1.0 (2014-04-10) -- "S

Re: [julia-users] type confusions in list comprehensions (and how to work around it?)

2014-11-03 Thread Miguel Bazdresch
> How could I force the type of gxs1 to be of an array of Float64? The simplest way is: gxs1 = Float64[g(x) for x in xs] -- mb On Mon, Nov 3, 2014 at 6:01 PM, Evan Pu wrote: > Consider the following interaction: > > julia> g(x) = 1 / (1 + x) > g (generic function with 1 method) > > julia> typ

Re: [julia-users] repmat :comparison with Matlab/Octave - 6x slow?

2014-10-14 Thread Miguel Bazdresch
difference but with a bigger > array you save a lot of time avoiding the conversion. > > On Tuesday, October 14, 2014 3:14:38 AM UTC+3, Miguel Bazdresch wrote: >> >> Just wanted to point out a little-known way to achieve the same with the >> `kron` (Kronecker product) command

Re: [julia-users] repmat :comparison with Matlab/Octave - 6x slow?

2014-10-13 Thread Miguel Bazdresch
Just wanted to point out a little-known way to achieve the same with the `kron` (Kronecker product) command: julia> x=[1 2 3 4] 1x4 Array{Int64,2}: 1 2 3 4 julia> kron(x,int(ones(1,3))) 1x12 Array{Int64,2}: 1 1 1 2 2 2 3 3 3 4 4 4 -- mb On Mon, Oct 13, 2014 at 6:05 PM, Rajn wro

Re: [julia-users] 3D plots with Julia

2014-10-01 Thread Miguel Bazdresch
Gaston can also do 3D plots. The docs are here: https://bitbucket.org/mbaz/gaston/downloads/gastondoc-0.5.5.pdf Having said that, PyPlot.jl is probably the way to go, unless you really like gnuplot. -- mb On Wed, Oct 1, 2014 at 2:47 PM, Viral Shah wrote: > Of course! PyPlot.jl is the way to go

Re: [julia-users] negative power throws error

2014-06-08 Thread Miguel Bazdresch
, as well as > > julia> (10//1)^(2//1) > > 100.0 > > > > > Le lundi 9 juin 2014 00:54:37 UTC+2, Miguel Bazdresch a écrit : >> >> I just tried this (on 0.2.1): >> >> julia> (10//1)^(-2//1) >> 0.01 >> >> Is this expected?

Re: [julia-users] negative power throws error

2014-06-08 Thread Miguel Bazdresch
I just tried this (on 0.2.1): julia> (10//1)^(-2//1) 0.01 Is this expected? -- mb On Sun, Jun 8, 2014 at 6:36 PM, 'Stéphane Laurent' via julia-users < julia-users@googlegroups.com> wrote: > julia> (10//1)^(-2) > > 1//100 > > > Would it be problematic to return a rational > for (a::Integer)^

Re: [julia-users] Re: step function like behaviour

2014-06-06 Thread Miguel Bazdresch
I'm not sure I understand the question. Do you mean something like this? inside_disc(x,y,radius) = sqrt(x^2+y^2) wrote: > I guess one can do a for loop. But how do I vectorize the code? > > > On Friday, 6 June 2014 20:27:46 UTC-4, Zahirul ALAM wrote: >> >> How would one implement a step function

Re: [julia-users] How to create a copy of a function but with less arguments?

2014-06-04 Thread Miguel Bazdresch
You can also do this: julia> function f(a,b,c=3) a+b+c end f (generic function with 2 methods) julia> f(1,1) 5 julia> f(1,1,1) 3 -- mb On Wed, Jun 4, 2014 at 6:37 AM, joanenric barcelo wrote: > First of all, sorry if the question in the title is not well explained. > Basically

Re: [julia-users] How to calculate all Euclidean distances between two sets of points in a 3-dimensional space

2014-06-04 Thread Miguel Bazdresch
Have you seen the Distance package? https://github.com/JuliaStats/Distance.jl -- mb On Wed, Jun 4, 2014 at 7:44 AM, Carlos Baptista wrote: > Let's say I have two sets of points in a 3-dimensional space represented > by arrays of sizes Nx3 and Mx3. What is the most efficient way to calculate >

Re: [julia-users] MATLAB v. Julia - why different results?

2014-05-29 Thread Miguel Bazdresch
Weird indeed -- I have the same version and I get the same output as Matlab (125.0 and 126.0). julia> versioninfo() Julia Version 0.2.1 Commit e44b593* (2014-02-11 06:30 UTC) Platform Info: System: Linux (x86_64-unknown-linux-gnu) WORD_SIZE: 64 BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_

Re: [julia-users] Re: OT: entering Unicode characters

2014-05-22 Thread Miguel Bazdresch
ment > (e.g 'C(' -> ⊂, 'm*' -> μ, 's*' -> σ, 'Fm' -> ♀), and honestly, you > wouldn't be using vim if you weren't into maximizing efficiency by learning > short cryptic commands. > > > On Thu, May 22, 2014, at 12:03 PM

Re: [julia-users] Re: OT: entering Unicode characters

2014-05-22 Thread Miguel Bazdresch
In vim, you can do something like imap \alpha u03b1 to reproduce this behavior. -- mb On Thu, May 22, 2014 at 1:27 PM, Steven G. Johnson wrote: > A quick update for people who haven't been tracking git closely: > > The Julia REPL (#6911), IJulia, and (soon) Emacs julia-mode (#6920) now > allo

Re: [julia-users] Generating latex friendly plots

2014-05-12 Thread Miguel Bazdresch
Some time ago I wrote a script to use pgfplots from octave/Matlab: https://bitbucket.org/mbaz/printpgf/src/28cead667bda6ec745a4418bc408f7f712cf8433/inst/printpgf.m It's very easy to use and I've used it for several publications. I tried it to make it very easy to perfectly match fonts with the re

Re: [julia-users] Re: Question on generating rand numbers with fixed state

2014-04-17 Thread Miguel Bazdresch
The distributions.jl package extends Julia's random number capabilities, it's worth a look: https://github.com/JuliaStats/Distributions.jl -- mb On Thu, Apr 17, 2014 at 1:18 PM, X Du wrote: > > Thanks Isaiah, > > It seems that srand([*rng*], *seed*) does not work, I always got the > error rn

Re: [julia-users] Radio.jl: a digital communications package

2014-04-08 Thread Miguel Bazdresch
> duplicate code, especially if you have better ideas. I just want a decent > comms framework so I can pitch Julia to my company as an alternative to > Matlab. > > > On Tuesday, April 8, 2014 7:32:29 AM UTC-6, Miguel Bazdresch wrote: > >> Jay, >> >> I'm

Re: [julia-users] Radio.jl: a digital communications package

2014-04-08 Thread Miguel Bazdresch
Jay, I'm also writing a package to do digital communications simulation, to support my work both in research and in teaching. There's too little functionality at this point to make it worth sharing, but I thought I'd share a couple of ideas. I'm using julia's type system to define bits, symbols,

Re: [julia-users] Re: Radio.jl: a digital communications package

2014-04-07 Thread Miguel Bazdresch
I agree that we should focus on getting something that works, and only then focus on making it good and generic. -- mb On Mon, Apr 7, 2014 at 1:55 AM, Elliot Saba wrote: > Jay, I'm a signal processing student and can help you out with the > multirate dsp if you want. Feel free to contact me o

Re: [julia-users] Re: Radio.jl: a digital communications package

2014-04-07 Thread Miguel Bazdresch
Can't it be done with a pipe? What I mean is, use the radio API to get the data and store in a pipe. In julia, the main process would read from the pipe and run your algorithms on it. If necessary, it could hand the data to another process. I've done something similar to read data from a sound car

Re: [julia-users] Radio.jl: a digital communications package

2014-04-06 Thread Miguel Bazdresch
I've been dreaming of writing a UHD package so that julia could talk to the USRP. That'd be awesome, and probably not too hard, but I haven't found the time. -- mb On Sun, Apr 6, 2014 at 5:19 PM, Elliot Saba wrote: > This is pretty great! I've been wanting to write an rtlsdr library for a > w

Re: [julia-users] Re: Does winston support panning and zooming?

2014-03-04 Thread Miguel Bazdresch
With Gaston, too, if that's any help. -- mb On Tue, Mar 4, 2014 at 8:16 PM, Steven G. Johnson wrote: > Panning and zooming work with PyPlot. > > On Tuesday, March 4, 2014 7:05:07 PM UTC-5, Dan Becker wrote: >> >> I just installed julia (v0.2.1) on windows, followed by winston. Plotting >> works

Re: [julia-users] Linear convolution

2014-03-04 Thread Miguel Bazdresch
urate because of less additions. For very > short kernels this does not hold anymore. But in practice these kinds of > errors are mostly negligable. > > > Am Dienstag, 4. März 2014 16:42:33 UTC+1 schrieb Miguel Bazdresch: >> >> I was worried about getting "a little n

Re: [julia-users] Linear convolution

2014-03-04 Thread Miguel Bazdresch
I was worried about getting "a little noise in the result", so I ran a quick test in Matlab and Julia, and got almost exactly the same error. This is the Matlab code: Ts=0.01; t=-10:Ts:10; s=sinc(t); sc=Ts*conv(s,s); sc=sc(1000:3000); sum((sc-s).*(sc-s)) ans = 0.3695 So, at least for accura

Re: [julia-users] Linear convolution

2014-03-04 Thread Miguel Bazdresch
There is DSP.jl: http://dspjl.readthedocs.org/en/latest/index.html On Tue, Mar 4, 2014 at 10:22 AM, Tobias Knopp wrote: > I don't want to give a definate yes to it but will think a little bit how > such a package could look like. > My Cartesian macro foo is currently completely absent so that I

Re: [julia-users] Re: norm() strangeness

2014-03-03 Thread Miguel Bazdresch
In Julia 0.2.1, I get 6.0. -- mb On Mon, Mar 3, 2014 at 7:22 PM, Carlos Becker wrote: > My mistake there, I meant the L1 norm, re-typed: > > - > X= [[1 2 3],[4 5 6]] > > # now, X[1,:] is 1x3 array, containing 1 2 3 > > # but let's peek at its L1-norm: > norm( X[1,:],

Re: [julia-users] animated plot

2014-02-24 Thread Miguel Bazdresch
Gaston supports output to GIF, which you could then assemble into an animation with an independent tool. https://github.com/mbaz/Gaston.jl If possible, use the development version -- the latest release is getting a bit long in the tooth. -- mb On Mon, Feb 24, 2014 at 11:57 AM, harven wrote:

Re: [julia-users] Continuous data flow similar to Simulink/LabView

2014-02-09 Thread Miguel Bazdresch
Back in 2012 I did some preliminary work along these lines. The simulator is described in this paper: http://www.thinkmind.org/index.php?view=article&articleid=simul_2012_1_20_50094 and the code is at: https://bitbucket.org/mbaz/chango This simulator is able to interface to external devices; at

Re: [julia-users] problem plotting with Gadfly/Cairo

2013-12-30 Thread Miguel Bazdresch
h other packages also, say with PyPlot. I tried > deleting the .julia directory but no luck. I tried both with the standard > installation of Julia as well as with Julia Studio. > > > On Monday, December 30, 2013 3:12:06 PM UTC-8, Miguel Bazdresch wrote: >> >> Laksh, >>

Re: [julia-users] problem plotting with Gadfly/Cairo

2013-12-30 Thread Miguel Bazdresch
Laksh, It works for me with julia 0.2 on Linux. I don't understand what this message means: INFO: Nothing to be done. You shouldn't see that message. Do you get the same thing when loading other packages? Can you delete or rename your .julia directory and try adding the package again? -- mb O