[julia-users] Re: base case for the reduce operator?

2014-11-05 Thread Ivar Nesje
> > # reducing with a single polynomial list gives just the polynomial back > reduce(+, [p1]) > > p1 > Doesn't this just work? It does for me. # reducing with an empty list gives back the 0 polynomial > reduce(+, []) > > ZeroPoly If you ensure that the array is correctly typed (eg: Poly[] ), yo

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Seth Yuan
Hi Amit, Thanks for the response, I tried Base.flush_gc_msgs(), the result is shown below: It did free some memory on some workers, but not quite. I think the acceptable number for workers would b

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Amit Murthy
Could you try: @everywhere gc() @everywhere Base.flush_gc_msgs() @everywhere gc() On Wed, Nov 5, 2014 at 2:07 PM, Seth Yuan wrote: > Hi Amit, > > Thanks for the response, I tried Base.flush_gc_msgs(), the result is shown > below: > > >

Re: [julia-users] inv(::Symmetric), slow

2014-11-05 Thread Stefan Karpinski
Well, I meant specifically how the special matrix types in Julia and the functions like factorize interact with them. It has grown to be a really polished, powerful interface. On Wed, Nov 5, 2014 at 4:10 AM, Tony Kelman wrote: > There are several chapters of Trefethen, or Demmel, on these exact

Re: [julia-users] linreg(X,Y) not working.

2014-11-05 Thread Milan Bouchet-Valat
Le mardi 04 novembre 2014 à 14:55 -0800, Karel Zapfe a écrit : > Hi Milan Bouchet-Valat: > > > Thanks for the fast reply. > My OS is a gentoo gnu/linux, and I got julia from the "portage tree", > the usual repositories from source that gentoo mantains. The output of > the > command you r

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Stefan Karpinski
Well, I'm not sure what the intention was, but this fact is true: for floating-point values x and y of the same type, x == y is true if and only if string(x) == string(y). On Wed, Nov 5, 2014 at 5:36 AM, Steven G. Johnson wrote: > > > On Tuesday, November 4, 2014 8:44:55 PM UTC-5, Stefan Karpins

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Stefan Karpinski
On Wed, Nov 5, 2014 at 2:48 AM, Jameson Nash wrote: > fun fact: even with "format long", matlab doesn't always print enough > digits to reconstruct the number > Do you have an example? If true, this is rather horrifying. Is there simply no way to print a true value from Matlab then?

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Ivar Nesje
The matlab docs clearly specifies format long as 15 digits . Julia usually prints 16 (or 17) digits for a call to rand(). This is a typical distribution of the number of digits from a `rand(1_000_000)` cal

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Stefan Karpinski
This looks like an OS X screenshot – do processes on OS X ever relinquish memory back to the kernel? I'm not sure that they do. On Wed, Nov 5, 2014 at 9:47 AM, Amit Murthy wrote: > Could you try: > > @everywhere gc() > @everywhere Base.flush_gc_msgs() > @everywhere gc() > > > > On Wed, Nov 5, 20

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Arnaud Amiel
You may want to check the isapprox function.

Re: [julia-users] inv(::Symmetric), slow

2014-11-05 Thread David van Leeuwen
Andreas, Thanks for the detailed explanations, that's great to know. It would be useful indeed to include some more details on the matrix hierarchy in the documentation. I had been looking for a type indicating positive definiteness, but the closest I could find was Hermitian (Cholesky is

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Tamas Papp
IMO simulation is not necessary here --- double float is known to have 52 bits for the significand, so which tranlates to a bit less than 16 decimal digits, + 1 for rounding error (magnitude of rounding error is non-uniform when reading back from decimal), which is how you get 17, so clearly 15 is

Re: [julia-users] How Julia do math operations

2014-11-05 Thread David van Leeuwen
I couldn't resist this after my cholfact() revelation... On Wednesday, November 5, 2014 11:23:03 AM UTC+1, Stefan Karpinski wrote: > > Well, I'm not sure what the intention was, but this fact is true: for > floating-point values x and y of the same type, x == y is true if and only > if string(x)

Re: [julia-users] Trigonometric functions at infinity

