Re: [julia-users] Re: The new Dict syntax in 0.4 is very verbose

2015-09-07 Thread Jeffrey Sarnoff
Do others get this warning? If so, what modification of Mike's macro avoids it? WARNING: deprecated syntax "{a,b, ...}". Use "Any[a,b, ...]" instead. On Thursday, September 3, 2015 at 8:12:50 PM UTC-4, Jeffrey Sarnoff wrote: > > tip o' hat to that > > this minor edit, omitting {Any,Any} (follow

Re: [julia-users] Adding remote workers on windows

2015-09-07 Thread Amit Murthy
I meant the remote machine/network may be firewalled to only accept incoming ssh, http and other known ports. On Tue, Sep 8, 2015 at 5:49 AM, greg_plowman via julia-users < julia-users@googlegroups.com> wrote: > Is port 9009 open on the remote machine? You could try with "tunnel=true" >> if it is

Re: [julia-users] 0.4: calling promote_type in creating type no longer works

2015-09-07 Thread Sheehan Olver
That makes sense! It was from someone else's code, and I was admittedly surprised that it worked. Sent from my iPhone > On 8 Sep 2015, at 10:27 am, Jameson Nash wrote: > > This was only "working" in Julia 0.3 because it gave a random answer instead > of an appropriate error: > > julia> abstr

Re: [julia-users] 0.4: calling promote_type in creating type no longer works

2015-09-07 Thread Jameson Nash
This was only "working" in Julia 0.3 because it gave a random answer instead of an appropriate error: julia> abstract AbstractFoo{T} julia> immutable Foo{T,V} <: AbstractFoo{promote_type(T,V)} end julia> promote_type(TypeVar(:T),TypeVar(:V)) V #nope julia> super(Foo{Int,Float64}) AbstractFoo{Fl

Re: [julia-users] Adding remote workers on windows

2015-09-07 Thread greg_plowman via julia-users
> > Is port 9009 open on the remote machine? You could try with "tunnel=true" > if it is not open. I think so. After running addprocs() and before the wait error, netstat on the remote machine outputs the following: C:\Users\Greg>netstat -an Active Connections Proto Local Address

Re: [julia-users] Re: Julia on OpenBSD

2015-09-07 Thread Jameson Nash
It is essentially a copy of siglongjump (link to OpenBSD source for this funciton: http://ftp.asia.edu.tw/OS/OpenBSD/src/lib/libc/arch/amd64/gen/sigsetjmp.S) with slightly different arguments plus some extra work to restore the floating-point state. The purpose of this function is to replace all ca

[julia-users] Re: How can I delete columns of a matrix in-place?

2015-09-07 Thread Cedric St-Jean
It really depends on what you're trying to achieve. Low memory usage? Speed? Also consider: http://julia.readthedocs.org/en/release-0.3/stdlib/arrays/#Base.sub That should work even better in 0.4. It'll give you an object that behaves like what you asked for, but it won't actually free the memo

[julia-users] Re: overwriting an object - deep copy without copy needed

2015-09-07 Thread Kristoffer Carlsson
Maybe making TInd immutable here would be sensible unless you need to directly modify the fields of it a lot. Even then it would probably be faster to just swap it out for a new TInd with the new fields. That way you can store the whole vector as a contiguous block of memory. On Monday, Septemb

[julia-users] Re: How can I delete columns of a matrix in-place?

2015-09-07 Thread Sheehan Olver
Just curious: if it was [true,true,false] or [false,true,true] would it then be possible? The memory for a matrix is still inline, so these cases should correspond to changing the dimensions or rebasing the initial column. On Tuesday, September 8, 2015 at 4:10:07 AM UTC+10, Tomas Lycken wrot

[julia-users] Re: Why is julia interpreting what's inside a string?

2015-09-07 Thread Sean Marshallsay
Note that if you need the equivalent of Python's raw strings you can just use an empty macro julia> macro raw_str(s) s end julia> raw"3.2 3.6 z(x,y) = x@~\327@~exp(-x@+2@+-y@+2@+)" "3.2 3.6 z(x,y) = x@~\\327@~exp(-x@+2@+-y@+2@+)" julia> raw"grdmath $ DDX" "grdmath \$ DDX" julia> On Monday,

[julia-users] Re: How can I delete columns of a matrix in-place?

2015-09-07 Thread Tomas Lycken
No, that's not possible, at least not in general - to do that, you would have to at least shift all the elements of the columns after the deleted one to make the matrix memory layout consistent. What you can do, if you don't need to use the matrix as an actual matrix, is to use e.g. a Vector{Ve

[julia-users] Re: JuliaCon 2015 videos

2015-09-07 Thread Tomas Lycken
@Viral and others that might know enough to answer this: I know enough javascript to take a stab at doing the random-video-on-startpage thing, but I'm having trouble building the site locally from the github repo. Any advice would be most appreciated: https://github.com/JuliaLang/julialang.git

[julia-users] Re: overwriting an object - deep copy without copy needed

2015-09-07 Thread Cedric St-Jean
Do you ever modify an individual? If not, why not just write world[p].ind = newpop Also, did you profile to make sure that deepcopy is the bottleneck? If your structures are that simple, it's surprising to me that deepcopy is taking a long time. Cédric On Monday, September 7, 2015 at 1:08:50

[julia-users] overwriting an object - deep copy without copy needed

2015-09-07 Thread alexander . kubisch
Hello everybody, I'm comparably new to Julia, but not completely new to programming. Yet, I'm a biologist by training, so please excuse potentially dumb questions in advance :) I am working in evolutionary ecology, programming individual-based simulations. I have now transferred a (very) simpl

Re: [julia-users] Re: Unable to de-reference a Ptr{Uint8} to a string - unsafe load causes an EXCEPTION_ACCESS_VIOLATION in Julia v0.3.9

2015-09-07 Thread Joel Hobson
Awesome, thanks for the examples. I'll take a look. On Monday, 7 September 2015 11:37:24 UTC-4, Isaiah wrote: > > Yup, that's the hacky solution :) > > I modified my example after copying it and didn't fix the last part. > Here's a working version: > > > julia> err = ccall( (:midiOutGetDevCapsA,

Re: [julia-users] Re: emacs IJulia notebook?

2015-09-07 Thread Ista Zahn
This is great! Can you list the steps required to get this working? Thanks, Ista On Sep 5, 2015 6:07 PM, "Maxwell Peterson" wrote: > I have just spent a few hours getting past this error and this thread is a > top google result, so I am adding my fix: > > I had the same issue as Andrew. First, n

Re: [julia-users] Re: Unable to de-reference a Ptr{Uint8} to a string - unsafe load causes an EXCEPTION_ACCESS_VIOLATION in Julia v0.3.9

2015-09-07 Thread Isaiah Norton
Yup, that's the hacky solution :) I modified my example after copying it and didn't fix the last part. Here's a working version: julia> err = ccall( (:midiOutGetDevCapsA, :Winmm), Uint64, (Ptr{Uint64}, Ref{Mid iOutCaps}, Uint32), 0, output_struct, sizeof(output_struct)) WARNING: convert(::Type{P

[julia-users] Re: Unable to de-reference a Ptr{Uint8} to a string - unsafe load causes an EXCEPTION_ACCESS_VIOLATION in Julia v0.3.9

2015-09-07 Thread Joel Hobson
Isaiah - Thank you so much. I was able to work around the array issue in Julia 3.9 by declaring an immutable type with one field for each character. Kind of an ugly solution, but szPname is limited to 32 characters, so it's not a big deal. I think it would be more elegant to use a large bitstype

[julia-users] Re: Julia on Mac OS X Yosemite

2015-09-07 Thread Tony Kelman
The problematic symlink is most likely to do with ~/.julia/v0.3/.cache. You might be able to just remove that then do Pkg.init again. Failing that, make a copy of the list of currently installed packages you have from ~/.julia/v0.3/REQUIRE, remove ~/.julia entirely and re-install those packages

[julia-users] Julia on Mac OS X Yosemite

2015-09-07 Thread Igor Rivin
I have recently installed (then re-installed) Julia 0.3.11, and I am having problems with packages. Should I be concerned? *_* *_** _ **_**(_)**_** | A fresh approach to technical computing* *(_)** | **(_)* *(_)**| Documentation: http://docs.julialang.or

[julia-users] Re: Unable to de-reference a Ptr{Uint8} to a string - unsafe load causes an EXCEPTION_ACCESS_VIOLATION in Julia v0.3.9

2015-09-07 Thread Joel Hobson
Sorry about the last post - I'm new, so it was caught in the moderation filter. I actually wrote it before Tony and Isaiah posted. Isaiah - That looks promising, thanks! It's been a long time since I've used C, so I completely missed that szPname isn't a pointer. On Sunday, 6 September 2015 17:

Re: [julia-users] Re: Julia on OpenBSD

2015-09-07 Thread Maurizio Tomasi
Update: I submitted a PR for libunwind and got the following answer from *cbergstrom* (https://github.com/pathscale/libunwind/pull/5#issuecomment-138237585): I don't want to turn you away from pathscale/libunwind, but do you know if > Julia can use the Apple libunwind? I really don't know wha

[julia-users] Re: Channels for multitasking / multithreading

2015-09-07 Thread Laurent Bartholdi
Here seems to be a safer implementation... but I'm still not quite confident it's optimally written. Opinions welcome! function subdivide(v0,v1,filter::Function,middle::Function,doer::Function) c = Channel(100) results = Any[doer(v0),doer(v1)] filter(v0,v1) || return results # not

Re: [julia-users] Re: abs() returning negative numbers??

2015-09-07 Thread Michele Zaffalon
Thank you. On Mon, Sep 7, 2015 at 1:48 PM, Yichao Yu wrote: > On Mon, Sep 7, 2015 at 12:05 AM, Michele Zaffalon > wrote: > > Why does > > input_len::Uint = sizeof(bytes_input) > > work in the body of the function but not at the REPL? > > We don't have typed global yet. > > https://github.com/Ju

Re: [julia-users] Re: abs() returning negative numbers??

2015-09-07 Thread Yichao Yu
On Mon, Sep 7, 2015 at 12:05 AM, Michele Zaffalon wrote: > Why does > input_len::Uint = sizeof(bytes_input) > work in the body of the function but not at the REPL? We don't have typed global yet. https://github.com/JuliaLang/julia/issues/8870 > > Inside the function, it is converted to > _var0

Re: [julia-users] Adding remote workers on windows

2015-09-07 Thread Amit Murthy
Is port 9009 open on the remote machine? You could try with "tunnel=true" if it is not open. On Mon, Sep 7, 2015 at 4:32 PM, Greg Plowman wrote: > Hi, > > I'm trying to use addprocs() to add remote workers on another windows > machine. > > I'm using a ssh server for windows (Bitvise) with a modi

[julia-users] Adding remote workers on windows

2015-09-07 Thread Greg Plowman
Hi, I'm trying to use addprocs() to add remote workers on another windows machine. I'm using a ssh server for windows (Bitvise) with a modified Cluster Manager, and have successfully used this method in another environment. So I know that it works, although one difference is Window 7 (works) v

Re: [julia-users] Has std() enough precision?

2015-09-07 Thread Simon Byrne
Numpy gives the same results as above, but interestingly R gives the mathematically correct result. It appears that they use a 2-pass approach for computing the mean: https://github.com/wch/r-source/blob/6338928e70891145221c781a19d2bb6b17868fb5/src/main/summary.c#L429-L437 -s On Monday, 7 Septe

Re: [julia-users] Has std() enough precision?

2015-09-07 Thread Simon Byrne
The problem is that the computation of the mean is inaccurate: although the relative error is small, when you perform the subtraction for computing the standard deviation, as the numbers are almost the same, the relative error is massively amplified (this is typically known as *catastrophic can

[julia-users] Re: cleaning up objects in parallel processes?

2015-09-07 Thread Nils Gudat
Aren't you locally creating state on each of the worker processes?

[julia-users] Re: PyPlot ERROR: LAPACKException

2015-09-07 Thread Tony Kelman
0.3.0 is a year out of date, you should update to 0.3.11. Depending which BLAS implementation is being used there, you probably need to add USE_BLAS64=0 when you build. Where is the actual make command getting run there, and what flags are being used? On master when you set USE_SYSTEM_BLAS we n

[julia-users] Re: Unable to de-reference a Ptr{Uint8} to a string - unsafe load causes an EXCEPTION_ACCESS_VIOLATION in Julia v0.3.9

2015-09-07 Thread Joel Hobson
Still no luck - I've looked at the windows sdk, and I'm sure I've got all the type sizes correct. I've added the stdcall convention to the ccall with no luck, along with initializing szPname to C_NULL, which seems to be the more correct approach from the c source I've looked at. I've tried movin

[julia-users] Re: PyPlot ERROR: LAPACKException

2015-09-07 Thread Phil_n
julia> versioninfo() Julia Version 0.3.0 Platform Info: System: Linux (x86_64-pc-linux-gnu) CPU: Intel(R) Core(TM) i7-4550U CPU @ 1.50GHz WORD_SIZE: 64 BLAS: libblas

Re: [julia-users] "Julian" way of doing protected methods and extension packages

2015-09-07 Thread Mauro
Hmm, you could try (in pseudo-code): str = load("my-extension.jl") ex = parse(str) eval(ApproxFun, ex) That should evaluate all of the contents of my-extension.jl in the scope of the module ApproxFun, so no need for imports or fully qualifying. However, I don't know whether this is a good idea (o

Re: [julia-users] Has std() enough precision?

2015-09-07 Thread Tim Holy
On Sunday, September 06, 2015 11:46:05 PM Diego Javier Zea wrote: > Then, what is the best way to test if a number is equal to 0.0? Not to do it. Much better is to see whether it's much smaller than something finite, e.g., sta < 100*eps(ave). ave provides the scale against which sta should be me

Re: [julia-users] Re: Julia on OpenBSD

2015-09-07 Thread Maurizio Tomasi
*@Jameson*, I was able to go a little further by modifying libunwind's source code in order to include instead of . However, there is some point where non-trivial assembly code needs to be ported: https://github.com/pathscale/libunwind/blob/vanilla_pathscale/src/x86_64/setcontext.S#L95 I have