[julia-users] Re: Help with pipes

2016-03-12 Thread elextr
Can't test ATM, but argument one IOBuffer(ps_string) ? On Sunday, 13 March 2016 09:52:52 UTC+10, J Luis wrote: > > Hi, > > I need to reproduce a similar behavior of this on command line. > > cat barco.eps | gswin64c -q -dSAFER -dNOPAUSE -dBATCH -sDEVICE=bbox - > %%BoundingBox: 0 0 71 64 >

Re: [julia-users] Meshgrid function

2016-03-08 Thread elextr
Neat. Wherever it goes it needs a pointer from http://docs.julialang.org/en/latest/manual/noteworthy-differences/#noteworthy-differences-from-matlab but its a bit long to actually go there. On Tuesday, 8 March 2016 17:00:53 UTC+10, Tomas Lycken wrote: > > The thing with meshgrid, is that

Re: [julia-users] Re: csv file reading header=TRUE default

2016-02-27 Thread elextr
Indeed, but its in the dataframes package documentation, its all about "readtables", and nowhere in dataframes documentation is "readcsv" mentioned. On Sunday, February 28, 2016 at 3:58:15 PM UTC+10, ivo welch wrote: > > > I see. thank you. it was a little confusing. it was right under the

Re: [julia-users] Weird Hygiene Issue

2016-02-15 Thread elextr
I don't think that the `using X` inside module Y here re-runs the eval, there is only one instance of modules, it doesn't create a new instance inside module Y. So your replacement of X._ex_func() at top level still holds. On Tuesday, February 16, 2016 at 5:36:15 AM UTC+10, Julia Tylors

[julia-users] Re: leaky if semantics

2016-02-08 Thread elextr
The x is not kept between iterations of the for see http://docs.julialang.org/en/release-0.4/manual/variables-and-scoping/#for-loops-and-comprehensions On Monday, February 8, 2016 at 9:41:40 PM UTC+10, David van Leeuwen wrote: > > Hello, > > According to >

Re: [julia-users] Re: how to undefine variable in composite types

2016-02-04 Thread elextr
On Friday, February 5, 2016 at 1:47:51 PM UTC+10, Tony Fong wrote: > > If you design a software that requires runtime redefinition of a type, you > should seriously reconsider that decision. True, but it could be useful for experimentation on the REPL, but as Stefan says the implementation

[julia-users] Re: Requests.jl with HTTP Basic Authentication

2016-01-26 Thread elextr
On Tuesday, January 26, 2016 at 11:07:37 PM UTC+10, Josef Sachs wrote: > > Is there a way to use Requests.jl with HTTP Basic Authentication > when the password contains a slash? > > julia> using Requests > > julia> get("https://user:pass/wo...@google.com ") > Doesn't it need an @ after the

[julia-users] Re: Why was pipeline symbol deprecated?

2016-01-17 Thread elextr
On Monday, January 18, 2016 at 2:20:41 PM UTC+10, Wilton Basse wrote: > > > > On Sunday, January 17, 2016 at 8:16:11 PM UTC-6, Wilton Basse wrote: >> >> Why was the pipeline symbol |> changed to pipeline() ? Not objecting, >> just trying to learn. Thanks! >> > > The reason I ask is, > >

[julia-users] Re: signal handling

2016-01-14 Thread elextr
Can't you just ccall the OS functions? On Thursday, January 14, 2016 at 8:37:48 PM UTC+10, John Travers wrote: > > No, I'm looking for operating system signal handling, like SIGINT etc. > Something like the python `signal` module. > > On Thursday, January 14, 2016 at 11:25:13 AM UTC+1, Eric

Re: [julia-users] Re: signal handling

2016-01-14 Thread elextr
Indeed, but the point is that the mechanism extends beyond just the signal functions. Maybe a package Signal_safe_operations. On Friday, January 15, 2016 at 8:49:13 AM UTC+10, Stefan Karpinski wrote: > > The fact that it's hard is all the more reason to provide a mechanism that > does it

Re: [julia-users] Re: signal handling

2016-01-14 Thread elextr
Would need to look to see if notify() only uses things that are allowed in a signal handler, then it could be a good way to do it. [Note: I suspect notify() causes stack manipulations and those are not allowed in the signal handler, but I am not able to check right now] On Friday, January 15,

Re: [julia-users] Re: signal handling

2016-01-14 Thread elextr
You are probably going to have to use ccall anyway to do things like save state. Only a limited set of system calls are available to signal handlers, see http://man7.org/linux/man-pages/man7/signal.7.html, and you can't rely on normal Julia IO to only use the allowed ones. Same for anything

