Re: [julia-users] confused about "no method endof"

2014-03-03 Thread Ivar Nesje
Maybe you defined My module.endof instead of Base.endof?

Re: [julia-users] @devec slowing execution down

2014-03-03 Thread Ivar Nesje
B[:] makes it an inplace assignment, so that the array B references is actually reused. As you can see, @devec has little benefit for a single function, but if you have many functions chained together you will see the benefits. B[:] = sin(pi - x) .* e.^x

Re: [julia-users] Re: ERROR: no method chomp(Array{Uint8,1})??

2014-03-03 Thread Sam Lendle
That's a relief. I thought I was going nuts. I must have updated packages on my laptop right before v0.2.11 and right after on my desktop. Thanks! Sam On Mon, Mar 3, 2014 at 8:38 PM, Kevin Squire wrote: > This was a recently introduced bug in GZip.jl. It should be fixed in a > few minutes. >

Re: [julia-users] Should ∞ equal Inf?

2014-03-03 Thread Kevin Squire
It's probably possible. Do you just want ∞ to be equivalent to Inf, or do you want to include Inf32 and Inf16 and inf(BigFloat)? If you want ∞ to be usable with all of these types (just as pi and π are), then you would probably define ∞ as a MathConst, and deal with the output of the various `Inf

[julia-users] Help in Winston FramedPlot()

2014-03-03 Thread Bina Caroline
Hi, When I run the test file of Winston, i always got the FramedPlot(...). How can the plot show? using Winston large = [i^4 + 1e12 for i in 1:10^3] small = [1:10^3] p = plot(small,large) *julia> **p = plot(small,large)* *FramedPlot(...)* Also, I did. *julia> **FramedPlot(p)* *ERROR: Bound

Re: [julia-users] confused about "no method endof"

2014-03-03 Thread Kevin Squire
A little more information would probably be useful. What is the type of geo.eps? I would guess it is not a Ptr{PetscVec_s}, because that's what seems to be missing, according to the error. Cheers, Kevin On Mon, Mar 3, 2014 at 6:30 PM, xdavidliu wrote: > Hi, I'm having some issues with "en

Re: [julia-users] Re: ERROR: no method chomp(Array{Uint8,1})??

2014-03-03 Thread Kevin Squire
This was a recently introduced bug in GZip.jl. It should be fixed in a few minutes. Kevin On Mon, Mar 3, 2014 at 4:29 PM, Sam L wrote: > Hmm thanks for the response. I've also tried rebuilding julia from scratch > in a freshly cloned repo and still no luck. > > > On Monday, March 3, 2014 11:0

[julia-users] Should ∞ equal Inf?

2014-03-03 Thread Sheehan Olver
I think ∞ should be equivalent to Inf, like π is equivalent to pi. Any reason this isn't already the case? Sheehan

[julia-users] Re: Ask for help in GLMNet Package

2014-03-03 Thread Bina Caroline
Thanks. It works now ! 在 2014年3月2日星期日UTC-6下午11时10分12秒,Simon Kornblith写道: > > It seems like you don't have a GLMNet binary. This was supposed to be > built when you ran Pkg.add("GLMNet"); maybe you got an error message? > Make sure you have gfortran installed and then run Pkg.build("GLMNet"). > >

[julia-users] confused about "no method endof"