2014-11-05 Thread isahin
In order to avoid exiting the program, I am checking for Inf and setting the result to Nan manually for each trigonometric function. I agree with John's comments and hope that something like this would become default behavior. @Milan: Thanks for the link, it is a good one. On Tuesday, Novem

Re: [julia-users] Trigonometric functions at infinity

2014-11-05 Thread isahin
In order to avoid exiting the program, I am checking for Inf and setting the result to Nan manually for each trigonometric function. I agree with John's comments and hope that something like this would become default behavior. @Milan: Thanks for the link, it was a good one.

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Stefan Karpinski
This code prints a random Float64 that requires more than 15 digits to reconstruct: while true x = rand() if parsefloat(@sprintf("%.15f", x)) != x println(x) break end end There are lots of them. What's more surprising is that if you replace 15 with anything up to 20,

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Patrick O'Leary
On Wednesday, November 5, 2014 4:25:16 AM UTC-6, Stefan Karpinski wrote: > > On Wed, Nov 5, 2014 at 2:48 AM, Jameson Nash wrote: > >> fun fact: even with "format long", matlab doesn't always print enough >> digits to reconstruct the number >> > > Do you have an example? If true, this is rather ho

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Tamas Papp
I think that you are just running floats which are "subnormal" in a fixed-point decimal representation: with "%.17f", they have (on average) a single 0 after the decimal dot, with "%.18f", they have two, etc. Printing them with %f but a fixed number of digits is not the right way, since you waste d

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Stefan Karpinski
No, these aren't subnormal values, although they are small. Using %.16e does print them all accurately though, so that's a bit misleading. By "hang" I meant that it doesn't return quickly, not that it won't ever return. On Wed, Nov 5, 2014 at 2:27 PM, Tamas Papp wrote: > I think that you are jus

[julia-users] Re: type confusions in list comprehensions (and how to work around it?)

2014-11-05 Thread Dahua Lin
The output type of list comprehension is often difficult to infer (by human), as it depends on a complex compile-time type inference mechanism. This, combined with the fact that its behavior is inconsistent with that of the function map, is a recipe for confusion. We should try to make things m

Re: [julia-users] Re: type confusions in list comprehensions (and how to work around it?)

2014-11-05 Thread Stefan Karpinski
That's the plan: https://github.com/JuliaLang/julia/issues/7258. On Wed, Nov 5, 2014 at 2:54 PM, Dahua Lin wrote: > The output type of list comprehension is often difficult to infer (by > human), as it depends on a complex compile-time type inference mechanism. > This, combined with the fact tha

Re: [julia-users] How Julia do math operations

2014-11-05 Thread Tamas Papp
That's not what I said -- of course they are not subnormal as double floats, but they are (in a sense, for want of a better term) "subnormal" when using a fixed point decimal representation, such as sprintf("%.17f", ...). A more relevant form of the test should be something like while true x =

[julia-users] Re: How to assign names of a RArray object in Rif.jl?

2014-11-05 Thread xiongjieyi
Quite good improvements. Thanks! I like getrnames and setrnames!, That's much intuitive! On Thursday, October 30, 2014 10:44:01 PM UTC+1, lgautier wrote: > > I'd be happy to follow the naming convention for generics when handling > named arrays. > > On Monday, October 27, 2014 11:17:47 AM UTC-4,

[julia-users] opening a .txt file by invoking julia from the shell

2014-11-05 Thread adrian . viehweger
Dear Julia community, I am trying to open a .txt file to process it with Julia like so: julia -e 'using DataFrames; df = readtable("somefile.txt", header=false, separator=' '); println(df[1,1])' I get: ERROR: syntax: incomplete: premature end of input probably because in trying to specify the

Re: [julia-users] opening a .txt file by invoking julia from the shell

2014-11-05 Thread Stefan Karpinski
You are running afoul of shell escaping rules . This should work: julia -e 'using DataFrames; df = readtable("somefile.txt", header=false, separator='\'' '\''); println(df[1,1])' On Wed, Nov 5, 2014 at 4:28 PM, wrote: > Dear Julia community, > > I am try

Re: [julia-users] opening a .txt file by invoking julia from the shell

2014-11-05 Thread adrian . viehweger
Awesome, thx!