Re: [julia-users] Re: signal handling

2016-01-14 Thread elextr
Update libuv already has signal handling, giving a callback in normal context. So it "just" needs some Julia interfacing. On Friday, January 15, 2016 at 11:26:45 AM UTC+10, ele...@gmail.com wrote: > > Would need to look to see if notify() only uses things that are allowed in > a signal

Re: [julia-users] Re: signal handling

2016-01-14 Thread elextr
The Python signal handling actually waits until between Python interpretor instructions to dispatch the user python signal handler, it isn't actually running in signal handler context and so the restrictions are no longer relevant. But as it says, that can be an arbitrary delay. Julia could

[julia-users] Re: Variable scope in a function

2016-01-12 Thread elextr
IIUC isdefined(:awards) tests for a global variable called awards, so it won't find a local variable called awards. What are you trying to achieve with this test? On Wednesday, January 13, 2016 at 12:48:50 PM UTC+10, Brandon Booth wrote: > > So this is the full function. Note lines 4 and 5 -

[julia-users] Re: How to resolve "WARNING: both Compose and PyPlot export "draw"; uses of it in module Main must be qualified"?

2016-01-09 Thread elextr
On Sunday, January 10, 2016 at 5:43:30 PM UTC+10, ele...@gmail.com wrote: > > > > On Sunday, January 10, 2016 at 3:19:55 PM UTC+10, EvanB wrote: >> >> I detail the problem here: >> >> https://github.com/dpsanders/scipy_2014_julia/issues/5 >> >> It appears that two exports are clashing. How does

[julia-users] Re: How to resolve "WARNING: both Compose and PyPlot export "draw"; uses of it in module Main must be qualified"?

2016-01-09 Thread elextr
On Sunday, January 10, 2016 at 3:19:55 PM UTC+10, EvanB wrote: > > I detail the problem here: > > https://github.com/dpsanders/scipy_2014_julia/issues/5 > > It appears that two exports are clashing. How does one resolve this? > > Any more explanatory details are be appreciated. Thank you > As

Re: [julia-users] One click execution of Julia program

2016-01-06 Thread elextr
Works for me. Note that when you run by clicking there is nowhere for the output of the `println` to show, and standard input will be closed so the `readline` returns EOF immediately, so it might look like it didn't run. My system offers an option to "run in terminal" when I double click which

[julia-users] Re: Why does this code never return?

2016-01-03 Thread elextr
Reload reloads the *package* not the module, see http://docs.julialang.org/en/release-0.4/stdlib/base/#Base.reload. On Sunday, January 3, 2016 at 5:16:07 PM UTC+10, Greg Plowman wrote: > > This seemed a little non-obvious to me as well. > > I guess the take-away is that "loading" a module (via

[julia-users] Re: redirect error output from julia repl to text file ?

2015-12-21 Thread elextr
Example from the manual: - run(pipeline(`dothings`, stdout="out.txt", stderr="errs.txt")) Cheers Lex On Tuesday, 22 December 2015 06:41:34 UTC+10, jda wrote: > > I tried the command > > path = pathtoscript.jl; > output = pathtologfile.txt; > run(pipeline(` julia $path` ,output)) > > but it

Re: [julia-users] Why is the order of these loops barely affects the time?

2015-12-21 Thread elextr
N is a mutable global, that means that any piece of code anywhere can change it, so every use has to test its type, which takes time. Making it const means it can't change, so its type can't change. Cheers Lex On Tuesday, 22 December 2015 09:35:30 UTC+10, Joaquim Masset Lacombe Dias Garcia

[julia-users] Re: Why can't julia make the most of the system resource?

2015-12-19 Thread elextr
> > As can be seen, all the 8 cores of my pc is being used by the julia > program, however, only 35% of the system resource is covered. My julia code > mainly does the fft operates in a loop. I use fftw.set_num_threads(8) > outside the loop. In my opinion, the top command should exhibit

[julia-users] Re: advent of code -- day 3

2015-12-16 Thread elextr
On Thursday, December 17, 2015 at 4:07:37 AM UTC+10, Josh Langsfeld wrote: > > Using mutables in a Set or as keys in a Dict is not necessarily bad; it's > changing them after they've been inserted that causes the chaos. Your 1785 > "distinct" elements are all references to a single array

[julia-users] Re: advent of code -- day 3

