Re: [julia-users] Re: why does in(x,y) not follow the usual semantics of built-ins?

2015-01-11 Thread Steven G. Johnson
For any infix operator O, O(x,y) is equivalent to x O y. Since in is an infix operator, it follows the same convention.

[julia-users] Re: Strange random NaN's

2015-01-12 Thread Steven G. Johnson
On Monday, January 12, 2015 at 11:26:31 AM UTC-5, Peter Brady wrote: So I take it that no one else has this issue? Maybe I should compile julia myself and see if the problem goes away. I've never seen this issue reported. Can you post a simple self-contained test script that illustrates

Re: [julia-users] Re: Sort performance depends on Array type in a strange way

2015-01-12 Thread Steven G. Johnson
On Monday, January 12, 2015 at 8:36:28 AM UTC-5, Andras Niedermayer wrote: It's still not entirely satisfactory that sorting arrays of tuples is so much slower in Julia than in Python, (Note that for sorting an untyped array of tuples, Julia may never have much if any advantage over

[julia-users] Re: [ANN] PolarFact: a Julia package for the matrix polar decomposition

2015-01-12 Thread Steven G. Johnson
It would be nice to provide some explanation in the README of why you implemented each method. What are the circumstances in which you would use each one?

Re: [julia-users] Naming of functions advice

2015-01-12 Thread Steven G. Johnson
On Monday, January 12, 2015 at 3:40:39 PM UTC-5, Kevin Squire wrote: If the functions take arguments that are typed as LTISystem, then there shouldn't be any conflict. That's what multiple dispatch is for! To expand on this, the key behavior of Julia is that it allows you to add new methods

[julia-users] Re: in-place substitution for an array?

2015-01-12 Thread Steven G. Johnson
On Monday, January 12, 2015 at 2:52:51 PM UTC-5, Douglas Bates wrote: This is trivial to write myself but I wanted to check that I am not missing an already-defined function. I need to scan an Int32 array replacing all instances of typemin(Int32), which is the missing value sentinel

Re: [julia-users] Logical indexing with .≤ A bug?

2015-01-08 Thread Steven G. Johnson
On Thursday, January 8, 2015 at 5:28:39 PM UTC-5, Jake Bolewski wrote: Julia is space sensitive, and errors like this can crop up. I don't see how this is behavior is inconsistent. Use whitespace! :-) It's inconsistent because 5.≤x and 5.=x are tokenized differently.

[julia-users] Re: I cannot reach GitHub because of a firewall at work, how do I install Gadfly?

2015-01-09 Thread Steven G. Johnson
See the manual on how to use git from behind a firewall: http://docs.julialang.org/en/latest/manual/packages/ In particular, you can run git config --global url.https://.insteadOf git:// to tell git to use https instead of git protocol, in order to work with your firewall.

Re: [julia-users] Re: I cannot reach GitHub because of a firewall at work, how do I install Gadfly?

2015-01-09 Thread Steven G. Johnson
On Friday, January 9, 2015 at 4:56:29 PM UTC-5, John Hall wrote: I've seen both the git manual and the https/git workaround before. Neither seem to work. If you do git clone manually from the command line with an https or http URL, does it work? It would be good to diagnose the specific

[julia-users] Re: Interface design advice - optional plotting?

2015-01-06 Thread Steven G. Johnson
In Julia it is usually considered bad style to have the output type of function depend on the input values --- it is a good idea to get into the habit of writing type-stable functions whose output types depend only on their input types, and not on the values of their inputs, because this is

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

2015-01-06 Thread Steven G. Johnson
On Tuesday, January 6, 2015 5:15:13 AM UTC-5, Andreas Lobinger wrote: Hello colleagues, is there a counterpart for the string literal split to multiple lines like in python? d = '09ab\ eff1\ a2a4' You can always just concatenate: d = 09ab * eff1 * a2a4

[julia-users] Re: Squeezing more performance out of a mandelbrot set computation

