[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,

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

2015-09-03 Thread Sean Marshallsay
[1:10;] is simply a consequence of matrix literal syntax (like [1:10; 11:20]) and gets translated into vcat(1:10). It might be a bit confusing but there's no point in making it a special case. On Thursday, 3 September 2015 17:28:27 UTC+1, Scott Jones wrote: > > To me, the use of ; within [ ]

[julia-users] Re: [ANN] SQLite.jl package update

2015-08-24 Thread Sean Marshallsay
Hi Chris, see this comment (https://github.com/quinnj/SQLite.jl/issues/60#issuecomment-69058463) for how to convert to a DataFrame. As for dblistTables(), SQLite.jl exports a tables(db::SQLiteDB) method, does this do what you want? On Monday, 24 August 2015 15:13:33 UTC+1, Christopher Fisher

[julia-users] Re: Speed Comparison Julia vs R vs C++ a question.

2015-08-23 Thread Sean Marshallsay
Firstly read the following thoroughly: http://docs.julialang.org/en/release-0.3/manual/performance-tips/ Secondly I'd try to avoid IO when benchmarking unless IO is a necessary part of the operation. My guess is you'll get a big speedup just by putting everything in a function, but there'll

[julia-users] Re: Julia and VIM - My working setup

2015-05-03 Thread Sean Marshallsay
Yep, that's a feature of julia-vim. On Sunday, 3 May 2015 13:11:52 UTC+1, Sisyphuss wrote: I'd like to know, if you type \alphatab in vim, will it be replaced by the greek character ? On Saturday, May 2, 2015 at 10:35:38 PM UTC+2, Krishna Subramanian wrote: After a long search, I have

Re: [julia-users] replace \$ with $ in string

2015-04-26 Thread Sean Marshallsay
Tamas, you can define a macro `macro raw_str(s) s end` which does what I think you want: julia macro raw_str(s) s end julia rawThis macro \t escapes \n any $special $(characters) for you. This macro \\t escapes \\n any \$special \$(characters) for you. On Sunday, 26 April 2015 13:44:05

Re: [julia-users] Re: General question about composite types

2015-03-03 Thread Sean Marshallsay
You've got me doubting myself now, I could well be wrong then. On Tuesday, 3 March 2015 21:14:37 UTC, Mauro wrote: If you're type has only concrete field then it will be densely packed regardless of wether it's immutable or not. I see, sorry for the misinformation! So how comes that in

Re: [julia-users] Re: General question about composite types

2015-03-03 Thread Sean Marshallsay
If you're type has only concrete field then it will be densely packed regardless of wether it's immutable or not. On Tuesday, 3 March 2015 17:15:20 UTC, Mauro wrote: Mauro, I do not quite understand what you're saying about densely packed arrays, could you explain a bit more? Consider:

[julia-users] Re: linking Julia with C to improve performances

2015-02-24 Thread Sean Marshallsay
As Milan says, you shouldn't need C unless your program requires something like LAPACK or BLAS. Before even thinking about C you should read http://docs.julialang.org/en/release-0.3/manual/performance-tips/ *very* carefully. If you're still struggling with performance issues feel free to ask

Re: [julia-users] Why does my Julia code run so slow?

2015-02-23 Thread Sean Marshallsay
Kuba, most of the relevant discussion was happening here: https://github.com/JuliaLang/julia/pull/8699 On Monday, 23 February 2015 07:27:55 UTC, Kuba Roth wrote: Sorry for a off topic question. @Viral. Is there any discussion going on about new GC you mentioned? Can you point it to me

[julia-users] Re: int({5,4}) works float({5.5,4.4}) doesn't

2015-02-21 Thread Sean Marshallsay
map(parsefloat, [5.5, 4.4]) is probably the best way unless your array is very large. int(), float() and curly brackets will all be depracated in v0.4. On Friday, 20 February 2015 22:51:05 UTC, Stepa Solntsev wrote: What seems to be the issue here?

[julia-users] Re: Why does my Julia code run so slow?

2015-02-19 Thread Sean Marshallsay
The two things that jump out at me straight away are keyword arguments and nullable fields. Changing those keyword arguments into optional positional arguments might give you a bit of a boost. The thing that will really make a difference though (I expect) is

[julia-users] Re: [ERROR: syntax: invalid assignment location] When trying to overload the `Base.==` method.

2015-02-19 Thread Sean Marshallsay
I'm not sure whether it's considered a bug or not but it's definitely known about. You can do it like this if you want: julia Base.(:(==)) == (generic function with 79 methods) On Thursday, 19 February 2015 15:36:58 UTC, Ismael VC wrote: Is this a parsing bug? I wanted to use `Base.==` to

[julia-users] Re: working with immutable arrays

2015-02-18 Thread Sean Marshallsay
Also see https://github.com/JuliaLang/julia/issues/5333 and https://github.com/JuliaLang/julia/pull/6122, which would probably make the implementation of that macro easier. On Wednesday, 18 February 2015 11:57:49 UTC, Ariel Keselman wrote: I'm working with arrays of immutables each containing

[julia-users] Re: Values from Dict assigned to variables (symbols?) named as keys?

2015-02-15 Thread Sean Marshallsay
I'm not too certain what you're asking here. Do you mean something like this: julia d = Dict() Dict{Any,Any} with 0 entries julia for i in [:var1, :var2, :var3] d[i] = string(i) end julia d Dict{Any,Any} with 3 entries: :var3 = var3 :var1 = var1 :var2 = var2 Or

Re: [julia-users] string literals split to multilines?

2015-01-06 Thread Sean Marshallsay
Rene, multiline literals should also work with just a single quote. julia d = aaa bbb ccc aaa\nbbb\nccc On Tuesday, 6 January 2015 10:19:37 UTC, René Donner wrote: hi, this should work: d = aaa bbb ccc Rene Am 06.01.2015 um 11:15 schrieb Andreas Lobinger

[julia-users] Re: Suggestion for tuple types explanation in manual

2015-01-05 Thread Sean Marshallsay
Hi Ivo You're more than welcome to contribute to the documentation yourself https://github.com/JuliaLang/julia/blob/master/CONTRIBUTING.md#improving-documentation to help clarify anything you found confusing. Regarding your second point, open() does not return a named type it returns a tuple

[julia-users] Re: Suggestion for tuple types explanation in manual

2015-01-05 Thread Sean Marshallsay
I suppose I should add that Julia doesn't really have a named tuple, the closest is an immutable constant type which is covered later in the manual. On Monday, 5 January 2015 10:35:28 UTC, Sean Marshallsay wrote: Hi Ivo You're more than welcome to contribute to the documentation yourself

Re: [julia-users] Dan Luu's critique of Julia: needs commented code, better testing, error handling, and bugs fixed.

2015-01-01 Thread Sean Marshallsay
Ismael, I think you're over-compliacating Julia's workflow slightly, in that first image you posted ( http://git-scm.com/book/en/v2/Git-Branching-Branching-Workflows

[julia-users] Spawning (or running) an external program with given environment variables.

2014-12-31 Thread Sean Marshallsay
In Bash I can do something like this $ echo $RANDOM_VAR $ RANDOM_VAR='heya' env RANDOM_VAR='heya' OTHER_ENV_VAR=whatever_it_was_before ... $ echo $RANDOM_VAR $ In Julia, however, julia run(`env`) OTHER_ENV_VAR=whatever_it_was_before ... julia run(`RANDOM_VAR='heya' env`) ERROR: could not

Re: [julia-users] Spawning (or running) an external program with given environment variables.

2014-12-31 Thread Sean Marshallsay
Awesome, thank you! On Wednesday, 31 December 2014 19:27:26 UTC, Isaiah wrote: julia c = setenv(`env`, [FOO=bar]) setenv(`env`,Union(ASCIIString,UTF8String)[FOO=bar]) julia run(c) FOO=bar On Wed, Dec 31, 2014 at 2:16 PM, Sean Marshallsay srm@gmail.com javascript: wrote: In Bash I

Re: [julia-users] Spawning (or running) an external program with given environment variables.

2014-12-31 Thread Sean Marshallsay
Karpinski wrote: Also: julia ENV[FOO] = BAR BAR julia run(`env` | `grep FOO`) FOO=BAR On Wed, Dec 31, 2014 at 3:35 PM, Sean Marshallsay srm@gmail.com javascript: wrote: Awesome, thank you! On Wednesday, 31 December 2014 19:27:26 UTC, Isaiah wrote: julia c = setenv(`env`, [FOO

Re: [julia-users] Dan Luu's critique of Julia: needs commented code, better testing, error handling, and bugs fixed.

2014-12-30 Thread Sean Marshallsay
Just my two cents here Jim but I've been using v0.4 (usually updated daily) extensively since the summer and have only run into one segfault (which sat very firmly in I'm doing something stupidly unsafe here territory). I would argue that if you run into a segfault Julia is definitely not

[julia-users] Re: [ANN] SQLite.jl package update

2014-12-30 Thread Sean Marshallsay
to create, update, and delete relational tables, as well as select statements to perform calculations, or subset specific datasets. -Jacob Quinn and Sean Marshallsay

[julia-users] Re: Using Julia with other (GC) languages

2014-12-30 Thread Sean Marshallsay
You can interact with GCed languages by writing C like Julia, i.e. working with c_malloc and c_free directly. It's not exactly the nicest way of working but doing that will avoid the garbage collector. On Friday, 26 December 2014 22:54:28 UTC, Páll Haraldsson wrote: I know you can call C from

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Sean Marshallsay
H seems to work fine for me. Does the program in this gist https://gist.github.com/Sean1708/92d9fddb88c7d9a513ea work for you? On Wednesday, 10 December 2014 13:30:38 UTC, Daniel Høegh wrote: I have a dictionary that like: Dict{ASCIIString,Array{Array{Float64,2},1}} with 83 entries:

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Sean Marshallsay
Sorry, it's just too natural nowadays :P On Wednesday, 10 December 2014 16:23:02 UTC, Daniel Høegh wrote: Yes it works when I remove the 0.4 syntax:) But when you put using PyPlot in the top it does not work:( It's the convertalypse. at https://github.com/JuliaLang/julia/issues/8631

[julia-users] Re: serialize a dictionary gives an error

2014-12-10 Thread Sean Marshallsay
Yes it works when I remove the 0.4 syntax:) Sorry it's just too natural for me nowadays :P On Wednesday, 10 December 2014 16:23:02 UTC, Daniel Høegh wrote: Yes it works when I remove the 0.4 syntax:) But when you put using PyPlot in the top it does not work:( It's the convertalypse.

Re: [julia-users] Re: How fast reduce the Vector range of values? (Recode for smaler numbers)

2014-12-10 Thread Sean Marshallsay
Vector{T} is just a typealias for Array{T, 1} so it's still an array but limited to one dimension. Your problem can be solved with convert(Array{Int, 2}, Jcodes) or equivalently convert(Matrix{Int}, Jcodes) On Wednesday, 10 December 2014 11:09:55 UTC, paul analyst wrote: And how to do it

Re: [julia-users] Behaviour of expanduser is inconsistent between platforms.

2014-10-11 Thread Sean Marshallsay
handle it? On Fri, Oct 10, 2014 at 3:22 PM, Sean Marshallsay srm@gmail.com javascript: wrote: Hmmm... looking at how bash handles this it doesn't seem too difficult, I might give it a go over the weekend. I have no idea how to handle it on Windows though. On Thursday, 9 October 2014 18

Re: [julia-users] Behaviour of expanduser is inconsistent between platforms.

2014-10-11 Thread Sean Marshallsay
: That seems like a reasonable strategy. I guess the question for Windows is what the equivalents to the HOME environment variable and the password database are. On Sat, Oct 11, 2014 at 5:54 AM, Sean Marshallsay srm@gmail.com javascript: wrote: I've only had a quick look but basically

Re: [julia-users] Behaviour of expanduser is inconsistent between platforms.

2014-10-11 Thread Sean Marshallsay
, 2014 at 4:59 PM, Sean Marshallsay srm@gmail.com javascript: wrote: The variable is %HOMEPATH% but I don't know what the equivalent to the password database is. I think for now it might be best just expanding to %HOMEPATH% and someone who is more experienced with Windows can weigh

Re: [julia-users] Behaviour of expanduser is inconsistent between platforms.

2014-10-10 Thread Sean Marshallsay
seems to be a hack – a more correct implementation would be a great contribution. It should also be possible to map arbitrary user names to user IDs and user IDs to user metadata. On Thu, Oct 9, 2014 at 1:00 PM, Sean Marshallsay srm@gmail.com javascript: wrote: I noticed the other

[julia-users] Behaviour of expanduser is inconsistent between platforms.

2014-10-09 Thread Sean Marshallsay
I noticed the other day that calling expanduser on an empty string throws a BoundsError when using a UNIX platform. Whether this is a bug or a feature will probably depend entirely on who you ask. More importantly though, in my eyes, doing the same thing on Windows returns an empty string