Re: [julia-users] Tagging observations from a data frame based on a string variable

2014-02-28 Thread Henrik L Nordmark
Thanks Johan, that was indeed the problem and my code runs now. :-)

[julia-users] Re: Difference between f1(T1::Type) and f2{T2}(::Type{T2})

2014-02-28 Thread Avik Sengupta
I haven't dug that deep into the internals, but I tend to use the `f1(T1::Type)` where T1 is completely unconstrained, and can be any type in the system. On the other hand, I use the second version when I want to constrain the types that can be possible arguments: `f2{T2:Number}(::Type{T2})`

Re: [julia-users] Parsing large integers causes overflow rather than error

2014-02-28 Thread Pierre-Yves Gérardy
Short of re-implementing parseint, is there a way to work around this? I was thinking of something like this (for Int64 only) try num = parseint(Int64, str) if num != parse(str) throw(FOO) end num catch ... end But I don't know if it would work properly on 32 bits CPUs. --

[julia-users] Re: Running a Julia script line by line

2014-02-28 Thread Oliver Lylloff
Hi Henrik, Have you checked out IJulia? https://github.com/JuliaLang/IJulia.jl Best, Oliver Den fredag den 28. februar 2014 11.28.23 UTC+1 skrev Henrik L Nordmark: Is there a way of running a Julia script line by line? When I use R or R Studio, I am able to write an R script and run

[julia-users] Re: Difference between f1(T1::Type) and f2{T2}(::Type{T2})

2014-02-28 Thread andrew cooke
I would love to hear an authoritative answer to this. My belief is, that for the examples you give, the semantics should be equivalent, but that in general f2{T2}(...) is more powerful because it introduces a type variable (which behaves as any other variable in the function body) that can be

Re: [julia-users] Re: module scoping and package options

2014-02-28 Thread Simon Byrne
Ah, great. That solves my problem. simon On Thursday, 27 February 2014 22:24:41 UTC, Kevin Squire wrote: For reference, there's an open issue about this: https://github.com/JuliaLang/julia/issues/3894 Regarding your example, you can use (or import) Main.OPTIONS to access the value inside

Re: [julia-users] Re: Default instance of intrinsic type

2014-02-28 Thread Fil Mackay
On Fri, Feb 28, 2014 at 1:47 PM, Stefan Karpinski ste...@karpinski.orgwrote: Why is the empty string the zero of the String type? The empty string is the unit of the string monoid, so if anything, one(s::String) should give the empty string. Must zero(::String) != one(::String) ? :) Not

Re: [julia-users] Re: Default instance of intrinsic type

2014-02-28 Thread Toivo Henningsson
Algebraically, the zero string should be such that concatenating (multiplying) it with any string should yield the zero string. There is no such string. So we don't want to mess with the zero function for this purpose (compared to that, even a default function would be better). Why do you want

[julia-users] Re: Difference between f1(T1::Type) and f2{T2}(::Type{T2})