2015-12-14 Thread elextr
I think your problem is that Sets cannot contain duplicate entries, so if Santa ever passes the same point twice it won't be added. Cheers Lex On Tuesday, December 15, 2015 at 4:23:19 PM UTC+10, Jan Strube wrote: > > I'm trying to learn a bit more Julia by solving the puzzles over on >

[julia-users] Re: Unintuitive difference between vectorised code and simple loop

2015-12-10 Thread elextr
Looks right to me. In the first version `a = a + 1` makes `a` refer to a *new* array with values one greater and `push!(astore,a)` stores the reference to the new array in `astore`. In the second version you modify the values of the array already referred to by `a` and then push a reference

[julia-users] Re: Meaty example of using singleton types

2015-12-09 Thread elextr
On Wednesday, December 9, 2015 at 10:01:25 PM UTC+10, milktrader wrote: > > Trying to wrap my mind around singleton types to see if they might be > useful for something I'm working on, but running into some confusion. Here > is an example that I started working with: > > julia> type BadInt >

[julia-users] Re: optimization levels in julia?

2015-12-07 Thread elextr
You are making the assumption that `sin(.34567)` is a constant, but in Julia technically sin is dependent on global state, specifically the rounding and denormalisation modes http://docs.julialang.org/en/release-0.4/stdlib/numbers/?highlight=rounding#Base.set_rounding. It these change during

[julia-users] Re: optimization levels in julia?

2015-12-06 Thread elextr
On Monday, December 7, 2015 at 1:11:05 PM UTC+10, Meik Hellmund wrote: > > Hi, > > It seems that julia does not "optimize away" constant expressions in > functions: > > julia> f(x)=x+2-2 > f (generic function with 1 method) > > julia> f(1.e-18) > 0.0 > > This is of course correct in Float64

[julia-users] Re: Libz with an unknown file

2015-12-06 Thread elextr
On Monday, December 7, 2015 at 11:16:07 AM UTC+10, Seth wrote: > > Hi, > > I'm moving from Gzip.jl to Libz.jl, and am running into a problem. Gzip > used to allow a file to be opened using its methods even if the file was > not encrypted. Libz doesn't allow that. > > The problem I'm having is

[julia-users] Re: optimization levels in julia?

2015-12-06 Thread elextr
Also if, inside the function, you keep the type of `y` stable by y=0.0 Julia will optimise away the second loop entirely, and do no allocations for the first loop. On Monday, December 7, 2015 at 1:42:34 PM UTC+10, ele...@gmail.com wrote: > > > > On Monday, December 7, 2015 at 1:11:05 PM UTC+10,

[julia-users] Re: is it possible for collect() to return a collection of a specific type?

2015-11-27 Thread elextr
Collect only requires that the collection is iterable, for which providing an eltype() function is optional. I don't know if it is possible to check at runtime if eltype() exists for the collection then it could use that instead of Any, otherwise it would have to iterate the collection to find

[julia-users] Re: Result changes if I change the number of workers

2015-11-26 Thread elextr
Do any of your calculations depend on the values of A? If so they will get different values depending in what order A[i] is updated. And the order depends on scheduling of the processes, which is not deterministic. Cheers Lex On Friday, November 27, 2015 at 8:44:42 AM UTC+10, Eduardo Lenz

Re: [julia-users] Julia Install in Heterogenous Linux Environment: Target architecture mismatch

2015-11-23 Thread elextr
To obtain best performance Julia uses all resources it knows how to use and that are available on the machine it compiles to. To run on different machines the architecture of both has to have the same resources. So you either have to compile to the lowest common denominator of the

[julia-users] Re: split a utf-8 string

2015-11-21 Thread elextr
On Sunday, November 22, 2015 at 10:02:03 AM UTC+10, James Gilbert wrote: > > The spaces in your string are '\u3000' the ideographic space. > isspace('\u3000') returns true, and split(s) is supposed to split on all > space characters, so I think this might be a julia bug. > Or a documentation

Re: [julia-users] Re: indexing with non Integer Reals is deprecated

2015-11-17 Thread elextr
On Tuesday, November 17, 2015 at 10:34:03 PM UTC+10, Mauro wrote: > > Julia tries, and I think succeeds, in solving the two language problem. > The two language problem being that one uses one language for most > things but drops down to a fast language for bottlenecks and/or one > language

[julia-users] Re: Inconsistent behaviour of round()

