Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Daniel Carrera
On 22 September 2015 at 20:40, Stefan Karpinski wrote: > I think that before any further discussion takes place of how easy or hard > implementing a high-performance printf is, anyone who'd like to comment > should spend some time perusing GNU libc's vfprintf implementation

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Daniel Carrera
On 22 September 2015 at 17:42, Stefan Karpinski wrote: > Responding with a solicitation for help in an open source project is not a > rhetorical ploy – it's a legitimate request for contribution. > It can be either. It depends on context and intent. I have seen that

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Steven G. Johnson
On Monday, September 21, 2015 at 2:03:35 PM UTC-4, Tom Breloff wrote: > > This seemed to match: > Note that you don't need meshgrid for this example, and it is more efficient to avoid it. You can use broadcasting, and pcolormesh will do the right thing if you pass it a row vector and column

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread lawrence dworsky
Hi Tom What I like about it is that you can just use print *, dumbly and it always provides useful, albeit not beautiful, results. When I'm writing a program, I use print statements very liberally to observe what's going on - I find this more convenient than an in-line debugger. As the last line

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Stefan Karpinski
Possible, but I don't relish the thought of forever explaining to people that they need to use printf with or without the @ depending on if they want it to be fast or flexible. If you really don't care about speed, you can just do this right now: printf(fmt::AbstractString, args...) = @eval

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Jan Strube
The julia example doesn't need meshgrid at all. On Tuesday, September 22, 2015 at 2:37:55 AM UTC-7, Christoph Ortner wrote: > > another example why meshgrid should be in Base. :) > Christoph >

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Stefan Karpinski
I think that before any further discussion takes place of how easy or hard implementing a high-performance printf is, anyone who'd like to comment should spend some time perusing GNU libc's vfprintf implementation

[julia-users] Re: What's your favourite editor?

2015-09-22 Thread Andrei Zh
And here's all the code from my init.el related to development in Julia ;; auto-complete (ac- config-default) ;; ido

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tom Breloff
Thanks Larry, that's helpful. Just for discussions sake, here's a quick macro that calls my proposed `fmt` method under the hood, and does something similar to what you showed. What do you think about this style (and what would you do differently)? using Formatting macro fmt(args...) expr

[julia-users] Tripping myself up on macro hygiene (again...)

2015-09-22 Thread Tomas Lycken
I’m having real difficulties grok-ing macro hygiene. I’ve read the manual entry, but didn’t get much wiser, so I’m hoping the solution to my current problem will be another data point I can use to understand (and I need this to work :P). I have a utility function that builds an expression

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tom Breloff
Larry: can you provide details on exactly what you like about Fortran's print statement? Did it provide good defaults? Was it easy to customize? On Tue, Sep 22, 2015 at 12:55 PM, LarryD wrote: > Something I miss from Fortran is the very convenient default "print *, >

[julia-users] Re: Juno stopped working - error message

2015-09-22 Thread Haoran Jiang
Hi Greg, I am new to Julia and Juno, I just installed this software today and I have the same error message as you do, can you tell me what did you do to make it right? this is my Pkg.status. I never had it worked before(since it is my first day install it) so i dont know what file to change

Re: [julia-users] Re: Juno stopped working - error message

2015-09-22 Thread Spencer Russell
Hi Haoran, Try pinning the Compat package by running `Pkg.pin("Compat", v"0.7.0")` If you're running Julia 0.3.11 that should be the newest version that will install, so I'm not sure how you ended up with Compat 0.7.3 (which is currently tagged to be 0.4 and newer). That's a pretty recent change

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Daniel Carrera
On 22 September 2015 at 16:38, Tomas Lycken wrote: > If anything I wrote came off as a "thinly veiled 'fuck you'", I am > sincerely sorry; that's nowhere near what I meant to say. > Thank you. I guess I misinterpreted your comments and reacted more harshly than I should.

[julia-users] Re: @sprintf with a format string

2015-09-22 Thread LarryD
Something I miss from Fortran is the very convenient default "print *, . " It handled almost 100% of my needs while working on a program and was easily replaced by real formatting when the time came. Is there any chance that Julia could get something like this? Thanks On Monday,

[julia-users] Re: FFTW.REDFT00 and FFT.RODFT00 are ~10x slower than other routines?