2014-02-28 Thread andrew cooke
On Friday, 28 February 2014 10:09:20 UTC-3, Toivo Henningsson wrote: (Related, why is :: used in parameter declarations, rather than :? I can see that it doesn't really matter since concrete types are leaves in the graph, and so constraints on abstract types must be : even if it says ::,

Re: [julia-users] Parsing large integers causes overflow rather than error

2014-02-28 Thread Pierre-Yves Gérardy
That approach works, at least for 64 bits CPUs. In v0.2, parse(str) will choke on number overflow and throw a ParseError. It would be nice if someone using v0.2.1 and a 32bit machine (old OS X?) could tell me what happens when you run this: parse(9223372036854775807)

[julia-users] Unexpected type behaviour in arithmetic operations

2014-02-28 Thread David P. Sanders
I am trying to cut down on memory usage by using Int32 instead of the default (on my machine) Int64 in some large data structures. This is causing me some headaches since Int64s seem to be endemic. E.g.: julia x = int32(1) 1 julia y = int32(2) 2 julia z = x + y 3 julia typeof(ans) Int64 This

[julia-users] Re: Unexpected type behaviour in arithmetic operations

2014-02-28 Thread Tobias Knopp
There was quite some discussion on this topic in https://groups.google.com/forum/?fromgroups=#!searchin/julia-users/Int32/julia-users/Rte_I6htLRc/VJG5DWVcZbQJ I had the feeling that we almost convinced Stefan :-) The good thing is that Array{Int32} operations do not promote to Array{Int64}. But

Re: [julia-users] Re: Iteration over a Set where elements may be deleted in the process -- bug?

2014-02-28 Thread David P. Sanders
El jueves, 27 de febrero de 2014 18:45:35 UTC-6, Kevin Squire escribió: So, no one has really explained why this is happening. Sets are built on top of hash tables. The hash table itself is just an array, many entries of which are not being used. As with all iteration in Julia, for

[julia-users] Re: Unexpected type behaviour in arithmetic operations

2014-02-28 Thread andrew cooke
the current behaviour is explained at http://julia.readthedocs.org/en/latest/manual/conversion-and-promotion/ defining Base.promote_rule(::Type{Int32}, ::Type{Int32}) = Int32 doesn't help either, and i'm not sure why. andrew On Friday, 28 February 2014 10:46:16 UTC-3, Tobias Knopp wrote:

[julia-users] Re: Unexpected type behaviour in arithmetic operations

2014-02-28 Thread David P. Sanders
El viernes, 28 de febrero de 2014 07:49:09 UTC-6, andrew cooke escribió: the current behaviour is explained at http://julia.readthedocs.org/en/latest/manual/conversion-and-promotion/ But I don't find it evident from that document that Int32+Int32 gives Int64 on a 64-bit machine!

[julia-users] Re: Unexpected type behaviour in arithmetic operations

2014-02-28 Thread andrew cooke
On Friday, 28 February 2014 10:58:24 UTC-3, David P. Sanders wrote: El viernes, 28 de febrero de 2014 07:49:09 UTC-6, andrew cooke escribió: the current behaviour is explained at

[julia-users] Interesting behaviour in IntSet

2014-02-28 Thread David P. Sanders
I am investigating possible data structures for an application. Here is an interesting behaviour in IntSet, which is no doubt to do with the implementation. Maybe it should just throw an exception if someone tries to add a really large integer like this! julia s = IntSet() IntSet() julia

[julia-users] Re: Interesting behaviour in IntSet

2014-02-28 Thread Ivar Nesje
The documentation states very clear that IntSethttp://docs.julialang.org/en/latest/stdlib/base/#Base.IntSet should only be used for dense collections, and that Sethttp://docs.julialang.org/en/latest/stdlib/base/#Base.Set, should be used for sparse collections. Construct a sorted set of the

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

2014-02-28 Thread Dahua Lin
This is very nice. Now that we have several back-ends for vectorized computation, VML, Yeppp, Julia's builtin functions, as well as the @simd-ized versions, I am considering whether there is a way to switch back-end without affecting the client codes. - Dahua On Thursday, February 27, 2014

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

2014-02-28 Thread John Myles White
If you get them all to export the same API, you could, in principle, just switch `using VML` to `using Yeppp`. My question: are we finally conceding that add! and co. is probably worth having? — John On Feb 28, 2014, at 7:10 AM, Dahua Lin linda...@gmail.com wrote: This is very nice. Now

[julia-users] Gadfly: multiple y axes in one plot

2014-02-28 Thread Sven Mesecke
I'd like to replicate the behavior of matlab's `plotyy` in Gadfly, i.e., I'm trying to plot data with very different `y` axes but the same `x` axes on the same plot, any idea of how to get this done? `layer` always seems to use the same base `y` axis. Thanks for any pointers, Sven

[julia-users] Re: Interesting behaviour in IntSet

2014-02-28 Thread David P. Sanders
El viernes, 28 de febrero de 2014 08:41:37 UTC-6, Ivar Nesje escribió: The documentation states very clear that IntSethttp://docs.julialang.org/en/latest/stdlib/base/#Base.IntSet should only be used for dense collections, and that

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

2014-02-28 Thread Simon Kornblith
For the arithmetic functions, the mutating versions are probably not worth it. For add!, subtract!, and multiply! the VML implementations on Float64 are not any faster, and with the loop vectorizer I am hoping we can erase the remainder of the gap for Float32. In any case these operations are

Re: [julia-users] Gadfly: multiple y axes in one plot

2014-02-28 Thread Harlan Harris
Don't do it. It's not good data visualization practice, and is explicitly and intentionally not supported in most grammar of graphics implementations. See, for one recent post I have handy: http://junkcharts.typepad.com/junk_charts/2014/02/a-message-worth-repeating.html Two good alternatives are

[julia-users] ijulia problem

2014-02-28 Thread Jon Norberg
Hi, anyone know how to help me with getting ijulia to run again (using mavericks osx). I have clean install latest julia. I added a soft link so captiveportal-49-129:~ jon$ which julia /usr/local/bin/julia and typing julia starts julia as expected from anywhere Starting python wight he julia

[julia-users] New `dev` branch in Datetime.jl; Dates module

2014-02-28 Thread Jacob Quinn
While the merging of DateTime functionality into Base is simmering, I've finally got around to making the rewrite more broadly available. You can see the latest DateTime functionality by running: Pkg.add(Datetime) Pkg.checkout(Datetime,dev) include(Pkg.dir() * /Datetime/src/Dates.jl) using

[julia-users] Re: Interesting behaviour in IntSet

2014-02-28 Thread Ivar Nesje
My point was to illustrate that the limit will be arbitrary chosen. It is impossible to set a limit for how big numbers that should be allowed to be stored in a IntSet. It depends on the application, and can only be determined by the programmer. Sorry for not stating that clear. You seem to

Re: [julia-users] Parsing large integers causes overflow rather than error

2014-02-28 Thread Stefan Karpinski
We didn't backport any of the number parsing changes to 0.2.1 since those are features. On Fri, Feb 28, 2014 at 8:27 AM, Pierre-Yves Gérardy pyg...@gmail.comwrote: That approach works, at least for 64 bits CPUs. In v0.2, parse(str) will choke on number overflow and throw a ParseError. It

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

2014-02-28 Thread Dahua Lin
While VML is generally much faster for big arrays, the overhead is considerable or even dominant for small ones. I think the ideal way is to let people to explicit articulate their intention to use these instead of changing the behavior silently. For example, I may want to be able to use

Re: [julia-users] Re: Difference between f1(T1::Type) and f2{T2}(::Type{T2})

2014-02-28 Thread Jeff Bezanson
::Type and ::Type{T} will always have the same method applicability. The main use of the second form, as Avik says, is to constrain T. Things get more interesting when you start nesting types. For example: f(::Type{Array}) = 0 f{T}(::Type{Array{T}}) = 1 The rule is that the system must be able

Re: [julia-users] Re: Interesting behaviour in IntSet

2014-02-28 Thread Jeff Bezanson
sizeof() is a bit tricky. Currently IntSet is considered not to have a canonical binary representation, so sizeof() defaults to giving the size of the struct. This is a bit sketchy, but it tends to be convenient. On Fri, Feb 28, 2014 at 11:49 AM, Ivar Nesje iva...@gmail.com wrote: My point was

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

2014-02-28 Thread Simon Kornblith
I have benchmarked with short vectors, and for allocating functions, the overhead of allocation dominates everything else, so it doesn't really matter what implementation is used. I haven't tested mutating functions, but we don't presently have those in Base. I think it would be fine to tell

[julia-users] Re: Running a Julia script line by line

2014-02-28 Thread Marek Gagolewski
It's a pity that Sublime is proprietary and not open source software. Dear Henrik, I'm also a power Rstudio user who couldn't got used to (at the begining) to IJulia. A few months ago I said to myself I'll wait for a nice RStudio-like IDE and then I'll start learning it. Luckily after a few

[julia-users] Re: Juila vs Mathematica (Wolfram language): high-level features

2014-02-28 Thread Knud Sørensen
Here is a video demo of wolfram. http://blog.wolfram.com/2014/02/24/starting-to-demo-the-wolfram-language/

Re: [julia-users] Bug in Julia 0.3.0

2014-02-28 Thread Kevin Squire
Just to be blatantly obvious about the double quotes: julia print() # no spaces julia print( ) # one space julia print( ) # three spaces Cheers! Kevin On Fri, Feb 28, 2014 at 10:01 AM, John Myles White johnmyleswh...@gmail.com wrote: This isn't a bug. I think you want

[julia-users] Re: Bug in Julia 0.3.0

2014-02-28 Thread Jiakui Wang
Why this bug bother me is that, if I use print(' ') inside a function, it won't point the error to the line where print(' ') locates but to the line where the function starts. It's confusing for debug! On Friday, February 28, 2014 12:00:52 PM UTC-6, Jiakui Wang wrote:

Re: [julia-users] Re: Bug in Julia 0.3.0

2014-02-28 Thread Jiakui Wang
I am on Ubuntu 13.04. I played with this bug a little bit. If I use print(' ') inside a for loop, the error will point to the line where for loop starts. On Friday, February 28, 2014 12:48:04 PM UTC-6, Jacob Quinn wrote: That's a lot of exclamation points... Are you on windows?

[julia-users] How do I optimize a multi-argument function with Optim.jl?

2014-02-28 Thread Paulo Castro
Hi! I'm doing the Machine Learning course exercises with Julia. I know how to use Optim.jl when the cost function only have one argument, for example: *f(t) = someFunctionOfTheta(t)* *optimize(f, initial_theta)* But one of the exercises is to run Octave's fminuc this way: *options =

Re: [julia-users] Parsing large integers causes overflow rather than error

2014-02-28 Thread Pierre-Yves Gérardy
Yes, I tried it. My specific question is about the Base.parser() behavior regarding integer literals: v0.3-pre/x64 produces an Int64 when it fits, and a :(@int128_str ...) Exprwhen confronted with numbers that would overflow an Int64, but fit an Int128. v0.2/x64 chokes on numbers that

[julia-users] Re: How do I optimize a multi-argument function with Optim.jl?

2014-02-28 Thread Tony Kelman
There's probably a fancier way of Currying or partial application, but the direct translation of making an anonymous function of just the first input would be: t - costFunction(t, X, y) On Friday, February 28, 2014 11:18:54 AM UTC-8, Paulo Castro wrote: Hi! I'm doing the Machine Learning

[julia-users] Re: ijulia problem

2014-02-28 Thread Junfeng Li
It seems the ipython kernel manager could not find/start ijulia kernel. Have you reinstall IJulia? Try `Pkg.add(IJulia)` in Julia REPL On Friday, February 28, 2014 11:20:54 AM UTC-5, Jon Norberg wrote: Hi, anyone know how to help me with getting ijulia to run again (using mavericks osx). I

[julia-users] Re: Iteration over a Set where elements may be deleted in the process -- bug?

2014-02-28 Thread Pierre-Yves Gérardy
To realize what you want to do, you can add the elements to be removed to another set. On each iteration, verify that the current element isn't already in the set of elements to be removed, and after the loop, clean the first set using the elements of the second one. —Pierre-Yves On

[julia-users] Re: Iteration over a Set where elements may be deleted in the process -- bug?

2014-02-28 Thread David P. Sanders
El viernes, 28 de febrero de 2014 16:41:20 UTC-6, Pierre-Yves Gérardy escribió: To realize what you want to do, you can add the elements to be removed to another set. On each iteration, verify that the current element isn't already in the set of elements to be removed, and after the

Re: [julia-users] Parsing large integers causes overflow rather than error

2014-02-28 Thread Pierre-Yves Gérardy
Thanks :-) On Saturday, March 1, 2014 12:17:36 AM UTC+1, Stefan Karpinski wrote: On Fri, Feb 28, 2014 at 2:25 PM, Pierre-Yves Gérardy pyg...@gmail.comjavascript: wrote: Yes, I tried it. My specific question is about the Base.parser()behavior regarding integer literals: v0.3-pre/x64

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