2014-03-03 Thread xdavidliu
Hi, I'm having some issues with "endof". Here's an example that hopefully is self-explanatory enough not to need any context or "smallest code that reproduces the error"; perhaps someone can tell me if I'm doing something stupid. If not, I'd be happy to reproduce the error. In [7]: (geo.eps

Re: [julia-users] @devec slowing execution down

2014-03-03 Thread Jason Solack
that did help, second run is now 1.425! What does the B[:] do exactly? On Monday, March 3, 2014 8:44:59 PM UTC-5, Keno Fischer wrote: > > Try `@devec B[:] = exp(A)` > > > On Mon, Mar 3, 2014 at 8:39 PM, Jason Solack > > wrote: > >> that did help a lot: >> >> function testSpeed() >> A = rand(

[julia-users] Re: Immutable objects and identity

2014-03-03 Thread andrew cooke
i assumed that passing by value was an optimization, but i don't know what triggers it. it may be that it's only for immutable types without pointers to mutable types. or it may be based on size. it might be something to worry about if your instances are large. there's a memoize.jl module s

Re: [julia-users] @devec slowing execution down

2014-03-03 Thread Keno Fischer
Try `@devec B[:] = exp(A)` On Mon, Mar 3, 2014 at 8:39 PM, Jason Solack wrote: > that did help a lot: > > function testSpeed() > A = rand(1) > B = zeros(Float64, size(A, 1)) > tic() > B = exp(A) > toc() > > tic() > @devec B = exp(A) > toc() > > > end > >

Re: [julia-users] @devec slowing execution down

2014-03-03 Thread Jason Solack
that did help a lot: function testSpeed() A = rand(1) B = zeros(Float64, size(A, 1)) tic() B = exp(A) toc() tic() @devec B = exp(A) toc() end testSpeed() but it's still a little slower.. the above example is 1.515 in the first test and 1.533 in

Re: [julia-users] @devec slowing execution down

2014-03-03 Thread Stefan Karpinski
Global scope ? On Mon, Mar 3, 2014 at 8:16 PM, Jason Solack wrote: > Hello all. I am trying to use Devectorize to speed up some code i have > written but it's having the opposite effect. Am i doing someth

[julia-users] @devec slowing execution down

2014-03-03 Thread Jason Solack
Hello all. I am trying to use Devectorize to speed up some code i have written but it's having the opposite effect. Am i doing something wrong? Take this example A = rand(100) B = zeros(Float64, size(A, 1)) tic() B = exp(A) toc() tic() @devec B = exp(A) toc() in the first exp runs

[julia-users] Re: Immutable objects and identity

2014-03-03 Thread Pierre-Yves Gérardy
My use case is different, objects can be nested and thus quite large, but, after reflection, knowing how they'll be constructed, it shouldn't matter much. Thanks for your replies. —Pierre-Yves On Tuesday, March 4, 2014 12:35:01 AM UTC+1, andrew cooke wrote: > > > yes - i asked about that last w

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] Command interpolation question

2014-03-03 Thread Stefan Karpinski
It's not a terrible idea but it's a bit dangerous as there's more than one way to do the conversion, in which case we tend to make people be explicit. > On Mar 3, 2014, at 7:37 PM, John Myles White wrote: > > You might hate this suggestion, but I would love to be able to convert String > -> C

Re: [julia-users] Re: Feature Request - start and inc for enumerate

2014-03-03 Thread Stefan Karpinski
Might make sense as an issue or a pull request. Might be better to add a strided enumeration type or something like that, but this could also be accomplished by a composition of iterators – tail and step of something like that. > On Mar 3, 2014, at 3:48 PM, andrew cooke wrote: > > > Looking

Re: [julia-users] Command interpolation question

2014-03-03 Thread John Myles White
You might hate this suggestion, but I would love to be able to convert String -> Cmd. -- John On Mar 3, 2014, at 4:36 PM, Stefan Karpinski wrote: > Yeah, probably, although those names make me think the API might need a > little thought. Maybe these should really be conversion methods. > >

Re: [julia-users] Command interpolation question

2014-03-03 Thread Stefan Karpinski
Yeah, probably, although those names make me think the API might need a little thought. Maybe these should really be conversion methods. > On Mar 3, 2014, at 6:56 PM, John Myles White wrote: > > Would those names be more Julian as splitcmd and escapecmd? > > -- John > >> On Mar 3, 2014, at 7

[julia-users] Intrinsic symbols

2014-03-03 Thread Fil Mackay
I just noticed that typeof(:true) == Bool. I was expecting it to be Symbol. I am fine with that, but was expecting that eval(symbol("true")) == true, but the actual symbol("true") (as opposed to :true) does not mean anything. This seems akin to the fact that typeof(:1) == Int. My question is wh

[julia-users] Re: ERROR: no method chomp(Array{Uint8,1})??

2014-03-03 Thread Sam L
Hmm thanks for the response. I've also tried rebuilding julia from scratch in a freshly cloned repo and still no luck. On Monday, March 3, 2014 11:03:45 AM UTC-8, Ivar Nesje wrote: > > It looks like the problem is in > https://github.com/JuliaStats/DataFrames.jl/blob/master/src/RDA.jl#L258where

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

2014-03-03 Thread Carlos Becker
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,:], 1 ) # --> we get 3, where I would expect 6 (1+2+3) - can you try that on

[julia-users] Re: norm() strangeness

2014-03-03 Thread Patrick O'Leary
This is odd, as I get norm() working just fine with any of a row, column, or vector, and all getting exactly the same result of 3.741... (v0.2.0, on julia.forio.com, since it's quick for me to get to). Note that it will return the L2 norm by default, exactly as MATLAB does. Supplying a second a

[julia-users] norm() strangeness

2014-03-03 Thread Carlos Becker
Hello all, today I fought for an hour with a very simple piece of code, of the kind: - 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,:] ) # --> we get 3, where I would expect 6 (1+2+3)