2015-10-27 Thread elextr
"round to nearest, ties to even" is the default IEEE floating point rounding mode https://en.wikipedia.org/wiki/IEEE_floating_point#Rounding_rules Cheers Lex On Wednesday, October 28, 2015 at 11:02:58 AM UTC+10, jock@gmail.com wrote: > > Hi there, > > I'm using Julia 0.4.0. > > round(4.5)

[julia-users] Re: Is there a direct way to get binary representation of a float?

2015-10-18 Thread elextr
On Sunday, October 18, 2015 at 3:42:57 PM UTC+10, Uliano Guerrini wrote: > > Thanks to the pointers given I dug a little bit under the hood ad found > the promising unbox intrinsic function. It would exactly be what I was > looking for but it seems to work only one way: > > *julia> **using

Re: [julia-users] Re: Naming convention

2015-10-09 Thread elextr
Indeed I was going to post on behalf of my colleagues for whom English is not a first language, and whose native language assigns *almost everything* a gender, but Scott said it well. To summarise, when translating from a language where everything has a gender it is common for he/she to remain

Re: [julia-users] Nicer syntax collect(linspace(0,1,n))?

2015-09-29 Thread elextr
On Wednesday, September 30, 2015 at 11:37:44 AM UTC+10, Luke Stagner wrote: > > A range should act (for the most part) exactly like an array. For example > indexing into a range is identical (syntax-wise) to indexing an array. What > I am concerned about is performance. For instance if I had a

[julia-users] Re: Documentation of operators

2015-09-23 Thread elextr
On Thursday, September 24, 2015 at 9:37:01 AM UTC+10, Alex Copeland wrote: > > For example, I find this on line 518 of base/sort.jl > (/usr/local/Cellar/julia/HEAD/share/julia/base/sort.jl on homebrew julia) > > 5 ## fast clever sorting for floats ## > 516 > 517 module Float > 518 using ..Sort

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] 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] Where do they come from: jl_uv_writecb() ERROR: bad file descriptor EBADF

2015-09-17 Thread elextr
The error is caused by writing to STDOUT in a finalizer after STDOUT itself has been closed. The comment refers to removing a deprecation warning in the finalizer (the warning of course writes to STDOUT). So either you still have that problem or one of your own finalizers writes to STDOUT.

Re: [julia-users] Re: IDE for Julia

2015-09-16 Thread elextr
Just FYI, Geany an IDE based on Scintilla has a plugin (overview) that provides a minimap capability, there is no need to add the capability to Scintilla itself. Cheers Lex On Thursday, September 17, 2015 at 10:21:31 AM UTC+10, Daniel Carrera wrote: > > Hi everyone, > > I just deleted my

[julia-users] Re: Finding the index of a type member

2015-09-09 Thread elextr
>From >http://docs.julialang.org/en/latest/manual/arrays/#vectorized-operators-and-functions > " Note that comparisons such as == operate on whole arrays, giving a single boolean answer. Use dot operators for elementwise comparisons." On Thursday, September 10, 2015 at 11:36:15 AM UTC+10, J

[julia-users] Re: abs() returning negative numbers??

2015-09-05 Thread elextr
Subtlty of C, literal integer constants are signed, so s is converted to signed before the % and so the whole abs is signed. On Sunday, September 6, 2015 at 1:23:46 PM UTC+10, Corey Moncure wrote: > > I see... It's actually a Uint, not a Uint8 that is passed to f(), but the > result is the

Re: [julia-users] Extra '\n' char while creating a string spaning over two lines

2015-08-27 Thread elextr
Literal strings consist of all the characters between the opening and ending quotes. That includes the end of line characters if they occur between the quotes. The \n is the way Julia prints embedded newline characters in strings to make the character visible similar to the way an embedded

Re: [julia-users] throw vs error

2015-08-23 Thread elextr
On Monday, August 24, 2015 at 12:38:10 PM UTC+10, Michele Zaffalon wrote: to replace with something that cannot be caught, but for this one I cannot suggest a use case (maybe writing way past array boundaries when using @inbounds?) Maybe a better example for something that should

[julia-users] Re: Why does enumerate fail in parallel?

2015-08-20 Thread elextr
On Thursday, August 20, 2015 at 4:50:49 AM UTC+10, Ismael VC wrote: Well that works but it's indeed odd, can you open a new issue for this? Not really odd, @parallel needs to divide the set of values between multiple processes, so it needs the whole set of values. El miércoles, 19 de

[julia-users] Re: Why does enumerate fail in parallel?

2015-08-20 Thread elextr
Certainly the error message could be more useful. If it is possible to detect that the argument is an iterator then @parallel could do the collect itself though. On Friday, August 21, 2015 at 6:19:24 AM UTC+10, John Brock wrote: This seems issue-worthy if the most recent nightly have the same