2014-02-28 Thread Kevin Squire
Thanks Jameson. But looking in tests, I can't seem to find any examples which constrain using of a module to a let block. Am I missing something? Cheers, Kevin On Fri, Feb 28, 2014 at 3:21 PM, Jameson Nash vtjn...@gmail.com wrote: Let blocks already do that. See the Julia tests for

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

2014-02-28 Thread Kevin Squire
Okay. I think that's a little different than what I was asking for, which was a block structure within which I have access to a module's exports, but external to which I don't. using ModuleX and only works on a file level, currently. Kevin On Fri, Feb 28, 2014 at 4:02 PM, Jameson Nash

[julia-users] hcat with empty []

2014-02-28 Thread Ethan Anderes
Hi Folks: Newbie here... I often need to write code that iteratively reads files which are saved from a long MCMC chain. Coming from Matlab I always try the following a = [] b = [] k = 1 while isfile(data$k.csv) data = readcsv(data$k.csv) a = [a data[:,1]] b

Re: [julia-users] Re: Interesting behaviour in IntSet

2014-02-28 Thread Eric Davies
I'm considering trying out a alternative IntSet implementation using a space-optimized van Emde Boas tree. In that case, the space would scale linearly as you add elements, and could give reasonable out-of-memory errors should that situation arise. The limits in that case would be the limits