2015-09-22 Thread Steven G. Johnson
On Tuesday, September 22, 2015 at 6:51:50 AM UTC-4, Sheehan Olver wrote: > > I get the following timings with the various FFTW routines, where I ran > each line multiple times to make sure it was accurate. Why are REDFT00 and > RODFT00 almost 10x slower? > This is because a REDFT00 (DCT-I)

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Stefan Karpinski
It also allocates 1MB just to print three numbers. Yikes. On Tue, Sep 22, 2015 at 4:34 PM, Daniel Carrera wrote: > Hmm... I know it's horrible, but I just added that to my juliarc file :-) > > This function is 100x slower than the macro, at about 100 lines in 0.5s. I > know

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Bob Nnamtrop
But Michael Hatherly's showed code above that uses a generated function to solve this. It seems to work pretty well in the short while I tried it in the REPL. Granted I didn't time it or do anything complicated. It works on Stefan's example above with no problem. The only difference is that one

[julia-users] Re: When does colon indexing get evaluated / converted?

2015-09-22 Thread 'Greg Plowman' via julia-users
Matt, Thankyou so much for your great reply. And yes it does make sense now after such a helpful and well-targeted explanation. You explained "colon-lowering" in a "explanation-lowered" way that a non-expert can understand. This is refreshingly thoughtful and helpful. Thanks again. -- Greg On

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tim Holy
On Tuesday, September 22, 2015 05:21:10 PM Luke Stagner wrote: > Would it be possible to rewrite @printf as a generated function instead of > a macro. That way the calling syntax would be more familiar. That's a good suggestion. At the risk of encouraging emacs users to "fix" the syntax with

[julia-users] Re: suppress deprecation warnings

2015-09-22 Thread Tony Kelman
Sorry about that, my bad for not testing before replying. It appears the recently added binding deprecations don't yet respect the --depwarn flag but that should be fixed soon with https://github.com/JuliaLang/julia/pull/13269 which should get backported to RC3. On Thursday, September 17,

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Eric Forgy
If this were Facebook, I would "Like" this :) On Wednesday, September 23, 2015 at 9:34:27 AM UTC+8, Tim Holy wrote: > > At the risk of encouraging emacs users to "fix" the syntax with ctrl-T, > I'd > propose the following (apparently complete?) solution: > > > immutable FormatString{S} end >

Re: [julia-users] Deprecation of require

2015-09-22 Thread Steven G. Johnson
On Friday, July 31, 2015 at 7:30:44 AM UTC-4, Tim Holy wrote: > > If MyModule.jl is on your LOAD_PATH, > > @everywhere import MyModule Actually, the right thing is just: import MyModule That will import it on all workers (@everywhere is redundant), and is actually better than

[julia-users] [ANN] Julia v0.4.0-rc2 released

2015-09-22 Thread Elliot Saba
The second release candidate of the 0.4 series is available for download from the usual place . Please test extensively, report issues to the issue tracker for base Julia problems, and report issues with packages to

[julia-users] .cache directory in .julia