[julia-users] Re: String to Float64 performance question

2014-03-03 Thread Simon Kornblith
I've only taken a brief look, but one possibility is garbage collection overhead. If you have a lot of strings living in memory, each collection may take much longer. There are plans to make this perform better, but you are probably best off avoiding large arrays of strings to begin with. If yo

Re: [julia-users] Command interpolation question

2014-03-03 Thread John Myles White
Would those names be more Julian as splitcmd and escapecmd? -- John On Mar 3, 2014, at 7:33 AM, Stefan Karpinski wrote: > The right way to do this is to construct the inner command object normally > and then use Base.shell_quote to interpolate that whole command into a larger > command and t

[julia-users] Re: Immutable objects and identity

2014-03-03 Thread andrew cooke
yes - i asked about that last week. the reason is that for small values it's more efficient to simply generate a new instance. for example, i am writing a package that does modular arithmetic. in theory the compiler could intern the values used (for small mduli). but since the representatio

[julia-users] Re: Immutable objects and identity

2014-03-03 Thread Pierre-Yves Gérardy
On Monday, March 3, 2014 9:45:46 PM UTC+1, andrew cooke wrote: > > because of the docs for is > http://julia.readthedocs.org/en/latest/stdlib/base/#Base.is says > "compares immutable objects (such as numbers) by contents at the bit level" > (and the same docs for object_id repeat the comments) >

[julia-users] String to Float64 performance question

2014-03-03 Thread Keith Campbell
Hi all, While working to bring down the timing of a text IO oriented job, I seem to be getting string-to-float conversion times that grow more than linearly with respect to the length of the string array I'm converting. I'd appreciate any help you could provide in speeding up the Julia version

[julia-users] Re: Feature Request - start and inc for enumerate

2014-03-03 Thread andrew cooke
Looking at the source, I think this would mean adding two fields to Enumerate. On Monday, 3 March 2014 17:24:30 UTC-3, andrew cooke wrote: > > Just a small pony request - enumerate could be extended to take an > optional start and increment. I went looking for this just now and was > surprise

[julia-users] Re: Immutable objects and identity

2014-03-03 Thread andrew cooke
they have t be, if the comment in the source is correct: # return an integer such that object_id(x)==object_id(y) if is(x,y) object_id(x::ANY) = ccall(:jl_object_id, Uint, (Any,), x) because of the docs for is http://julia.readthedocs.org/en/latest/stdlib/base/#Base.is says "compares immutable

[julia-users] Immutable objects and identity

2014-03-03 Thread Pierre-Yves Gérardy
Are immutable objects build with the same input (same object_id) guaranteed to also have the same objet_id? I've made a few tests, and it appears to hold, but I'd like to know if it is systematic. julia> immutable Gtr a::Int end julia> immutable Fre a::Gtr end julia> object_id(Fre(Gtr(3))) 0

[julia-users] Feature Request - start and inc for enumerate

