[julia-users] Re: Macros Hygiene

2016-05-16 Thread Jameson
A macro can't modify an argument, it always receives immutable objects or copies of Expr trees. This is not at all similar to how a function accepts a reference to an object. If you are using `eval` in your macro to mutate a variable, stop right now. Replace all your macros with functions. Then

[julia-users] Re: Need to call Julia from C#

2016-05-16 Thread Jameson
You'll need to provide more info about what you've tried and what's confusing if you expect someone to be able to help you. The subject area is simply too broad to do more than point you to the relevant documentation at https://github.com/JuliaLang/julia/blob/master/examples/embedding.c,

[julia-users] Re: Cannot readandwrite from same process

2016-05-16 Thread Jameson
Julia doesn't consume bytes from the pipe until you try to read them to make sure the upstream pressure on the pipe is appropriately maintained (for flow control). You could read a byte by calling `read(so)`, but note that `cat` also internally buffers it's IO, so your program will probably

[julia-users] Question: How to Define an Array of Pointers Correct to Transfer it to a C function

2016-05-16 Thread Stefan Schnell
Hello community, I want to transfer an array of pointers to a C function with the following code: #-Structures-- type TestStruct2 name::Ptr{UInt16} value::Ptr{UInt16} end

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

2016-05-16 Thread Jameson
Launch each socket into it's own task (@async) and let Julia's green-threading manage the poll/select for you internally. On Friday, May 13, 2016 at 8:08:01 PM UTC-4, Andrei Zh wrote: > > 1. I found out that TCPSocket contains several conditions and callbacks, > but I couldn't find any docs or

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

2016-05-16 Thread Scott Jones
I'll also take a stab at this. For context, I've been programming in Julia full time for the last 13 months, as well as mentoring a couple of my colleagues using Julia, and have contributed to various parts of Julia (string conversions, unit tests, documentation, among other things). * I use

[julia-users] Re: Matrix multiplication performance with BitMatrix, Matrix{Bool}, Matrix{Int8}

2016-05-16 Thread Andreas Noack
I think there'll necessarily be some overhead in the decompression of the packed Booleans in a BitArray. The difference between Bool and Int8 is that the Int8 is promoted to a Float64 whereas a Bool is not. It appears that the Bool multiplication in

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

2016-05-16 Thread Alireza Nejati
Indeed you're right; I wrote that example in a hurry. It's been updated (I've taken a lot more care in the actual code - documentation was never my forte). What kind of vehicle routing algorithms do you use? I'd be interested to know the uses people can find for stuff like this. I'm personally

[julia-users] Re: invalid assignment location

2016-05-16 Thread Nguyen Vinh Phu
Thanks a lot :) Best regards, Phu On Monday, 16 May 2016 18:33:27 UTC+10, Nguyen Vinh Phu wrote: > > Hello, > > > Could you please help me about the following error > > > *ERROR: LoadError: LoadError: syntax: invalid assignment location "3"* > > * in include at >

[julia-users] Async file IO?

2016-05-16 Thread ggggg
Hello All, I think that Julia IO is built on libuv, and that libuv offers asynchronous IO to the filesystem. Is this exposed through the Julia API? I can't figure it out from the documentation. I did a simple test *julia> **tic(); t = @async read(open("filename"),UInt8,25); yield();

Re: [julia-users] LQ decomposition.

2016-05-16 Thread Sheehan Olver
In this particular case, I let the students collaborate and use outside resources as long as they cited the sources. But asking for the answer on Julia-users was not exactly what I had in mind... Sent from my iPad > On 17 May 2016, at 12:27 AM, Tamas Papp wrote: > > Many

[julia-users] Need to call Julia from C#

2016-05-16 Thread Richard Melito
Hello, I have an application written in C# that needs to pass data to functions I wrote in Julia. The documentation for how to do this is extremely confusing, so hopefully someone here can help. I would like to turn my Julia code into a .dll to access it. How do I do that? Am I approaching

[julia-users] Change input key bindings

2016-05-16 Thread yousef . k . alhammad
Hello everyone, I'm trying to build an application with a command-line interface (CLI). I want to be able to navigate a command-line menu with arrow keys. However, I can't figure out how to change the behavior of key strokes, e.g. arrow keys. I know it's possible to do this by modifying

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

2016-05-16 Thread Jon Norberg
I mentioned a few issues on the Jupyter group regarding iPad usability, such as kinetic scrolling and some issues mentioned above. It's working ok, but a few things are still awkward for ipad

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

2016-05-16 Thread Viral Shah
Perhaps we need to update to a newer version of Jupyter for the arrow keys? On the reliability front, Sheehan can you tell us what kind of instabilities are you facing? We are quite keen to make this reliable, and generally there are thousands of sessions every week. The sessions are

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread j verzani
Yes, I haven't found the time to get to that, but definitely needs to be done. On Monday, May 16, 2016 at 11:48:07 AM UTC-4, Tom Breloff wrote: > > And to quickly expand on the Plots issue... SymPy should be removing any > dependency on Plots in the near future (John we'll chat soon), and