[julia-users] Re: Removing the 'DIVIDES' (U+2223) from the inside of a character string

2015-08-18 Thread elextr
On Wednesday, August 19, 2015 at 1:59:13 PM UTC+10, Lauren Kersey wrote: Hi all. I have a text tool that removes punctuation from the ends of words (split). This seemed to work well enough for cleaning my corpus, but I'm now working with a dataset of texts published from 1600-1700. Back

[julia-users] Re: is the highlight color in docs selectable

2015-07-17 Thread elextr
Is also a poor choice for the ~10% of males with red/green colour deficiency. On Saturday, July 18, 2015 at 7:19:20 AM UTC+10, Jeffrey Sarnoff wrote: Reading docs peppered with red is bit headache inducing for me. Is there support for a less aggressive color?

Re: [julia-users] Printf() of a variable number of arguments

2015-07-14 Thread elextr
You could just use a macro to take the format and the array and let it write the messy loop for you. On Tuesday, July 14, 2015 at 8:39:44 PM UTC+10, Ferran Mazzanti wrote: Yes thanks, I knew already looped solutions :) I was looking for somethin' compact as in the fortran statement above,

Re: [julia-users] readandwrite: how can I read a line as soon as it's written by the process?

2015-06-27 Thread elextr
Is your od program flushing its output? Maybe its stuck in its internal buffers, not in the pipe. On Sunday, June 28, 2015 at 4:34:20 AM UTC+10, Miguel Bazdresch wrote: To answer your question about Gaston first, when I wrote that code nearly 3 years ago, there was no infrastructure in

[julia-users] Re: Julia v0.3.10

2015-06-25 Thread elextr
On Thursday, June 25, 2015 at 1:47:51 PM UTC+10, Tony Kelman wrote: Hello all! The latest bugfix release of the 0.3.x Julia line has been released. Binaries are available from the usual place http://julialang.org/downloads/, Is the ubuntu packages ppa linked from here going to be

[julia-users] Re: Julia v0.3.10

2015-06-25 Thread elextr
On Thursday, June 25, 2015 at 9:11:04 PM UTC+10, Tony Kelman wrote: Yes, I suspect it will, but it may take a week or two for Elliot Saba (@staticfloat) to get to it. I can't imagine any of the backports we've made would present any problems to updating the Ubuntu package in the releases

Re: [julia-users] Re: Julia v0.3.10

2015-06-25 Thread elextr
On Friday, June 26, 2015 at 7:04:48 AM UTC+10, Elliot Saba wrote: Yes, that's my fault. 0.3.10 is making its way through the buildd servers as we speak. -E Thanks for making the PPA, maybe you need some more elves :) Cheers Lex On Thu, Jun 25, 2015 at 4:52 AM, ele...@gmail.com

[julia-users] Re: Create IOStream from string?

2015-06-24 Thread elextr
On Thursday, June 25, 2015 at 12:09:47 PM UTC+10, andrew cooke wrote: Oh, I think they're both subtypes of IO and I probably only need IO methods. On Wednesday, 24 June 2015 22:04:47 UTC-3, andrew cooke wrote: I'm trying to test and document some routines that process files. Is there

Re: [julia-users] Reading from and writing to a process using a pipe