2015-09-22 Thread David Anthoff
Just curios, what is the .cache directory in the .julia directory? For julia 0.3 it seems that directory was a child of the v0.3 directory, for julia 0.4 it seems it moved one level up to be a sibling of the v0.4 folder. Is there a reason for that? Thanks, David -- David Anthoff

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tom Breloff
Sorry I wasn't expecting you to run it... just comment. You'll have to do: Pkg.rm("Formatting") Pkg.clone("https://github.com/tbreloff/Formatting.jl.git;) Pkg.checkout("Formatting", "tom-fmt") Let me know if that works. On Tue, Sep 22, 2015 at 5:52 PM, lawrence dworsky

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Daniel Carrera
Hmm... I know it's horrible, but I just added that to my juliarc file :-) This function is 100x slower than the macro, at about 100 lines in 0.5s. I know that's horribly slow for traditional printf() but it's fast enough for terminal output. On 22 September 2015 at 22:06, Stefan Karpinski

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread lawrence dworsky
I'm afraid my beginner status with Julia is showing: I ran Pkg.add("Formatting"), and then using Formatting came back with a whole bunch of warnings, most about Union(args...) being depricated, use Union(args) instead. When all is said and done, fmt_default! gives me a

Re: [julia-users] Re: Juno stopped working - error message

2015-09-22 Thread Haoran Jiang
Hi Spencer: Thanks for the reply! However, I just tried the method you told me but it still doesn't work. I also tried to pinned back everything just like how Serge was doing, but it still doesn't work, here is my status now. 在 2015年9月22日星期二 UTC-7上午11:13:50,Spencer Russell写道: > > Hi Haoran, >

Re: [julia-users] Re: Juno stopped working - error message

2015-09-22 Thread Haoran Jiang
here is the screen copy of my error message,what do you suggest i to do? 在 2015年9月22日星期二 UTC-7下午8:50:00,Spencer Russell写道: > > Can you cut/paste your session with the error into a gist? That might help > track down more specifically what’s causing the issue. > > -s > > On Sep 22, 2015, at

Re: [julia-users] Re: Juno stopped working - error message

2015-09-22 Thread Spencer Russell
Can you cut/paste your session with the error into a gist? That might help track down more specifically what’s causing the issue. -s > On Sep 22, 2015, at 11:46 PM, Haoran Jiang wrote: > > Hi Spencer: > Thanks for the reply! However, I just tried the method you told

Re: [julia-users] Juno stopped working - error message

2015-09-22 Thread Spencer Russell
Is it possible you have multiple versions of Julia installed, or maybe leftover packages in your .julia folder from a previous installation? It might be worth trying to delete (or move out of the way) your .julia directory and re-install the packages. Also if possible can you include the

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread elextr
Tim, How well does it work if, instead of pi, the thing being printed is some abstract type so its concrete type is only known at runtime? Cheers Lex On Wednesday, September 23, 2015 at 11:34:27 AM UTC+10, Tim Holy wrote: > > On Tuesday, September 22, 2015 05:21:10 PM Luke Stagner wrote: > >

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread elextr
Stefan, don't beat yourself up so much :) Sometimes the choice of fast or flexible just has to be made. Maybe call them @fast_printf() and printf() (after appropriate deprecation time of course). So long as the flexible printf is "adequate" performance (as Rolls Royce used to say). Then if

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Luke Stagner
Would it be possible to rewrite @printf as a generated function instead of a macro. That way the calling syntax would be more familiar. On Tuesday, September 22, 2015 at 1:07:23 PM UTC-7, Stefan Karpinski wrote: > > Possible, but I don't relish the thought of forever explaining to people > that

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Daniel Carrera
Really? What does it *DO* that needs 1MB? I admit I don't really know how it works. I have tried to learn macros, but I still think they are basically black magic. On 22 September 2015 at 22:37, Stefan Karpinski wrote: > It also allocates 1MB just to print three numbers.

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tom Breloff
I think not Luke. Generated functions work on the types of the arguments. If someone wants to format based on an input string, then you either need a hardcoded value which can go into a macro, or a dynamic value that would go in a normal function. If all you want to do is print out some

[julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tomas Lycken
By the way, you might also note that the Formatting.jl package is written and maintained by people who are all active contributors to the main language repo, and very active members of the community. Even if it's "external" in terms of how you install it, it's by no means external "in spirit".

[julia-users] Re: Tripping myself up on macro hygiene (again...)

2015-09-22 Thread Tomas Lycken
I ended up building the Expr explicitly, but I’d still like to know if this is the idiomatic way or if there’s another that’s considered “better”: foo(N) = Expr(:call, :gradient, :A, map(k -> symbol("xs_", k), 1:N)...) // T On Tuesday, September 22, 2015 at 9:11:05 AM UTC+2, Tomas Lycken

[julia-users] Re: @sprintf with a format string

2015-09-22 Thread Ferran Mazzanti
Thanks, that seems to work. Still it amazes me how Julia, being a language made for numerical calculations, does not natively support a simple mechanism to print/write large bunches of numbers. I've been in the numerical world for 20+ years and I know printing lots of numbers is something you

[julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tomas Lycken
Julia is a young language. This comes with a lot of benefits - for example, it's possible to do things *right* from the start. We're currently in a phase where there is a multitude of possible solutions to every problem that arises, and we honestly don't know which solution proves to be the

Re: [julia-users] Tripping myself up on macro hygiene (again...)

2015-09-22 Thread Tomas Lycken
That's quite a lot cleaner than what I came up with, and keeps as much of the expression as possible in regular code-syntax. Thanks! // T On Tuesday, September 22, 2015 at 11:23:33 AM UTC+2, Tim Holy wrote: > > What you're trying isn't easy because the results of @ntuple, unless > contained >

Re: [julia-users] Tripping myself up on macro hygiene (again...)

2015-09-22 Thread Tim Holy
What you're trying isn't easy because the results of @ntuple, unless contained inside an Expr, will be eval'ed so you'll still create the tuple. And expression-tuples are not iterable, so you can't splat them. Manual construction: function foo(N) args = [symbol("xs_",k) for k = 1:N]

[julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tomas Lycken
> If C can have one, why can't Julia? *The hard truth, and nothing but it:* If Julia is missing a feature, or has one that works in a way that's not the way you want, it's because no-one has wanted what you want enough to actually implement it. That's it. There's no "it can't be done" - Julia

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Christoph Ortner
Judging from your contributions to Julia you must have been the most sophisticated (in terms of coding ability) Matlab user ever :). Christoph On Tuesday, 22 September 2015 11:05:01 UTC+1, Tim Holy wrote: > > I'm a former Matlab user, and I hated meshgrid even before I discovered > Julia >

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Christoph Ortner
P.S.: this means you don't count! Judging from your contributions to Julia you must have been the most > sophisticated (in terms of coding ability) Matlab user ever :). > > Christoph > >> >>

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Christoph Ortner
Tempting, but logically it really shouldn't be in PyCall. (in my view) Also - it is not just PyPlot/PyCall lovers, but also former Matlab users. Christoph On Tuesday, 22 September 2015 10:47:23 UTC+1, Tim Holy wrote: > > On Tuesday, September 22, 2015 02:37:55 AM Christoph Ortner wrote: > >

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Tim Holy
I'm a former Matlab user, and I hated meshgrid even before I discovered Julia :-). --Tim On Tuesday, September 22, 2015 03:01:08 AM Christoph Ortner wrote: > Tempting, but logically it really shouldn't be in PyCall. (in my view) > > Also - it is not just PyPlot/PyCall lovers, but also former

[julia-users] FFTW.REDFT00 and FFT.RODFT00 are ~10x slower than other routines?

2015-09-22 Thread Sheehan Olver
I get the following timings with the various FFTW routines, where I ran each line multiple times to make sure it was accurate. Why are REDFT00 and RODFT00 almost 10x slower? r=rand(10) @time FFTW.r2r(r,FFTW.REDFT00) #0.26s @time FFTW.r2r(r,FFTW.REDFT01) #0.0033s @time

[julia-users] Re: FFTW.REDFT00 and FFT.RODFT00 are ~10x slower than other routines?

2015-09-22 Thread Sheehan Olver
This is in 0.4rc2 on OS X. On Tuesday, September 22, 2015 at 8:51:50 PM UTC+10, Sheehan Olver wrote: > > I get the following timings with the various FFTW routines, where I ran > each line multiple times to make sure it was accurate. Why are REDFT00 and > RODFT00 almost 10x slower? > > >

[julia-users] Re: poisson distribution?

2015-09-22 Thread Kristoffer Carlsson
How slow is it? For me 100 million values take 5 seconds. The code just ccalls to the Rmath library to get the random number. On Tuesday, September 22, 2015 at 11:51:19 AM UTC+2, Jon Norberg wrote: > > I need to get random variables from poisson distributions with different > lambda > > this is

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Tim Holy
On Tuesday, September 22, 2015 02:37:55 AM Christoph Ortner wrote: > another example why meshgrid should be in Base. :) Rightly or wrongly, I think I've noticed a correlation between "loves meshgrid" and "uses PyPlot/PyCall". So why not just submit a PR to add it to PyCall.jl? The power is in

Re: [julia-users] Is UInt for storing binary strings or unsigned integers?

2015-09-22 Thread elextr
There is a (very) small argument for unsigned array indexes in C/C++ where indexing is from zero, but as Stefan says, for Julia, with indexing starting at one, you have to test both limits anyway. On Tuesday, September 22, 2015 at 1:11:03 AM UTC+10, Stefan Karpinski wrote: > > Suppose you have

Re: [julia-users] linspace and HDF5

2015-09-22 Thread Christoph Ortner
another example why meshgrid should be in Base. :) Christoph

[julia-users] poisson distribution?

2015-09-22 Thread Jon Norberg
I need to get random variables from poisson distributions with different lambda this is the only way I got it to work at the moment BUT its very slow! using Distributions lambda=linspace(0.1,2,100) out=zeros(Int64,100) for i=1:length(lambda) P=Poisson(lambda[i]) out[i]=rand(P) end Anyone

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Daniel Carrera
Coding sprintf() is beyond my skill, I tried. My contributions to Julia have to lie elsewhere (recently I've been putting a lot of time making mockups of a Julia IDE, and helping a new user port his Matlab code). I think it is rude to say "if you don't like it, fix it yourself"; especially after

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Kristoffer Carlsson
http://stackoverflow.com/questions/19783030/in-julia-why-is-printf-a-macro-instead-of-a-function On Tuesday, September 22, 2015 at 4:20:41 PM UTC+2, Tom Breloff wrote: > > Chill guys. > > Anyways... I started to tackle this problem, but didn't get any (much > needed) comments on whether I was on

Re: [julia-users] Re: Can Julia function be serialized and sent by network?

2015-09-22 Thread Andrei
So far the best way to overcome it is to install all needed Julia packages on every machine. This is not very convenient, but at least it's not a blocker and you need to install some Julia packages manually anyway (though I'm thinking of creating API for massive installation of packages on all

[julia-users] Re: poisson distribution?

2015-09-22 Thread Jon Norberg
Sorry, thought I could delete threadso deleted first postmy bad

[julia-users] Re: What's your favourite editor?

2015-09-22 Thread Andrei Zh
> > I'd be grateful to hear from other emacs users regarding your workflows > for Julia development, e.g. if you want to write a Julia package what emacs > packages, setup and workflow help you to be the most productive? > > I use ESS + autocomplete + few keybindings (I'll post exact .init.el

[julia-users] Re: PyCall crash after running Pkg.update()

2015-09-22 Thread jamesmnason
Hi Steven: Thanks. I ran Pkg.update() this morning, using PyCall, and using PyPlot and Julia responded with no problems. Whatever the problem was, seems to have disappeared into the virtual ether. Jim On Monday, September 21, 2015 at 12:40:42 PM UTC-4, Steven G. Johnson wrote: > > I haven't

[julia-users] Re: poisson distribution?

2015-09-22 Thread Jon Norberg
I think I had a problem in how I used the resulting data that slowed it down. Solved, Thanks

[julia-users] Re: When does colon indexing get evaluated / converted?

2015-09-22 Thread Matt Bauman
A colon by itself is simply a synonym for `Colon()`, both on 0.3 and 0.4: julia> : Colon() You can use colons in normal function calls and dispatch in both 0.3 and 0.4: julia> f(x::Colon) = x f(:) Colon() That's what's happening with that sub definition. `sub` acts like indexing, but

[julia-users] Re: @sprintf with a format string

2015-09-22 Thread Daniel Carrera
I might be wrong, but to me Formatting.jl looks next to useless. The "sprintf" functions it provides only accept one parameter. The main function provided is `sprintf1()`, but even the very clumsy `generate_formatter()` function fails at the most basic tasks: julia> fmtrfunc =

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tom Breloff
Chill guys. Anyways... I started to tackle this problem, but didn't get any (much needed) comments on whether I was on the right track. Here's some sample preliminary usage of what I was working on. Please let me know if you think it's worth continuing, and what you'd ideally like to see in a

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Tomas Lycken
If anything I wrote came off as a "thinly veiled 'fuck you'", I am sincerely sorry; that's nowhere near what I meant to say. My two answers were directed at very different pieces of critique: first, I reacted to the statement "what I do not like is the idea of having to install every time a

[julia-users] Creating custom METADATA

2015-09-22 Thread Andrew Gibb
I'm trying to follow the steps in the 0.4 Manual to create a custom METADATA.jl so that I can distribute packages around my organisation. If I clone JuliaLang/METADATA.jl.git into a local folder, then call Pkg.init() on that folder, I get the following: INFO: Initializing package repository

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Michael Hatherly
Anyways… I started to tackle this problem As an interesting/entertaining hack you can “lift” the formatting string out of @printf with a staged function: immutable Formatter{format} end fmt(str) = Formatter{symbol(str)}() @generated function printf{format}(io :: IO, :: Formatter{format},

[julia-users] Re: FFTW.REDFT00 and FFT.RODFT00 are ~10x slower than other routines?

2015-09-22 Thread Páll Haraldsson
I'm just curious so I looked into it. I'm just, familiar, with what FFT, DCT, IDCT and Fourier transform is for.. but not really that much and my math is fading.. I got similar numbers (I'm on 0.3.11) to you and then I tried with (as I recall power of twos are what you should be using):

Re: [julia-users] Why does type inference not work for cat? (0.4-rc1)

2015-09-22 Thread Mauro
After looking into this, I think this may be tricky to avoid. But yes, possibly a bug or certainly a feature to improve on. One of the culprits is the following expression inside the cat function: [isa(x,AbstractArray) ? eltype(x) : typeof(x) for x in X] Checking this: f2(X...) =

Re: [julia-users] Is UInt for storing binary strings or unsigned integers?

2015-09-22 Thread Páll Haraldsson
Yes and no(?). If array indexes are shifted by one and unsigned is used then you only need to compare to length(v)-1. This subtract by one, is faster than compare in CPUs (usually..), besides the bounds checking isn't really a problem unless you are in a loop and then can't this just be done

Re: [julia-users] Re: @sprintf with a format string

2015-09-22 Thread Stefan Karpinski
Responding with a solicitation for help in an open source project is not a rhetorical ploy – it's a legitimate request for contribution. I wrote the printf code in Julia some time ago and it clearly could use revisiting – the API is not working out for people. However, that is a large amount of