[julia-users] Re: How to vectorize a function which has a tuple as return value to a function which returns a tuple of matrices instead of a matrix with tuple elements?

2016-05-16 Thread Hakuna M.
Am Montag, 16. Mai 2016 16:11:39 UTC+2 schrieb Chris Rackauckas: > > I make this function to solve this problem in one of m codes: > > function shapeResult(res) > #Input is a vector of tuples > #Output the "columns" as vectors > out = cell(length(res[1])) > for i = 1:length(res[1]) >

[julia-users] Re: How to vectorize a function which has a tuple as return value to a function which returns a tuple of matrices instead of a matrix with tuple elements?

2016-05-16 Thread Hakuna M.
Am Montag, 16. Mai 2016 14:08:08 UTC+2 schrieb Christopher Fisher: > > > It appears that a::Float64 is converting your array into separate > instances of Float64. Either of these should work: > > tupleFun(a::Array{Float64,2}) = (a+1, a-1) > tupleFun(rand(3,3)) > > tupleFun(a) = (a+1, a-1) >

[julia-users] Re: Some sort of sandboxing and scheduling and persistence of state

2016-05-16 Thread Aaron R. M.
Well sorry for having not reacted for a over a month... I didn't get any notification mail -.- Thanks for all the tips in getting as close as possible. To describe my problem as good as possible i tell my actual use case: I want to build a roboter in Minecraft that can be coded using Julia

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread Tom Breloff
No worries on plotting in SJulia... there will be a good solution, and you can tackle it later. I was simply responding to this: On Julia 4.0 SymPy won’t work on my system (it complains about > precompiling): > *julia> * > *using SymPy* > *INFO: Precompiling module SymPy...**ERROR: LoadError:

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

2016-05-16 Thread Rob J. Goedman
My apologies. The remark on the arrow keys is not correct. I should have gone to try.jupyter.org before sending the email. From that site the arrow keys on the iPad work fine! Viral or Tanmay, could this be specific to JuliaBox? Rob > On May 16, 2016, at 09:05, Rob J. Goedman

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread lapeyre . math122a
Tom, sure, I'm available to chat. Regarding plotting: As, I wrote, SJulia does not depend on SymPy.jl so it should not depend on any plotting libraries. I looked at Plots.jl quickly a few days ago, but could not get it to run on recent v0.5 builds. It wouldn't take much to put some kind of

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

2016-05-16 Thread Rob J. Goedman
Sheehan, Interesting link to computableapp.com. Have you ever seen the arrow keys work on IJulia or JuliaBox? I’ve certainly seen them work in other apps, e.g. Textastic, just not in IJulia. My guess is that the key codes have changed. Neither do they work on the older bluetooth keyboard.

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

2016-05-16 Thread Tom Breloff
If your data is gridded (but just in vector form), then likely you could just "zmat = reshape(z, numrows, numcols)" and then "contour(zmat)". On Mon, May 16, 2016 at 11:49 AM, wrote: > Yes, my data is gridded. And no, I don't plan to sample these density > values

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread lapeyre . math122a
Hi, Thanks for the report. I have no idea how to install this on OS X. I am happy to get any feedback; bugs, comments, etc. Please post to this thread, or better, the issue tracker for SJulia. I added the following text to the README. Note the part about SymPy. *Note* SymPy here refers to

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread Rob J. Goedman
Hi Tom, Thanks for jumping in. Yes, I had noticed the two packages might interfere through possibly a __precompile__ setting? I’m ok to have SJulia (and Unitful, which is another one of my favorite packages) only work on 0.5 for now. Plots.jl for now I’m using mainly on 0.4 to work on the

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