[julia-users] DataFrames, select column with variable

2014-02-28 Thread Jason Solack
Hello all, I'm trying to select a column from a DataFrame using a variable... something like this df = DataFrame(A=[1:10], B=[11:20]) when i do this: df [ : 2] i select column B if i do this: t = 2 df [ : t] i get an error Error Key not found :t what am i missing?? Thank you in

Re: [julia-users] DataFrames, select column with variable

2014-02-28 Thread John Myles White
Hi Jason, I’m surprised that df[: 2] works: that seems almost like a bug. To get column B, either of the following should work on a new copy of DataFrames: df[2] df[:B] If you have a slightly older copy of DataFrames (like you’d get for Julia 0.2), this works df[2] df[“B”] Hope that helps.

[julia-users] Re: DataFrames, select column with variable

2014-02-28 Thread Jason Solack
that does the trick, thank you very much! On Friday, February 28, 2014 9:36:40 PM UTC-5, Jason Solack wrote: Hello all, I'm trying to select a column from a DataFrame using a variable... something like this df = DataFrame(A=[1:10], B=[11:20]) when i do this: df [ : 2] i select column

Re: [julia-users] Re: Default instance of intrinsic type

2014-02-28 Thread Fil Mackay
On Saturday, March 1, 2014 12:00:29 AM UTC+11, Toivo Henningsson wrote: Algebraically, the zero string should be such that concatenating (multiplying) it with any string should yield the zero string. There is no such string. So we don't want to mess with the zero function for this purpose

[julia-users] Gitter.im

2014-02-28 Thread Waldir Pimenta
Have you guys seen this? https://gitter.im It allows setting up a persistent chat room for a git repo. Could be an interesting alternative for IRC (logging, github-flavored markdown, nicer design...) It seems like a chat room for JuliaLang/julia needs to be set up by someone with commit