2014-03-03 Thread andrew cooke
Just a small pony request - enumerate could be extended to take an optional start and increment. I went looking for this just now and was surprised to find it was missing. Suggested syntax: enumerate(collection, start, inc) = enumerate(collection, start) = enumerate(collection, start,

[julia-users] Re: ERROR: no method chomp(Array{Uint8,1})??

2014-03-03 Thread Ivar Nesje
It looks like the problem is in https://github.com/JuliaStats/DataFrames.jl/blob/master/src/RDA.jl#L258 where readline(io::IO) sometimes returns a String and sometims returns a Array{Uint8}. How would that happen? I can't find any documented return type for readline. Ivar kl. 19:29:17 UTC+1 m

[julia-users] Re: ERROR: scalarmin not defined

2014-03-03 Thread Ivar Nesje
A temporary workaround (untill you manage to upgrade your julia version) might be to copy fixed versions the relevant method definitions into your juliarc.jl file EG. import Base.minimum import Base.maximum import Base.scalarmax import Base.scalarmin maximum{T}(A::SparseMatrixCSC{T}) = isem

[julia-users] Re: ERROR: scalarmin not defined

2014-03-03 Thread Steven G. Johnson
I've filed an issue. https://github.com/JuliaLang/julia/issues/6036 Should be an easy bug to fix.

[julia-users] ERROR: no method chomp(Array{Uint8,1})??

2014-03-03 Thread Sam L
Hello everyone, I updated and rebuilt julia on Ubuntu and this is happening: julia> using RDatasets julia> dataset("datasets", "iris") ERROR: no method chomp(Array{Uint8,1}) in gzopen at /home/sam/.julia/v0.3/GZip/src/GZip.jl:253 in read_rda at /home/sam/.julia/v0.3/DataFrames/src/RDA.jl:272

[julia-users] ERROR: scalarmin not defined

2014-03-03 Thread Aditya Mahajan
Hi, I am using Julia Version 0.3.0-prerelease+1102 (2014-01-21 04:16 UTC) Commit c43c3d1 (41 days old master). When I call minimum on a sparse matrix, I get ERROR: scalarmin not defined For example julia> P = spzeros(Float64, 10, 10) 10x10 sparse matrix with 0 Float64 nonzeros: julia>

[julia-users] Re: Compilation error on (K)Ubuntu 13.10: libtool: unrecognized `-DHAVE_CONFIG_H'

2014-03-03 Thread David P. Sanders
El lunes, 3 de marzo de 2014 11:59:16 UTC-6, David P. Sanders escribió: > > Hi, > > I am trying to compile julia on a fresh install of (K)Ubuntu 13.10. > After installing libtool, m4 etc., I get the following error. > Any ideas? > Problem solved with a fresh checkout. I guess somehow libtool was

[julia-users] Re: How to specify command-line arguments in `reload`

2014-03-03 Thread David P. Sanders
El lunes, 3 de marzo de 2014 09:53:17 UTC-6, David P. Sanders escribió: > > > > El lunes, 3 de marzo de 2014 09:52:30 UTC-6, David P. Sanders escribió: >> >> Hi, >> >> How can I specify command line arguments for a `.jl` script in the >> `reload` command? >> [I am a fan of IJulia, but for tweak

[julia-users] Compilation error on (K)Ubuntu 13.10: libtool: unrecognized `-DHAVE_CONFIG_H'

2014-03-03 Thread David P. Sanders
Hi, I am trying to compile julia on a fresh install of (K)Ubuntu 13.10. After installing libtool, m4 etc., I get the following error. Any ideas? Thanks, David. CXXpcrecpp.lo libtool: compile: unrecognized option `-DHAVE_CONFIG_H' libtool: compile: Try `libtool --help' for more information. m

Re: [julia-users] Check for gui/console session (Mavericks)

2014-03-03 Thread Tim Holy
Gotcha. That is indeed an important problem to solve. Thanks for posting your solution. It would be nice to have one that is not Unix-specific. If you don't have an immediate solution in mind, would you mind filing an issue with Tk? BTW, Gtk doesn't seem to have this problem, and is probably th

Re: [julia-users] ANN: VML.jl

2014-03-03 Thread Kevin Squire
I suppose that would work. I was looking for something a little more lightweight, as in my example, where it's easy to share variables across the block boundary, and simply not qualify the exports from a particular module within that block. Something like the using statement in C++. It's probably

[julia-users] filter on tuple returns Filter object

2014-03-03 Thread berson
Hi, While using *filter* I noticed a different behavior between application of the function on Array and Tuple. While filtering on Array, the result is an Array, as stated in the documentation. But when filtering a tuple, the result is an iterable Filter object (in which case I guess I must u

[julia-users] Re: How to specify command-line arguments in `reload`

2014-03-03 Thread David P. Sanders
El lunes, 3 de marzo de 2014 09:52:30 UTC-6, David P. Sanders escribió: > > Hi, > > How can I specify command line arguments for a `.jl` script in the > `reload` command? > [I am a fan of IJulia, but for tweaking code it still seems to be more > efficient to use an editor (Sublime Text) -- is

[julia-users] How to specify command-line arguments in `reload`

2014-03-03 Thread David P. Sanders
Hi, How can I specify command line arguments for a `.jl` script in the `reload` command? [I am a fan of IJulia, but for tweaking code it still seems to be more efficient to use an editor (Sublime Text) -- is this other peoples' experience too?] On a related note, is there a description somewh

Re: [julia-users] Re: Command interpolation question

2014-03-03 Thread Stefan Karpinski
The right way to do this is to construct the inner command object normally and then use Base.shell_quote to interpolate that whole command into a larger command and then again to interpolate it into yet another level of command. Like this: julia> dir = "/some/place" "/some/place" julia> host = "l

Re: [julia-users] Check for gui/console session (Mavericks)

2014-03-03 Thread Roger Herikstad
I tried that, but my scenario is that I'm logged into a machine via ssh. It would still be an interactive session, but there is no console on which to show any graphics. Regards, Roger Herikstad > On 3 Mar, 2014, at 20:20, Tim Holy wrote: > > There's a function `isinteractive` already in bas

Re: [julia-users] ANN: VML.jl

2014-03-03 Thread Jameson Nash
using works on a module level, not a file level, so you could replace your macro with a module to do a bulk import On Fri, Feb 28, 2014 at 7:08 PM, Kevin Squire wrote: > Okay. I think that's a little different than what I was asking for, which > was a block structure within which I have access

Re: [julia-users] Winston scatter plot

2014-03-03 Thread Tim Holy
On Monday, March 03, 2014 02:31:37 AM Andreas Lobinger wrote: > Cairo based rendering gives you two things actually impossible in matlab: > Antialiasing and Transparency (it's not used in Winston right now, but Tim > somehow has an PR for Color.jl). All the changes are already in, though I think y

Re: [julia-users] Check for gui/console session (Mavericks)

2014-03-03 Thread Tim Holy
There's a function `isinteractive` already in base, does it solves the same problem? --Tim On Sunday, March 02, 2014 10:31:16 PM Roger Herikstad wrote: > Hi list, > While running some code in parallel on my Mavericks system using Julia > Version 0.3.0-prerelease+1741, I needed to prevent import

Re: [julia-users] Winston scatter plot

2014-03-03 Thread Tim Holy
Can you submit those Cairo changes as a pull request? If you do, `destroy` needs to be `CairoPatternDestroy`. Actually, I'm not sure why it's `CairoPatternDestroy` rather than `destroy`, and it looks like I wrote that! You could presumably change it to `destroy`. Running the code in the samples

Re: [julia-users] Extracting type parameter from supertype

2014-03-03 Thread andrew cooke
...but it's neater with your approach: abstract Z{N, I<:Integer} <: Number immutable ZRing{N, I<:Integer} <: Z{N,I} i::I end # other subtypes of Z modulus{N, I<:Integer}(::Type{Z{N, I}}) = N modulus{T<:Z}(::Type{T}) = modulus(super(T)) # jameson type chain modulus{T<:Z}(::T)

Re: [julia-users] Winston scatter plot

2014-03-03 Thread Andreas Lobinger
Hello, taking one or two things into consideration (i was just reminded of this, because my left screen is covered with a matlab scatter plot). Cairo based rendering gives you two things actually impossible in matlab: Antialiasing and Transparency (it's not used in Winston right now, but Tim s

[julia-users] Re: build and install Julia in Mac OSX 10.8

2014-03-03 Thread Abhishek Sen
This issue has been solved. Problem was the fortran compiler. I was using homebrew to install it and ended up having an older version. On Sunday, 2 March 2014 13:52:24 UTC-6, Abhishek Sen wrote: > > > > Hi all, > > I am having following issues while installing Julia in MacOSX. I am not > sure ho

Re: [julia-users] Extracting type parameter from supertype

2014-03-03 Thread andrew cooke
https://groups.google.com/d/msg/julia-users/NRBWq030YRE/OMIyXirmbgsJ thanks! (i actually figured out a way to get it from other, existing functions, but my solution is specific to my particular case). andrew On Monday, 3 March 2014 00:25:58 UTC-3, Jameson wrote: > > I posted this same question

Re: [julia-users] Re: Command interpolation question

2014-03-03 Thread Amit Murthy
Cool. Thanks. On Mon, Mar 3, 2014 at 2:35 PM, Ismael VC wrote: > julia> qcmd(`julia $exeflags`) > `'julia 1 2 3'` > > El lunes, 3 de marzo de 2014 02:58:34 UTC-6, Ismael VC escribió: > >> This is all I could come up with: >> >> julia> exeflags = `1 2 3`; >> >> julia> qcmd(c::Cmd) = (s::ASCIISt

Re: [julia-users] Re: Command interpolation question

2014-03-03 Thread Ismael VC
julia> qcmd(`julia $exeflags`) `'julia 1 2 3'` El lunes, 3 de marzo de 2014 02:58:34 UTC-6, Ismael VC escribió: > > This is all I could come up with: > > julia> exeflags = `1 2 3`; > > julia> qcmd(c::Cmd) = (s::ASCIIString = string(c)[2:end-1]; `$s`) # Quote > command. > qcmd (generic function wi

Re: [julia-users] Re: Command interpolation question

2014-03-03 Thread Ismael VC
This is all I could come up with: julia> exeflags = `1 2 3`; julia> qcmd(c::Cmd) = (s::ASCIIString = string(c)[2:end-1]; `$s`) # Quote command. qcmd (generic function with 1 method) julia> `"julia $(qcmd(exeflags))"` `'julia 1 2 3'` :-) El lunes, 3 de marzo de 2014 01:37:05 UTC-6, Amit Murt