2016-05-16 Thread ameliafitzsimmons1
Yes, my data is gridded. And no, I don't plan to sample these density values later. I just want to plot it and see what it looks like :) I'm not sure how to reshape the data into a 2D array though, or how to make a contour plot from a dataset rather than from a function. Is there anything on

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread Tom Breloff
And to quickly expand on the Plots issue... SymPy should be removing any dependency on Plots in the near future (John we'll chat soon), and should be switching to providing recipes through https://github.com/JuliaPlots/RecipesBase.jl. (this is the missing "_apply_recipe" that you see) I'm very

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread Rob J. Goedman
Thanks Kevin, That solved the problem! I used 'condo install mpmath’ in addition to ‘pip install mpmath’, just to make sure (shows I am way too rusty on Python stuff), and then reinstalled both SymPy and Julia. Thanks a lot, will certainly track Julia development! Regards, Rob > On May 16,

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread Kevin Squire
Hi Rob, You'll need to install the `mpmath` package for python. If you use `pip`, you should just be able to run `pip install mpmath`. Otherwise, you'll have to find and install the package using your preferred method. (I also ran into this. John, you should probably mention this in the

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread Tom Breloff
The SymPy error you see is related to Plots, but I'd need to review his code again to understand why it's doing that. Most likely it's because you are on a recent version of Plots and SymPy hasn't caught up yet. (and you might not have installed a recent Plots on 0.5?) On Mon, May 16, 2016 at

Re: [julia-users] Symbolic mathematics language v 0.0.6

2016-05-16 Thread Rob J. Goedman
Hi, As I use Mathematica quite a bit, I’m very interested in SJulia! I’m wondering if I need an additional Module or library to get around below issue. This is on OS X and Julia 0.5- ERROR: InitError: PyError (:PyImport_ImportModule) ImportError('No module named mpmath',) [inlined code]

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

2016-05-16 Thread Evan Fields
Very cool stuff; I could see this being really useful in heuristic vehicle routing work I do. By the way, in the readme should the 2d example which creates the line y = 1 first create the x-axis (y=0) and then offset? It looks like you're using the second component vector [0,1].

[julia-users] Re: Julia and Slurm 'Hello World'

2016-05-16 Thread Chris Rackauckas
XSEDE's Comet uses slurm. Here's a tutorial that will get you started. While cluster managers will work, the machinefile system is dead simple and I found it integrated the easiest into many different machines. On

[julia-users] Re: Julia and Slurm 'Hello World'

2016-05-16 Thread Valentin Churavy
I would recommend that you look into ClusterManagers.jl https://github.com/JuliaParallel/ClusterManagers.jl it includes a simple starting script for using it with slurm. On Monday, 16 May 2016 23:27:21 UTC+9, John Hearns wrote: > > I hope this is an acceptable question... > I am starting out

[julia-users] Re: Package Documentation Tools

2016-05-16 Thread paul . j . wanish
Best chat I could locate... Looking for Fedora version, and the download link seems broke. Others seeing this as well (at https://copr.fedoraproject.org/coprs/nalimilan/julia/) On Wednesday, May 11, 2016 at 10:04:58 AM UTC-4, Chris Rackauckas wrote: > > Hi, > I was wondering if there's any

Re: [julia-users] LQ decomposition.

2016-05-16 Thread Tamas Papp
Many computer language mailing lists/forums have some policy about homework problems. Even though most universities (and, in addition, some specific courses) also have rules for proper academic conduct which should preclude questions like the OP, perhaps guidelines about homework problems should

[julia-users] Julia and Slurm 'Hello World'

2016-05-16 Thread 'John Hearns' via julia-users
I hope this is an acceptable question... I am starting out with Julia, and am looking at the parallelism facilities. How does Julia integrate with batch schedulers and their job launch mechanisms, specifically Slurm? Is there a 'Hello World' I can try which will use SLurm to launch a parallel

Re: [julia-users] LQ decomposition.

2016-05-16 Thread Chris Rackauckas
Lol. On Monday, May 16, 2016 at 12:21:49 AM UTC-7, Sheehan Olver wrote: > > Especially when it's a discussion board that the lecturer posts > regularly... > > On Sunday, May 15, 2016 at 10:56:14 PM UTC+10, Stefan Karpinski wrote: >> >> This appears to be a homework question. Just as on

[julia-users] Re: How to vectorize a function which has a tuple as return value to a function which returns a tuple of matrices instead of a matrix with tuple elements?

2016-05-16 Thread Chris Rackauckas
I make this function to solve this problem in one of m codes: function shapeResult(res) #Input is a vector of tuples #Output the "columns" as vectors out = cell(length(res[1])) for i = 1:length(res[1]) out[i] = Vector{typeof(res[1][i])}(length(res)) end for i = 1:length(res), j =

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

2016-05-16 Thread Scott T
I've been writing papers that have scientific results powered by Julia, and I want every part of the paper to be reproducible if necessary. So I'm finding myself writing a lot of Jupyter notebooks to tinker around with things, make or read data files, make and save plots (as svg, png and pdf),

Re: [julia-users] return in function

2016-05-16 Thread digxx
yeah sorry I just found that out why I deleted the thread. Sorry Am Montag, 16. Mai 2016 13:46:24 UTC+2 schrieb Yichao Yu: > > On Mon, May 16, 2016 at 6:20 AM, digxx > wrote: > > So I want to do the following function but it doesnt work. > > The problem probably is that

[julia-users] Re: How to vectorize a function which has a tuple as return value to a function which returns a tuple of matrices instead of a matrix with tuple elements?

2016-05-16 Thread Christopher Fisher
It appears that a::Float64 is converting your array into separate instances of Float64. Either of these should work: tupleFun(a::Array{Float64,2}) = (a+1, a-1) tupleFun(rand(3,3)) tupleFun(a) = (a+1, a-1) tupleFun(rand(3,3)) On Sunday, May 15, 2016 at 11:20:33 AM UTC-4, Hakuna M. wrote: >

Re: [julia-users] return in function

2016-05-16 Thread Yichao Yu
On Mon, May 16, 2016 at 6:20 AM, digxx wrote: > So I want to do the following function but it doesnt work. > The problem probably is that I need something like a "return" at the and > which I incorporated symbolically. Atm the output is empty. > > function vk(k,x) > >

[julia-users] Re: Base.show(io::IO, mytype::Type) results in cluttered display for arrays

2016-05-16 Thread David P. Sanders
El lunes, 16 de mayo de 2016, 5:10:56 (UTC-4), Anonymous escribió: > > Wow strange, I could have sworn I tried that and it didn't do anything, > but now it works, thanks. > This could be to do with some effect of caching of previously-defined methods; restarting Julia would get rid of these.

Re: [julia-users] How to change REPL mode on startup?

2016-05-16 Thread lapeyre . math122a
Here is a PR https://github.com/JuliaLang/julia/pull/16384 Given the discussion around https://github.com/JuliaLang/julia/pull/13545, I doubt it will be accepted as is. John On Sunday, May 15, 2016

[julia-users] Re: return in function

2016-05-16 Thread digxx
Sorry I forgot: x_a=0 x_b=5 N=50 X=linspace(x_a,x_b,N) before the function.

[julia-users] return in function

2016-05-16 Thread digxx
So I want to do the following function but it doesnt work. The problem probably is that I need something like a "return" at the and which I incorporated symbolically. Atm the output is empty. function vk(k,x) res=zeros(length(x)) if k>=2 && k<=(N-1) for i=1:length(x) if x[i]<=X[k] &&

[julia-users] error in ijulia

2016-05-16 Thread Henri Girard
Hi, If I use this plot in terminal julia it works fine, but in IJulia it does an error. Any help Thanks HG using Plots pyplot(reuse=true) x=y=linspace(-5,5,30) surface(x,y,(x,y)->sin(x)+cos(y), line=(1,:black),fill=(0.8,:rainbow), tickfont=font(8),guidefont=font(6),

[julia-users] Re: invalid assignment location

2016-05-16 Thread Kristoffer Carlsson
julia> 3 = 5 ERROR: syntax: invalid assignment location "3" in eval(::Module, ::Any) at ./boot.jl:226 On Monday, May 16, 2016 at 10:33:27 AM UTC+2, Nguyen Vinh Phu wrote: > > Hello, > > > Could you please help me about the following error > > > *ERROR: LoadError: LoadError: syntax: invalid

[julia-users] Re: Base.show(io::IO, mytype::Type) results in cluttered display for arrays

2016-05-16 Thread Anonymous
Wow strange, I could have sworn I tried that and it didn't do anything, but now it works, thanks. On Monday, May 16, 2016 at 1:40:06 AM UTC-7, David P. Sanders wrote: > > Change the print statement to print(io, "..."). io is the object of type > IO that you need to print to.

[julia-users] Base.show(io::IO, mytype::Type) results in cluttered display for arrays

2016-05-16 Thread David P. Sanders
Change the print statement to print(io, "..."). io is the object of type IO that you need to print to.

[julia-users] invalid assignment location

2016-05-16 Thread Nguyen Vinh Phu
Hello, Could you please help me about the following error *ERROR: LoadError: LoadError: syntax: invalid assignment location "3"* * in include at /Applications/Julia-0.4.5.app/Contents/Resources/julia/lib/julia/sys.dylib* * in include_from_node1 at

[julia-users] Base.show(io::IO, mytype::Type) results in cluttered display for arrays

2016-05-16 Thread Anonymous
So I have code of the form: type Foo x::Int end Base.show(io::IO, foo::Foo) = print("Foo:\n x = $(foo.x)") This works fine for a single instance of Foo, but when I have an array of Foo objects the display for the array in the REPL calls Base.show() multiple times on each element and doesn't

Re: [julia-users] LQ decomposition.

2016-05-16 Thread Sheehan Olver
Especially when it's a discussion board that the lecturer posts regularly... On Sunday, May 15, 2016 at 10:56:14 PM UTC+10, Stefan Karpinski wrote: > > This appears to be a homework question. Just as on StackOverflow, it's not > ok to ask people to do homework problems for you on julia-users. >

Re: [julia-users] A Question About Structure Of Pointers

2016-05-16 Thread Stefan Schnell
Hello Yichao, thanks for your detailed answer. It seems to be tricky to combine Julia with other languages. I will try it out. Cheers Stefan