2015-01-06 Thread Steven G. Johnson
In addition to putting your main loops into a function, I would also just inline the normalized_iterations function rather than passing it as an itmap parameter, and inline the function f. i.e. specialize your boundedorbit function to the mandelbrot case. (Anonymous functions like x - x^2 +

Re: [julia-users] Running mean/median in Julia

2015-01-06 Thread Steven G. Johnson
On Tuesday, January 6, 2015 12:37:24 PM UTC-5, Tim Holy wrote: For running mean, cumsum gives you an easy approach, if you don't mind a little floating-point error. Yikes, just noticed that cumsum is significantly less accurate than sum; basically, cumsum is no better than naive

Re: [julia-users] readdir returns inconsistent types

2015-01-12 Thread Steven G. Johnson
My understanding is that the distinction between ASCIIString and UTF8String will be removed in a future Julia release.

Re: [julia-users] readdir returns inconsistent types

2015-01-13 Thread Steven G. Johnson
On Tuesday, January 13, 2015 at 7:43:07 PM UTC-5, ele...@gmail.com wrote: Which can present problems if the UTF8String is displayed or otherwise used where valid UTF8 is required. It will display as mojibake, but you will still be able to open the file. There doesn't seem to be much

[julia-users] Re: Shogun Toolbox integration

2015-01-13 Thread Steven G. Johnson
On Tuesday, January 13, 2015 at 6:52:02 AM UTC-5, Куракин Александр wrote: Is there some way to use Shogun Toolbox (http://shogun-toolbox.org/) with Julia? Since it is a C++ library, you can't call it directly from Julia with ccall. (The next Julia release will make it much easier to

Re: [julia-users] Julia cannot compute factorial(21) while Octave can

2015-01-13 Thread Steven G. Johnson
On Tuesday, January 13, 2015 at 12:04:49 AM UTC-5, Ivar Nesje wrote: Octave uses Float64 numbers by default, so factorial(20) in octave is equivalent to factorial(20.0) in Julia. Although we don't currently define factorial for non-integer values, you can use the gamma function with

Re: [julia-users] Julia cannot compute factorial(21) while Octave can

2015-01-13 Thread Steven G. Johnson
See https://github.com/JuliaLang/julia/pull/9754

[julia-users] Re: New method should respect previous syntax?

2015-01-13 Thread Steven G. Johnson
In any module, if you define function signif, it will completely replace Base's signif (for *all* argument types), but only within that module; other modules will not be affected. Defining things in the REPL is equivalent to defining them within the module Main. If, instead, you want to add

[julia-users] Re: what do you do with strings in julia

2015-01-13 Thread Steven G. Johnson
On Tuesday, January 13, 2015 at 2:50:34 PM UTC-5, Evan Pu wrote: what is the convention? I kept getting `convert` has no method matching convert(::Type{SubString(UTF8String)}}, ::ASCIIString) all the time, every time What are you doing that triggers this error? I'm guessing that you have

Re: [julia-users] Logical indexing with .≤ A bug?

2015-01-08 Thread Steven G. Johnson
You're right, there are dot versions of .≤, just not other Unicode operators. As Mauro said, the parser is just tokenizing 5.≤x as 5. ≤ x. It is annoyingly inconsistent here: julia parse(5.≤x) :(5.0 ≤ x) julia parse(5.=x) :(5 .= x)

Re: [julia-users] numpy vs julia benchmarking for random matrix-vector multiplication

2015-01-08 Thread Steven G. Johnson
For comparison, the NumPy vander function https://github.com/numpy/numpy/blob/f4be1039d6fe3e4fdc157a22e8c071ac10651997/numpy/lib/twodim_base.py#L490-L577 does all its work in multiply.accumulate. Here is the outer loop of multiply.accumulate (written in C):

[julia-users] Re: how to input array or convert string to array?

2015-01-12 Thread Steven G. Johnson
On Monday, January 12, 2015 at 2:42:59 AM UTC-5, Ivar Nesje wrote: Note that there might be a security issue, because whoever inputs data to your program also get the ability to run arbitrary code on the computer. In a local setting where everyone who input data, also have access to changing

[julia-users] Re: question on utf8 strings

2015-01-12 Thread Steven G. Johnson
On Sunday, January 11, 2015 at 4:38:29 PM UTC-5, William Macready wrote: I've been using Julia for about a month now, and I'm really enjoying the language. My thanks to all who've contributed to it's development! I'm developing a parser for first-order logic, and wanted to use the logic

[julia-users] Re: Plotting with Julia versus Mathematica

2015-02-08 Thread Steven G. Johnson
On Thursday, February 5, 2015 at 10:41:23 AM UTC-8, Martin Johansson wrote: If you by Density plot refer to Mathematica's 'DensityPlot' than maybe simply using contourf could be OK. Unfortunately I don't know much about the plotting facilities in Julia (read: PyPlot). You can use pcolor,

[julia-users] Re: Suppress printed output from PyPlot

2015-02-13 Thread Steven G. Johnson
On Friday, February 13, 2015 at 4:58:44 AM UTC-5, gdmsl wrote: julia plot(rand(10),rand(10)); Figure(PyObject matplotlib.figure.Figure object at 0x7f7979d24dd8) Figure(PyObject matplotlib.figure.Figure object at 0x7f7979d24dd8) I really need to suppress output like Figure(PyObject

Re: [julia-users] reading compressed csv file?

2015-01-05 Thread Steven G. Johnson
On Monday, January 5, 2015 9:09:41 AM UTC-5, Kevin Squire wrote: FWIW, I believe that there was concern that the behavior of open(process) might cause confusion when it was defined in this way. (A quick search didn't locate the issue.) See the discussion at

[julia-users] Re: how does method dispatch treat varargs functions?

2015-01-08 Thread Steven G. Johnson
On Thursday, January 8, 2015 10:45:54 AM UTC-5, Steven G. Johnson wrote: However, I'm inclined to think that this is ambiguous, and hence there is a bug here: when you define your method, it should issue a method ambiguity just as it would in the non-varargs case Issue filed: https

Re: [julia-users] recommended reading for c-call interfaces?

2015-01-08 Thread Steven G. Johnson
On Thursday, January 8, 2015 9:59:13 AM UTC-5, Andreas Lobinger wrote: Actually i do not want to pass by value. I thought composite types are references by a pointer (to the first element, like in C) and having mytype as the type of input parameter would pass the pointer to the library

[julia-users] Re: Julia call to Seaborn library

2015-01-08 Thread Steven G. Johnson
On Thursday, January 8, 2015 6:59:55 AM UTC-5, Nils Gudat wrote: Bumping the thread - has anyone tried this/is it possible? Works fine for me, e.g.: using PyCall, PyPlot @pyimport seaborn as sns sns.rugplot(randn(30)) Note that you'll want to use PyPlot as well as PyCall, because PyPlot

[julia-users] Re: how does method dispatch treat varargs functions?

2015-01-08 Thread Steven G. Johnson
Non-varargs methods take precedence over varargs methods in dispatch, assuming both are applicable and there are no other ambiguities. For example: julia f(x...) = 3 f (generic function with 1 method) julia f(x,y) = 4 f (generic function with 2 methods) julia f(3,4) 4 julia f(7) 3

Re: [julia-users] recommended reading for c-call interfaces?

2015-01-08 Thread Steven G. Johnson
On Thursday, January 8, 2015 11:00:58 AM UTC-5, Andreas Lobinger wrote: Looks interesting. But what do i pass with ccall(:flip, Void, (mytype,), t)? That syntax means that you are attempting to pass mytype as a struct by value, which currently does not work reliably due to ABI issues.

[julia-users] Re: how does method dispatch treat varargs functions?

2015-01-08 Thread Steven G. Johnson
On a separate note, I agree that this should be better documented. Currently, the manual just says, When a function is applied to a particular tuple of arguments, the most specific method applicable to those arguments is applied. The precise partial order really needs to be defined

[julia-users] Re: InexactError due to negative hexadecimal number

2015-01-06 Thread Steven G. Johnson
On Monday, January 5, 2015 11:31:05 PM UTC-5, Tony Kelman wrote: Yes, actually. If you're on a 64 bit machine, then the integer literal 0 is an Int64. So int64(0) - 0x12345678 promotes and does the subtraction in Int64. -0x12345678 wraps around to the unsigned integer 0xedcba988 which is

Re: [julia-users] Setting CPU affinity? Taskset does not work

2015-01-06 Thread Steven G. Johnson
My preference would be for Julia not to touch the CPU affinity at all: https://github.com/JuliaLang/julia/pull/9639

Re: [julia-users] numpy vs julia benchmarking for random matrix-vector multiplication

2015-01-08 Thread Steven G. Johnson
On Thursday, January 8, 2015 at 4:15:09 PM UTC-5, Jiahao Chen wrote: Furthermore Vandermonde is not a good test with larger matrix sizes since you are basically testing the speed of multiplying things by infinity, which may not be representative of typical computations as it may incur

Re: [julia-users] numpy vs julia benchmarking for random matrix-vector multiplication

2015-01-08 Thread Steven G. Johnson
On Thursday, January 8, 2015 at 3:29:01 PM UTC-5, Joshua Adelman wrote: You're reading it correctly. I'm not sure exactly why numpy is performing better for the larger matrices, but I suspect that numpy's accumulate function that np.vander uses may be taking advantage of simd, sse or mkl

Re: [julia-users] Logical indexing with .≤ A bug?

2015-01-08 Thread Steven G. Johnson
Currently, there are no dot versions of the unicode operators. This is a future possibility that I mentioned in: https://github.com/JuliaLang/julia/pull/6929#issuecomment-44099346 but it is not currently implemented.

Re: [julia-users] computing speed of log

2015-02-18 Thread Steven G. Johnson
On Wednesday, February 18, 2015 at 9:40:48 PM UTC-5, Kuba Roth wrote: Interstingly Julia's example using Integer in mod operation is slower: a+=exp(a%2); elapsed time: 0.049916461 seconds (304116 bytes allocated) div/rem/mod are currently slower in Julia than C++ because Julia performs

Re: [julia-users] Re: Informal Call for a Julia π - day challenge

2015-03-09 Thread Steven G. Johnson
If we're doing a 31 ways to to compute pi, I would suggest that most of them should be more aimed at fun than trying to compute a huge number of digits. Like Monte Carlo integration of the area of a unit circle, or summing a slowly converging series, using quadgk(x - 1/(1+x^2), 0,1)[1]*4, or

Re: [julia-users] Re: Informal Call for a Julia π - day challenge

2015-03-09 Thread Steven G. Johnson
On Monday, March 9, 2015 at 11:24:06 AM UTC-4, Hans W Borchers wrote: @Steven Do you think it was no fun to implement the droplet/spigot algorithm? Then you may be completely wrong. I'm sure it was fun. The point I meant to make was that fun is not restricted to efficient algorithms,

[julia-users] Re: Could it be a bug of PyCall or PyPlot?

2015-03-09 Thread Steven G. Johnson
On Monday, March 9, 2015 at 2:31:58 PM UTC-4, Jerry Xiong wrote: When I ran below codes: using PyCall @pyimport pylab as plb cmap1=plb.get_cmap(jet) pycall(cmap1,PyAny,0.5) Every thing goes fine, output result (0.4901960784313725,1.0,0.4775458570524984,1.0) However, after I loaded

[julia-users] Re: Could it be a bug of PyCall or PyPlot?

2015-03-09 Thread Steven G. Johnson
On Monday, March 9, 2015 at 5:18:52 PM UTC-4, Steven G. Johnson wrote: Yes, I should probably define a pycall method for ColorMap. For now, you can do pycall(cmap2.o, PyAny, 0.5). Just fixed it in PyCall (master branch on github).

[julia-users] Re: Could it be a bug of PyCall or PyPlot?

2015-03-09 Thread Steven G. Johnson
On Monday, March 9, 2015 at 5:24:22 PM UTC-4, Steven G. Johnson wrote: On Monday, March 9, 2015 at 5:18:52 PM UTC-4, Steven G. Johnson wrote: Yes, I should probably define a pycall method for ColorMap. For now, you can do pycall(cmap2.o, PyAny, 0.5). Just fixed it in PyCall (master

[julia-users] Re: Sparse matrix with diagonal index

2015-03-12 Thread Steven G. Johnson
On Tuesday, March 10, 2015 at 2:40:24 PM UTC-4, Amit Jamadagni wrote: Thank you very much for the response. But the behavior of the same in scipy is different i.e., it omits the elements. Is this not the expected behavior ?? Why would you expect the function to silently ignore some of

[julia-users] difficulty disabling multicore BLAS?

2015-03-06 Thread Steven G. Johnson
For my numerics class at MIT http://math.mit.edu/~stevenj/18.335/, I used the following notebook to talk about cache effects and matrix multiplication: http://nbviewer.ipython.org/url/math.mit.edu/~stevenj/18.335/Matrix-multiplication-experiments.ipynb It includes some code to benchmark

Re: [julia-users] Re: using Gadfly and PyPlot at the same time

2015-03-06 Thread Steven G. Johnson
On Friday, March 6, 2015 at 9:42:34 AM UTC-5, Andrei Berceanu wrote: ok so now im doing import PyPlot, but have some problems with the latex axis labels you could try using LaTeXStrings to pull in the L_str macro separately from PyPlot. (I'm not sure if there is any nice syntax

Re: [julia-users] Re: L1 Minimization?

2015-03-06 Thread Steven G. Johnson
On Thursday, March 5, 2015 at 4:58:10 PM UTC-5, Sheehan Olver wrote: Hmm, maybe I’m posing the wrong problem then… I wanted a fast way to calculate the null space of a sparse matrix, where the basis spanning the null space is also sparse. And the dimension of the vector space is in the

[julia-users] Re: L1 Minimization?

2015-03-06 Thread Steven G. Johnson
On Thursday, March 5, 2015 at 12:51:07 PM UTC-5, Iain Dunning wrote: I don't think anything in JuliaOpt other than NLOpt is going to play nicely with that non-convex L2 norm constraint. Actually, I would tend to transform the problem to eliminate the equality constraint: min |Lx|_1 /

Re: [julia-users] difficulty disabling multicore BLAS?

2015-03-08 Thread Steven G. Johnson
I seem to recall having similar problems last year too, so it may be an openblas thing.

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Steven G. Johnson
As a general rule, with Julia one needs to unlearn the instinct (from Matlab or Python) that efficiency == clever use of library functions, which turns all optimization questions into is there a built-in function for X (and if the answer is no you are out of luck). Loops are fast, and you

Re: [julia-users] Swapping two columns (or rows) of an array efficiently

2015-03-12 Thread Steven G. Johnson
On Thursday, March 12, 2015 at 10:08:47 AM UTC-4, Ján Dolinský wrote: Hi, Is this an efficient way to swap two columns of a matrix ? e.g. 1st column with the 5th X = rand(10,5) X[:,1], X[:,5] = X[:,5], X[:,1] It is not optimal, because it allocates temporary arrays. Instead, you can

Re: [julia-users] Re: Time type

2015-03-13 Thread Steven G. Johnson
On Friday, March 13, 2015 at 12:28:50 PM UTC-4, Stefan Karpinski wrote: Yes, but the representation is quite inefficient. This would be an efficient scalar type. Couldn't you just represent it by Dates.Second (if you want second resolution) or Dates.Millisecond (if you want millisecond

[julia-users] Re: Factorization of big integers is taking too long

2015-03-13 Thread Steven G. Johnson
On Friday, March 13, 2015 at 1:25:14 PM UTC-4, Jake Bolewski wrote: This is falling back to factor() for generic integers, so the GMP method does not looked to be wrapped. The generic version will be terribly slow for bigints. Would be easy to add if you would like to submit a Pull

[julia-users] Re: Sparse matrix with diagonal index

2015-03-10 Thread Steven G. Johnson
But when I give in julia spdiagm(x, 1, length(x), length(x)) ERROR: BoundsError in sparse at sparse/csparse.jl:50 in spdiagm at sparse/sparsematrix.jl:2133 in spdiagm at sparse/sparsematrix.jl:2141 I get the above error. Any leads on this would be great. Thanks. You need to use

[julia-users] Re: how to paste png into ipython julia notebook?

2015-03-13 Thread Steven G. Johnson
See also the discussion at: https://github.com/ipython/ipython/issues/4111

[julia-users] Re: Time type

2015-03-13 Thread Steven G. Johnson
On Friday, March 13, 2015 at 9:06:28 AM UTC-4, David Anthoff wrote: is there a Time datatype, analogous to the Date type? I ran into a situation where I need to represent times (like 12:34 pm) that don’t have a date associated. I understand that in the case of dates that don’t have a

[julia-users] Re: how to paste png into ipython julia notebook?

2015-03-13 Thread Steven G. Johnson
On Friday, March 13, 2015 at 11:44:57 AM UTC-4, Randy Zwitch wrote: You can also use plain HTML in a markdown cell. Yes, you can use img ... tags, but then the image data is not included in the notebook file itself, so unless the image is on a server somewhere that makes it more annoying

[julia-users] Re: Function roots() in package Polynomial

2015-03-12 Thread Steven G. Johnson
Just a quick follow-up on this thread: for my numerics class at MIT http://math.mit.edu/~stevenj/18.335/, I put together a little Julia notebook on the Wilkinson polynomial, along with a little tutorial on how to define a basic polynomial type (although pointing to Polynomials.jl for a more

[julia-users] Re: debugging Kernel died in IJulia

2015-03-28 Thread Steven G. Johnson
Note that when you update Julia you need to re-run Pkg.build(IJulia) to tell IPython about the new Julia location.

[julia-users] Re: Advice on vectorizing functions

2015-03-28 Thread Steven G. Johnson
In general, you need to unlearn the intuition from Matlab/Python that vectorized/built-in functions are fast, and functions or loops you write yourself are slow. There's not the same drive to vectorize everything in Julia because not only are your own loops fast, but writing your own loops

[julia-users] Re: default value for slider in Interact.js

2015-03-28 Thread Steven G. Johnson
Just use e.g. slider(1:10, value=2) On Friday, March 27, 2015 at 12:31:45 PM UTC-4, Andrei Berceanu wrote: Is there any way of setting a default value for a slider object, different from the middle of the slider interval (which is automatically chosen)?

[julia-users] Re: Force variable declaration

2015-02-27 Thread Steven G. Johnson
As I understand it, you are asking whether there is a Julia option (e.g. a runtime flag) that will cause Julia to throw an error if you try to parse code where local variables are not explicitly declared, analogous to use strict in Perl or implicit none in Fortran.There is no such thing in

[julia-users] Re: Repmat speed

2015-02-27 Thread Steven G. Johnson
On Friday, February 27, 2015 at 9:11:10 AM UTC-5, antony schutz wrote: I have a question about the best way to implement a grid similar to a mesh grid: Note that you normally don't need mesh-grid like things, because you can use broadcasting operations instead. e.g. in order to compute

Re: [julia-users] Re: Functions in degrees

2015-03-03 Thread Steven G. Johnson
On Tuesday, March 3, 2015 at 2:52:06 PM UTC-5, Stefan Karpinski wrote: Then again, using type wrappers for this – bare numbers are Radians while an immutable Degree wrapper could wrap values in degrees – would eliminate a large class of common programming errors when working with angles.

Re: [julia-users] Re: Functions in degrees

2015-03-03 Thread Steven G. Johnson
On Monday, March 2, 2015 at 7:57:10 PM UTC-5, MA Laforge wrote: The real question is how much programming overhead is required to use these types (assuming the compiler does the grunt work reducing the *performance* overhead) No, the real question is whether the benefit of using special

[julia-users] Re: Equivalent of MATLAB's nargout in Julia

2015-03-04 Thread Steven G. Johnson
On Wednesday, March 4, 2015 at 11:48:28 AM UTC-5, Pooya wrote: I have a function with two outputs. The second one is computationally expensive, so I want to avoid the computation unless the user needs it. I read on another post in the group that the solution in this case is usually to

[julia-users] Re: PyPlot figures

2015-03-04 Thread Steven G. Johnson
Maybe use a non-interactive backend? Does it do what you want if you use Python?

[julia-users] Re: How to satisfy this deprecation warning?

2015-03-04 Thread Steven G. Johnson
You can also use fill, e.g.: fill(convert(Ptr{Uint8},0), 2)

[julia-users] Re: L1 Minimization?

2015-03-05 Thread Steven G. Johnson
On Thursday, March 5, 2015 at 4:52:54 AM UTC-5, Sheehan Olver wrote: Are there any packages that can do L1 minimization? I want to do something like min ||Lx||_1 subject to ||x||_2=1 You can always transform the L1 objective into 2N affine inequality constraints, in which case there

[julia-users] Re: Equivalent of MATLAB's nargout in Julia

2015-03-05 Thread Steven G. Johnson
On Wednesday, March 4, 2015 at 6:38:28 PM UTC-5, Pooya wrote: Thanks for your response. I am not sure what you mean by a lower-level subroutine. Is that a function inside another one? If yes, How does the scope of variables work for that? From your description, right now you have:

[julia-users] Re: Exponential function approximation

2015-03-05 Thread Steven G. Johnson
On Thursday, March 5, 2015 at 1:16:19 AM UTC-5, Dejan Miljkovic wrote: Thanks, Using reinterpret julia version is function exp_approx(val::Float64) return reinterpret(Float64, int(1512775 * val + 1072632447)32) end You probably want int64, not int, so that it doesn't break on

[julia-users] Re: PyPlot figures

2015-03-05 Thread Steven G. Johnson
On Wednesday, March 4, 2015 at 2:40:42 PM UTC-5, Josh Langsfeld wrote: Ok, I got it working by doing pygui(:qt) or pygui(:gtk) before the 'using PyPlot' call and mentioned in your docs. I'm not totally clear what 'non-interactive' means for the backend. Non-interactive backends are ones

Re: [julia-users] Re: Functions in degrees

2015-03-01 Thread Steven G. Johnson
The errors in sin and cos can be much larger than 1ulp for sin or cos of large phase angles ( 360) in degrees, because pi is not exactly representable in fp while 180 is.

[julia-users] Override ' but not ctranspose?

2015-03-01 Thread Steven G. Johnson
No. f' - ctranspose(f) occurs in the parse stage, I believe.

[julia-users] Re: Tensor-product function for multidimensional arrays (2 dims)

2015-02-23 Thread Steven G. Johnson
On Sunday, February 22, 2015 at 3:32:34 AM UTC-5, Viral Shah wrote: Best to file an issue. See https://github.com/JuliaLang/julia/issues/3250

Re: [julia-users] Re: Suppress printed output from PyPlot

2015-02-23 Thread Steven G. Johnson
On Monday, February 23, 2015 at 6:52:25 AM UTC-5, gdmsl wrote: thank you for the tips but the second method return an error: Oh, right, withfig currently only works with IJulia (which has a display queue and an undisplay function to remove things from the queue).It won't work with the

Re: [julia-users] Re: Large memory allocation and GC time in fractal renderer

2015-02-23 Thread Steven G. Johnson
On Sunday, February 22, 2015 at 10:06:44 AM UTC-5, DumpsterDoofus wrote: Nope, I was just manually typing them in, but thanks for pointing that out. I tried it by calling `import Base.Math.@horner` and then implemented it like this: f = @horner(x, a0, a1, a2, a3, a4) fP = @horner(x, a1,

[julia-users] Re: Readcsv problem

2015-02-25 Thread Steven G. Johnson
On Wednesday, February 25, 2015 at 12:37:35 PM UTC-5, Brandon Booth wrote: I'm trying to read a csv file from a thumb drive using IJulia and keep getting an error. My code reads: params = readcsv(/media/brandon/ED2F-0842/Parameters.csv,',') You don't pass the delimiter to readcsv, you

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

2015-02-24 Thread Steven G. Johnson
On Tuesday, February 24, 2015 at 8:25:30 AM UTC-5, Bill Hart wrote: So long as your shared library has no other dependencies, you can set Julia's DL_LOAD_PATH to specify the location of the shared library (I'm not sure if this is considered best practice or not) Best practice (in a

[julia-users] Re: Trying to access a pointee extracted with pointer_to_array() kills julia instantaniously

2015-02-21 Thread Steven G. Johnson
Make sure GMT.GMT_RESOURCE is declared as an immutable type if you want Array{GMT.GMT_RESOURCE} to correspond to the memory layout of an array of C structs.

Re: [julia-users] Re: Standard File Dialogs

2015-02-24 Thread Steven G. Johnson
Yes, something like the EasyDialogs http://pymotw.com/2/EasyDialogs/ Python package would be great.

Re: [julia-users] Re: Standard File Dialogs

2015-02-24 Thread Steven G. Johnson
On Tuesday, February 24, 2015 at 10:16:25 PM UTC-5, Steven G. Johnson wrote: Yes, something like the EasyDialogs http://pymotw.com/2/EasyDialogs/ Python package would be great. (EasyDialogs doesn't work anymore and was never cross-platform, but that sort of interface seems useful.)

[julia-users] Re: debugging Kernel died in IJulia

2015-03-26 Thread Steven G. Johnson
See the debugging IJulia section of the IJulia README On Thursday, March 26, 2015 at 11:38:34 AM UTC-4, Andrei Berceanu wrote: I seem to be getting this message, with no other error, quite often when evaluating my notebook. What is the recommended way of debugging such a thing? Since no

Re: [julia-users] Re: How to convert character to numeric

2015-01-23 Thread Steven G. Johnson
On Friday, January 23, 2015 at 10:39:42 AM UTC-5, J Luis wrote: Than the confusion is even bigger (not intentional for sure) julia parsefloat(a[2]) ERROR: `parsefloat` has no method matching parsefloat(::Char) julia parseint(a[2]) 2 We could certainly add a parsefloat(c::Char) =

Re: [julia-users] readdir returns inconsistent types

2015-01-13 Thread Steven G. Johnson
Thanks for the clarification regarding the Unix situation. On Tuesday, January 13, 2015 at 4:31:51 PM UTC-5, Milan Bouchet-Valat wrote: So the best solution for Julia is to return it as a UTF8String, knowing that in some cases invalid UTF-8 may appear. (This is what Julia does now, it

[julia-users] Re: what do you do with strings in julia

2015-01-13 Thread Steven G. Johnson
Though we could define such a conversion method with: convert{T:AbstractString}(::Type{SubString{T}}, s::AbstractString) = let s′ = T(s); SubString(s′, 1, endof(s′)); end Evan, what is your application here? What are you trying to do?

Re: [julia-users] readdir returns inconsistent types

2015-01-13 Thread Steven G. Johnson
On Tuesday, January 13, 2015 at 1:47:12 AM UTC-5, ele...@gmail.com wrote: But since those annoying operating systems can return filenames encoded in non-UTF8 it probably will not be safe in 0.4 to just return a UTF8 string. Whatever encoding the operating system uses, Julia (or actually

[julia-users] Re: what do you do with strings in julia

2015-01-13 Thread Steven G. Johnson
On Tuesday, January 13, 2015 at 4:10:54 PM UTC-5, Evan Pu wrote: Steven, The error is actually an issue with LightTable's Juno plugin and actually has nothing to do with Julia. Can you file an issue at: https://github.com/one-more-minute/Jewel.jl explaining how the error arose?

[julia-users] Re: What is the most usual way to save a Matrix with 3 or more dimensions in Julia?

2015-04-01 Thread Steven G. Johnson
I tend to see NetCDF as a legacy format and would recommend HDF5 anyway...

Re: [julia-users] savefig error

2015-04-03 Thread Steven G. Johnson
On Thursday, April 2, 2015 at 1:35:34 PM UTC-4, Diego Tapias wrote: Ok, thank you! Sorry for my grammar, I often type very fast and don't check it. I see your point but it's confusing for me that the same syntax worked a few days ago. Do you know if this is a new feature of matplotlib?

[julia-users] Re: PyPlot : one plot after the other and not simultaneously

2015-04-25 Thread Steven G. Johnson
On Saturday, April 25, 2015 at 11:21:24 AM UTC-4, Ferran Mazzanti wrote: I'm new to Julia (but not to Python) and can't find he right way to use PyPlot as I do in Python. In short, I have a program that should display a plot, wait for the user to close the plot, then show a second plot and

[julia-users] Re: PyPlot : one plot after the other and not simultaneously

2015-04-26 Thread Steven G. Johnson
Note that you only need the PyPlot. prefix if you do import PyPlot -- with using PyPlot, symbols like ioff and plot are imported into your namespace.

Re: [julia-users] type-stable way to get primary type

2015-04-22 Thread Steven G. Johnson
As Tim says, you just want similar(a, eltype(b), 5) On Wednesday, April 22, 2015 at 6:22:49 AM UTC-4, Mauro wrote: A generated function works: (I'm starting to be very suspicious of every time someone suggests using a generated/staged function. It's too easy to turn this into a crutch; it's

[julia-users] Re: Is there a plotting package that works for a current 0.4 build?

2015-04-25 Thread Steven G. Johnson
PyPlot was updated for the tupocolypse; I don't know if it has broken again in the last day or two, though, but it should be easy to fix up again.

[julia-users] Re: Qwt plotting

2015-04-25 Thread Steven G. Johnson
What is the advantage of this over Matplotlib?

[julia-users] Re: unique function Matlab-Julia

2015-04-22 Thread Steven G. Johnson
On Tuesday, April 21, 2015 at 5:16:12 AM UTC-4, Stephan Buchert wrote: In Matlab I can do, for example, with daynum fractional day numbers: idaynum = floor(daynum); [umjd, im, iu] = unique(idaynum); % = how do I get the iu in Julia? This is not implemented yet; see:

[julia-users] Re: configuring style of PyPlot

2015-04-28 Thread Steven G. Johnson
Yes, in general you can do anything from PyPlot that you can do from Matplotlib, because PyPlot is just a thin wrapper around Matplotlib using PyCall, and PyCall lets you call arbitrary Python code. The pyplot.style module is not currently exported by PyCall, you can access it via plt.style:

[julia-users] [ANN] DecFP.jl - decimal floating-point math

2015-04-28 Thread Steven G. Johnson
The DecFP package https://github.com/stevengj/DecFP.jl provides 32-bit, 64-bit, and 128-bit binary-encoded decimal floating-point types following the IEEE 754-2008, implemented as a wrapper around the (BSD-licensed) Intel Decimal Floating-Point Math Library

[julia-users] Re: abs inside vector norm

2015-04-28 Thread Steven G. Johnson
See https://github.com/JuliaLang/julia/pull/11043

<    1   2   3   4   5   6   7   8   9   10   >