2015-06-17 Thread elextr
On Thursday, June 18, 2015 at 3:05:26 AM UTC+10, Kevin Squire wrote: `open(cmd, w)` gives back a tuple. Try using f, p = open(`gnuplot`,w) write(f, plot sin(x)) There was a bit of discussion when this change was made (I couldn't find it with a quick search),

[julia-users] Re: Method parameters and union types

2015-06-11 Thread elextr
On Friday, June 12, 2015 at 5:15:54 AM UTC+10, David Gold wrote: I want the following function function t_or_void{T}(::Type{Union(T, Void)}) return T end to work like this: julia t_or_void(Union(Int, Void)) Int64 Works like this on Julia 3.8, seems to be a regression? But

Re: [julia-users] Multiple lines statement?

2015-05-31 Thread elextr
On Sunday, May 31, 2015 at 3:13:47 PM UTC+10, Alex Ames wrote: I lost multiple days attempting to pin down this behavior. I had something along the lines of x = a + b + c It's not clear to me why the second line is a valid expression. At the very least, it would be nice for lint to

Re: [julia-users] How to import names that clash?

2015-05-26 Thread elextr
Andrew, The PR (https://github.com/JuliaLang/julia/pull/10951) that gives an error with `using` notes that it cannot change `importall` to work the same way, so `importall` keeps the 0.3 behaviour of hiding previous functions of the same name. I would guess its about as stable as anything at

Re: [julia-users] How to import names that clash?

2015-05-26 Thread elextr
On Tuesday, May 26, 2015 at 8:34:43 PM UTC+10, Tobias Knopp wrote: Furthermore using is not the only way to use a module. There is also the import statement which has no issues with name clashes. I feel that the primary issue seems to be documentation on good workflow. Plus we really

Re: [julia-users] How to import names that clash?

2015-05-26 Thread elextr
But another thing came to my mind: a 'using_without_export' operator that imports a package and builds the module but doesn't do the exports. So i could load/import e.g. two plotting packages both defining 'plot' but have no interference in the current scope a the functions are only

[julia-users] Re: What wrong in read(STDIN,Int) ?

2015-05-23 Thread elextr
`read` reads binary, not text. 939577809079766321 = d0a0d0a0d0a0d31 in hex, notice the last two digits (31) is the ASCII code for '1' 0d is carriage return and 0a is line feed. Those are the binary values of what you typed. you should use text IO to read the line, eg `readline()` and then

[julia-users] Re: unique function lhs

2015-05-22 Thread elextr
On Friday, May 22, 2015 at 5:51:04 PM UTC+10, Stéphane Mottelet wrote: Hello, I wonder why unique has only one output. I need the index of first occurence of each unique row of a matrix, how can I do ? Unique returns an array of all the unique elements, not indexes. Thanks for

Re: [julia-users] Interesting little syntax (not a bug, IMO, just a consequence of the way the parser works)

2015-05-19 Thread elextr
On Wednesday, May 20, 2015 at 10:31:25 AM UTC+10, Yichao Yu wrote: On Tue, May 19, 2015 at 7:26 PM, Scott Jones scott.pa...@gmail.com javascript: wrote: a !=0 # checks if a is not == to 0 a!= 0 # sets a! to 0 a!=0 # checks if a is not == to 0 That's why we should

Re: [julia-users] Re: how to replace , to . in Array{Any,2}:

2015-05-18 Thread elextr
Strings are immutable, so replace can't change the existing string, so it returns a new string, so map returns a new array which you have to assign back to x Cheers Lex On Tuesday, May 19, 2015 at 2:10:18 AM UTC+10, paul analyst wrote: Big thx, but after this code x is no changed Paul W

[julia-users] Re: Defining a function in different modules

2015-05-16 Thread elextr
If Module A has connect(value::Any), and I add a module B with connect(value::TypeB), I don't see a problem with calls to connect with something of TypeB changing the behavior of Module A by not letting it grab *all* calls to connect(). Maybe it's still too early in the morning, but I

[julia-users] Re: Defining a function in different modules

2015-05-16 Thread elextr
On Saturday, May 16, 2015 at 11:30:13 PM UTC+10, Scott Jones wrote: On Saturday, May 16, 2015 at 8:50:12 AM UTC-4, ele...@gmail.com wrote: If Module A has connect(value::Any), and I add a module B with connect(value::TypeB), I don't see a problem with calls to connect with something

[julia-users] Re: how to replace , to . in Array{Any,2}:

2015-05-16 Thread elextr
I don't think replace broadcasts, you have to write a loop applying replace to each string at a time. On Sunday, May 17, 2015 at 4:40:05 AM UTC+10, paul analyst wrote: I have file with decimal separator lika , x=readdlm(x.txt,'\t') julia x=x[2:end,:] 6390x772 Array{Any,2}: some kolumns

[julia-users] Re: metaprogramming : modifying function arguments

2015-05-16 Thread elextr
On Sunday, May 17, 2015 at 9:26:48 AM UTC+10, Eka Palamadai wrote: I am trying to write a function f1 that takes a function f2 and arguments of f2 as parameters, modifies some arguments of f2, and calls f2 with the modified arguments. function f1(f2::Function, args...) #iterate

Re: [julia-users] Re: verbs for immutable collections

2015-05-15 Thread elextr
On Friday, May 15, 2015 at 8:08:51 PM UTC+10, Scott Jones wrote: On Thursday, May 14, 2015 at 3:13:09 PM UTC-4, Toivo Henningsson wrote: I don't think it should be allowed. What if two packages try to add functions with the same name to Base that do completely different things? And

[julia-users] Re: Defining a function in different modules

2015-05-15 Thread elextr
My mistake for continuing to use the term ambiguous. Julia eats ambiguity for breakfast, choosing the most specific method from those defined *for the same function*. The problem is not ambiguity, it is that merging unrelated functions automatically can silently change the behaviour of user

[julia-users] Re: Defining a function in different modules

2015-05-15 Thread elextr
On Saturday, May 16, 2015 at 6:58:18 AM UTC+10, Scott Jones wrote: About functions that actually take the same types (which means they are operating on types they they didn't define themselves), I think the new approach in 0.4 (give a warning and don't merge in the new meaning) is

[julia-users] Re: help with include_string

2015-05-11 Thread elextr
As I understand it include_string() uses eval() to evaluate the string, and eval() operates at module level according to http://docs.julialang.org/en/latest/stdlib/base/?highlight=eval#Base.eval so it won't see a function local variable. On Tuesday, May 12, 2015 at 12:34:13 PM UTC+10, K leo

Re: [julia-users] What is Julia bad for - currently? Practically (or theoretically) - any other language more powerful?

2015-05-10 Thread elextr
There is a very long list of interesting possibilities in this thread, but Julia does have a current target audience which it supports with a set of features that increase their utility. It is going to be tricky for those guiding Julia to ensure that things like more generality don't reduce

Re: [julia-users] Re: ccall and ENV on Windows

2015-05-08 Thread elextr
On Saturday, May 9, 2015 at 1:11:22 AM UTC+10, Simon Byrne wrote: FWIW, the relevant R Docs are here: http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Calling-R_002edll-directly Unfortunately, they're not very helpful, just saying: You may need to ensure that R_HOME/bin

Re: [julia-users] Re: dlopen trouble

2015-05-05 Thread elextr
On Wednesday, May 6, 2015 at 4:59:16 AM UTC+10, Jameson wrote: If I'm reading the error message correctly, when libopencv_videoio was built, it incorrectly specified it's path as a relative location to the current working directory. Accordingly, you need to chdir(/usr/local) to be able

Re: [julia-users] Re: dlopen trouble

2015-05-05 Thread elextr
On Wednesday, May 6, 2015 at 10:13:13 AM UTC+10, Jameson wrote: On Mac, dlopen doesn't do a search, since (unlike linux) the actual install path gets baked into the dylib at compile (link) time:

[julia-users] Re: merge functions from different modules

2015-05-04 Thread elextr
Neat, merging under the control of the user who knows they mean to do so is a great idea. Cheers Lex

Re: [julia-users] Defining a function in different modules

2015-05-02 Thread elextr
On Saturday, May 2, 2015 at 2:47:06 PM UTC+10, MA Laforge wrote: *Need help creating my package!* I am writing a program to perform a Monte-Carlo simulation of a plane's normal vector in Julia. I want to publish my Geometry package for others to use it... because it is awesome! Please

Re: [julia-users] Re: Defining a function in different modules

2015-05-02 Thread elextr
But you had to be explicit, redefining `A._f()`, as I read the Julia consenting adults ethos, if you are open and explicit about it you can play with anybody's private parts, but you are responsible for the results. Such monkey patching is occasionally useful, but it shouldn't be able to

[julia-users] Re: Curious about bytes allocated message

2015-05-01 Thread elextr
On Saturday, May 2, 2015 at 2:45:16 AM UTC+10, cormu...@mac.com wrote: Yes, that makes much more sense! So it's really byte allocations rather than bytes allocated. Thanks. Its bytes allocated not bytes in use. bytes in use = bytes allocated - bytes freed

[julia-users] Re: Equivalent command to get C++ map/upper_bound behaviour?

2015-05-01 Thread elextr
On Saturday, May 2, 2015 at 7:53:28 AM UTC+10, Krishna Subramanian wrote: Hello, I am learning my ropes with Julia and come from a C++/Perl background. In the C++/STL, we have map which implements upper_bound/lower_bound operations [see Cplusplus.com]. Do we have something similar in

Re: [julia-users] Re: Defining a function in different modules

2015-05-01 Thread elextr
On Friday, May 1, 2015 at 11:39:20 PM UTC+10, Tom Breloff wrote: I agree that auto-merging could cause hard-to-find bugs for the user. This is less important than causing impossible-to-find bugs for a package writer IMO. I'm not sure I understand what impossible to find bug not merging

Re: [julia-users] Re: Performance variability - can we expect Julia to be the fastest (best) language?

2015-05-01 Thread elextr
If you are coding exclusively in Python or R, and there isn't an optimized function appropriate for the innermost loops of your task at hand, you are out of luck. This is the important key takehome message, Julia is intended to allow both quick and simple and interactive and dynamic

Re: [julia-users] Re: Defining a function in different modules

2015-04-30 Thread elextr
Are there other pitfalls to auto-merging in user-space-only? Tom, The problem with auto merging in user code (as I see it) module a export f f(x) = 4 f(x::Int)=5 user code: using a f(5) # gives 5 fine f(6.0)+1 # gives 5 fine f(5.0) # gives 4, fine now another module: module b #

[julia-users] Re: Parameters of type parameters as field types - is it possible?

2015-04-29 Thread elextr
On Wednesday, April 29, 2015 at 9:00:00 PM UTC+10, Robert Gates wrote: Dear Julia users: I'm trying to define a parametric composite type with fields whose types depend on both the type parameter as well as the parameter of the type parameter. This is what I tried: type Foo{T} a::T

Re: [julia-users] Re: Defining a function in different modules

2015-04-28 Thread elextr
Nice summary, it shows that, in the case where the module developer knows about an existing module and intends to extend its functions, Julia just works. But it misses the actual problem case, where two modules are developed in isolation and each exports an original sin (sorry couldn't

Re: [julia-users] Re: Defining a function in different modules

2015-04-27 Thread elextr
On Sunday, April 26, 2015 at 8:24:15 PM UTC+10, Scott Jones wrote: Yes, precisely... and I *do* want Julia to protect the user *in that case*. If a module has functions that are potentially ambiguous, then 1) if the module writer intends to extend something, they should do it *explicitly*,

Re: [julia-users] Re: Defining a function in different modules

2015-04-26 Thread elextr
On Sunday, April 26, 2015 at 7:23:02 PM UTC+10, Scott Jones wrote: Ah, but that is NOT the situation I've been talking about... If the writer of a module wants to have a function that takes ::Any, and is not using any other types that are local to that package, then, from the rules I'd

Re: [julia-users] Re: Defining a function in different modules

2015-04-25 Thread elextr
I think the key issue is your: I believe they should be able to use both, as long as there aren't any real conflicts, *without* spurious warnings... As Jeff said, the problem is aren't any real conflicts is not possible to determine in all cases, and can be costly in others. And IIUC its

Re: [julia-users] Re: Defining a function in different modules

2015-04-25 Thread elextr
On Sunday, April 26, 2015 at 10:12:51 AM UTC+10, Scott Jones wrote: The compiler can't determine that there are no conflicts in the case where the method uses a type that is local to the module? That is not a sufficient condition, a function of the same name which uses ::Any in the same

Re: [julia-users] Re: Defining a function in different modules

2015-04-25 Thread elextr
The situation I was describing is that there is: module A type Foo end f(a::Any) ... f(a::Foo) ... which expects f(a) to dispatch to its ::Any version for all calls where a is not a Foo, and there is: module B type Bar end f(a::Bar) ... so a user program (assuming the f() functions

Re: [julia-users] in-place fn in a higher order fn

2015-04-24 Thread elextr
On Friday, April 24, 2015 at 6:33:08 PM UTC+10, Mauro wrote: function f(fn!,ar) for i=1:n fn!(ar, i) # fn! updates ar[i] somehow, returns nothing nothing# to make sure output of f is discarded end end I'm curious how you would

Re: [julia-users] in-place fn in a higher order fn

2015-04-24 Thread elextr
On Friday, April 24, 2015 at 8:11:52 PM UTC+10, Mauro wrote: Well it seems Julia should know that nothing is used from fn!, without knowing anything about fn!. That is at least what @code_warntype suggest (with julia --inline=no). For function f(ar) for i=1:n

Re: [julia-users] Re: Defining a function in different modules

2015-04-24 Thread elextr
On Saturday, April 25, 2015 at 4:56:58 AM UTC+10, Stefan Karpinski wrote: For anyone who isn't following changes to Julia master closely, Jeff closed #4345 https://github.com/JuliaLang/julia/issues/4345 yesterday, which addresses one major concern of programming in the large. I think the

Re: [julia-users] Re: Defining a function in different modules

2015-04-24 Thread elextr
On Saturday, April 25, 2015 at 12:55:39 PM UTC+10, Michael Francis wrote: the resolution of that issue seems odd - If I have two completely unrelated libraries. Say DataFrames and one of my own. I export value( ::MyType) I'm happily using it. Some time later I Pkg.update(), unbeknownst

  1   2   3   >