Re: [julia-users] How to remove warnings in PyPlot

2014-11-05 Thread Steven G. Johnson
On Wednesday, November 5, 2014 2:28:06 AM UTC-5, Daniel Carrera wrote: > > Thanks. Is there a way I could determine if the backend is different? > > I just tested a simple plot in Python and Julia. The windows do look very > slightly different. It's minor, but on Python the buttons in the plot

[julia-users] Re: Multiple Plots with Winston

2014-11-05 Thread Steven G. Johnson
On Wednesday, November 5, 2014 12:34:15 AM UTC-5, yaois...@gmail.com wrote: > > Just getting into plotting data in Julia today. Gravitating towards > Winston because of the similarity of its syntax to that of Matplotlib. > (Note that if Matplotlib syntax is an important feature for you, you can

[julia-users] auto_unbox: unable to determine argument type

2014-11-05 Thread Nils Gudat
I'm puzzled by the error in the thread title. It popped up today while running a piece of code that was unchanged and had been working before. The error is raised inside a nested loop, so I tried running the loop step by step, i.e. I "manually" declared the first pair of values that is usually

Re: [julia-users] auto_unbox: unable to determine argument type

2014-11-05 Thread Isaiah Norton
As a general suggestion: sending version info and short, reproducible code samples will facilitate getting useful advice for questions like this. On Wed, Nov 5, 2014 at 11:59 AM, Nils Gudat wrote: > I'm puzzled by the error in the thread title. It popped up today while > running a piece of code

[julia-users] Full blown GUI programming with Julia+JS

2014-11-05 Thread Viral Shah
See @shashi's https://github.com/dcjones/Compose.jl/pull/89 Teaser: This back-end lets us draw Compose and Gadfly graphics using virtual-dom for rendering. There is a mechanism through which re-rendering happens via a diff-patch mechanism using Patch

Re: [julia-users] Full blown GUI programming with Julia+JS

2014-11-05 Thread John Myles White
This is really awesome. I'm really consistently amazed at how cool the projects that Shashi works on are. -- John On Nov 5, 2014, at 9:16 AM, Viral Shah wrote: > See @shashi's https://github.com/dcjones/Compose.jl/pull/89 > > Teaser: > > This back-end lets us draw Compose and Gadfly graphi

Re: [julia-users] auto_unbox: unable to determine argument type

2014-11-05 Thread Nils Gudat
Good point. The problem is that the error happens at a point in my code that is quite hard to boil down to something reproducable, especially because when I try reproducing it step-by-step from my own code (!), it doesn't appear. Of course you are still correct that I forgot to post the version

[julia-users] ANN: FactCheck v0.2

2014-11-05 Thread Iain Dunning
Hi all, I've just tagged FactCheck.jl v0.2 in METADATA. FactCheck was started by Zach Allaun a long long time ago in Julia terms (March 2013), and was one of (if not the) first testing package for Julia. Julia has managed to accumulate a large number of testing packages, but none are as widely

[julia-users] Re: Conditional loading of modules (for speed)

2014-11-05 Thread Zenna Tavares
Any ideas on this? On Monday, September 22, 2014 9:54:41 AM UTC-4, Zenna Tavares wrote: > > In a module i am working on I have quite a few plotting functions, all > contained within a file vis.jl. > To plot I use Gadfly. The problem is that on my machine at least, Gadfly > takes an awful long t

[julia-users] Re: Conditional loading of modules (for speed)

2014-11-05 Thread Michael Hatherly
I’ve used the following *hack* to do a similar thing: function plotfunc(args...) isdefined(:Gadfly) || eval(Expr(:using, :Gadfly)) println("do things...") end Hope that helps. Perhaps there’s a more elegant way to do this though? — Mike ​

Re: [julia-users] auto_unbox: unable to determine argument type

2014-11-05 Thread Isaiah Norton
Yes, it can be tricky to reduce these things because inference, inlining, etc. may be subtly different depending on the context (e.g. global variables or top-level scope). If possible try to get it down to 50 lines or so. This is an inference issue, but I'm not sure if anyone can say much more tha

[julia-users] Re: Multiple Plots with Winston

2014-11-05 Thread yaoismyhero
@Steven: I tried Pycall, but was unable to get LaTeX labeling to work. On Wednesday, November 5, 2014 11:16:35 AM UTC-5, Steven G. Johnson wrote: > > > > On Wednesday, November 5, 2014 12:34:15 AM UTC-5, yaois...@gmail.com > wrote: >> >> Just getting into plotting data in Julia today. Gravitatin

[julia-users] Re: Multiple Plots with Winston

2014-11-05 Thread Daniel Høegh
When you use labels they should be escaped properly: xlabel("\$\\sigma\$ [MPa]") or xlabel(L"$\sigma$ [MPa]")

[julia-users] Plotting Options Survey 2014

2014-11-05 Thread yaoismyhero
Hi all -- perhaps I am erring by necro-ing a thread from last year. However, this was the closest thing I found to a survey of all the plotting options available on Julia and I thought it wouldn't be so bad to revive this thread for an updated discussion. How is the field of plotting options n

[julia-users] Re: Getting Julia to emit an unrolled inner loop with SIMD instructions

2014-11-05 Thread Toivo Henningsson
On Sunday, 2 November 2014 22:27:28 UTC+1, Gunnar Farnebäck wrote: > > It might be possible to get further doing llvmcall with LLVM inline > assembly but my feeble attempts at that have only resulted in crashes > (well, sort of, getting dumped back to shell prompt without ceremony). > I initi

Re: [julia-users] Trigonometric functions at infinity

2014-11-05 Thread Simon Byrne
Alternatively, you could just redefine sin without the nan_dom_err call: https://github.com/JuliaLang/julia/blob/cdcdc7ae5a79d5f8232a14e6e072123dd178cf9e/base/math.jl#L123 Something like the following should work: import Base.sin sin(x::Float64) = ccall((:sin,Base.Math.libm), Float64, (Float64,),

[julia-users] More on ::Symmetric and speed

2014-11-05 Thread David van Leeuwen
Hello again, I am having great fun with optimizing the inner loop in my code for full covariance matrices in variational Bayes GMMs. The right call to BLAS wrappers at critical points makes all the difference. For building the covariance matrices, one ends up summing a lot of ` Δ * Δ' ` con

Re: [julia-users] linreg(X,Y) not working.

2014-11-05 Thread Karel Zapfe
> Estimated Milan: I have the following data about my lapack: The instaled packages are lapack-reference-3.1.1-r1 and virtual/lapack-3.1 (a wrapper, essentialy) The output of ls -l for my libraries are as follows: -rw-r--r-- 1 root root 264 may 9 2013 lapack.pc -rw-r--r-- 1 root root 83

Re: [julia-users] More on ::Symmetric and speed

2014-11-05 Thread Andreas Noack
full(Symmetric) will give you what you are looking for. The method coverage of Symmetric could be better. It was introduced to make it easier to call the symmetric eigenvalue solver, but as the use of it has extended beyond that use, we should work on extending the coverage. Feel free to open pull

Re: [julia-users] linreg(X,Y) not working.

2014-11-05 Thread Andreas Noack
It is a quite old LAPACK, but I don't think they have changed that subroutine. I'm wondering if this could be a ilp64 issue. What do you get from Base.LinAlg.BlasInt? The gentoo libraries are probably compiled for 32 bit integers. 2014-11-05 17:15 GMT-05:00 Karel Zapfe : > > Estimated Milan: > >

Re: [julia-users] linreg(X,Y) not working.

2014-11-05 Thread Ivar Nesje
0.3.2 will not fix this issue, but it will fix lots of other small issues that you probably don't want to learn about. It is also intended to be backwards compatible with 0.3.0, so unless your code depends on something we considered a bug, it will work. Some package authors might not test their

Re: [julia-users] linreg(X,Y) not working.

2014-11-05 Thread Ivar Nesje
0.3.2 will not fix this issue, but it will fix lots of other small issues that you probably don't want to learn about. It is also intended to be backwards compatible with 0.3.0, so unless your code depends on something we considered a bug, it will work. Some package authors might not test their

Re: [julia-users] linreg(X,Y) not working.

2014-11-05 Thread Ivar Nesje
0.3.2 will not fix this issue, but it will fix lots of other small issues that you probably don't want to learn about. It is also intended to be backwards compatible with 0.3.0, so unless your code depends on something we considered a bug, it will work. Some package authors might not test their

Re: [julia-users] linreg(X,Y) not working.

2014-11-05 Thread Ivar Nesje
0.3.2 will not fix this issue, but it will fix lots of other small issues that you probably don't want to learn about. It is also intended to be backwards compatible with 0.3.0, so unless your code depends on something we considered a bug, it will work. Some package authors might not test their

Re: [julia-users] More on ::Symmetric and speed

2014-11-05 Thread David van Leeuwen
Hi, On Wednesday, November 5, 2014 11:29:35 PM UTC+1, Andreas Noack wrote: > > full(Symmetric) will give you what you are looking for. > Thanks, that is what I was looking for indeed. Learning the vocabulary of a new language takes me a long time... > The method coverage of Symmetric could

[julia-users] Re: ANN: FactCheck v0.2

2014-11-05 Thread yfractal
That's is really really exciting! I think, write code let me understand things, and test let me know the code! Iain Dunning於 2014年11月6日星期四UTC+8上午1時35分11秒寫道: > > Hi all, > > I've just tagged FactCheck.jl v0.2 in METADATA. > > FactCheck was started by Zach Allaun a long long time ago in Julia term

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Seth Yuan
I tried this as you recommended, sadly, it doesn't do better. :( On Wednesday, November 5, 2014 4:48:10 PM UTC+8, Amit Murthy wrote: > > Could you try: > > @everywhere gc() > @everywhere Base.flush_gc_msgs() > @everywhere gc() > > > > On Wed, Nov 5, 2014 at 2:07 PM, Seth Yuan > > wrote: > >> Hi A

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Elliot Saba
@Stefan, they do, but we've had a longstanding issue regarding whether we're releasing it as aggressively as we might need to in order to really shrink the number of pages we've got allocated. In short; calling gc() may not actually reduce the "Memo

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Seth Yuan
Your concern about the OS capability to do memory management (or show info about it) is misleading people! I did the same experiment on a CentOS 6.5, and the memory usage shown by 'top' is: As yo

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Seth Yuan
I don't think it's an OSX only issue, as I have duplicated the issue on a Centos too. Perhaps you guys can run the demo code I gave, test it on your own machines to better appreciate the problem. Here a modified code without module dependency. function test_allocation() a = drand(1, 1000

Re: [julia-users] More on ::Symmetric and speed

2014-11-05 Thread Steven G. Johnson
On Wednesday, November 5, 2014 5:53:57 PM UTC-5, David van Leeuwen wrote: > > I don't have time right now to dive into your gists, but "summing a lot of >> Δ * Δ'" sounds very much like a matrix X'X operation since X'X = >> ∑xᵢ*xᵢ' where the xᵢs are the rows of X. >> > > sure, but the proble

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Amit Murthy
Issue created : https://github.com/JuliaLang/julia/issues/8912 On Thu, Nov 6, 2014 at 7:56 AM, Seth Yuan wrote: > I don't think it's an OSX only issue, as I have duplicated the issue on a > Centos too. > > Perhaps you guys can run the demo code I gave, test it on your own > machines to better

Re: [julia-users] When or how a distributed array is deallocated?

2014-11-05 Thread Elliot Saba
Thanks for the sample code Seth, you're right. This is a different issue entirely, and I can replicate your issue. Good find. -E On Wed, Nov 5, 2014 at 9:15 PM, Amit Murthy wrote: > Issue created : https://github.com/JuliaLang/julia/issues/8912 > > > > > On Thu, Nov 6, 2014 at 7:56 AM, Seth Yu

Re: [julia-users] Re: ANN: FactCheck v0.2

2014-11-05 Thread Shashi Gowda
+1000 I love this package. On Thu, Nov 6, 2014 at 5:48 AM, wrote: > That's is really really exciting! > > I think, write code let me understand things, and test let me know the > code! > > > Iain Dunning於 2014年11月6日星期四UTC+8上午1時35分11秒寫道: > >> Hi all, >> >> I've just tagged FactCheck.jl v0.2 in M