Re: [julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-01 Thread Hans W Borchers
Thanks for the hint to this very helpful list of (mostly) not-metadated packages. I started a list of Numerical Math packages for Julia myself, because I did not find categorized or compiled information like here. Only I am missing more information on optimization and simulation packages out th

[julia-users] Re: How to handle this error in TCL version when "using Winston"?

2014-07-01 Thread nma%12000 . org
fyi, problem is fixed. Uninstalled Julia, installed TCL on mint again, then installed Julia again, and now it works. Please ignore the post. It is working now.

Re: [julia-users] metaprogramming nested functions

2014-07-01 Thread Cameron Smith
Obviously this is possible, julia> function foo() global foo2 foo2(x) = println(x) foo2(2) eval(parse("foo2(1)")) end foo (generic function with 1 method) julia> foo() 2 1 but less desirable. On Wednesday, July 2, 2014 1:23:11 AM UTC-4, Camero

Re: [julia-users] metaprogramming nested functions

2014-07-01 Thread John Myles White
There might be, but it would involve a pretty un-Julian approach to metaprogramming. What’s the reason you need to use eval? Could you use a macro instead? — John On Jul 1, 2014, at 10:23 PM, Cameron Smith wrote: > thanks. is there a function other than eval that would enable evaluation of a

Re: [julia-users] metaprogramming nested functions

2014-07-01 Thread Cameron Smith
thanks. is there a function other than eval that would enable evaluation of a string or symbol to result in a call to a nested function? On Wednesday, July 2, 2014 1:17:07 AM UTC-4, John Myles White wrote: > > eval always happens in the global scope > > — John > > On Jul 1, 2014, at 10:15 PM, Ca

Re: [julia-users] metaprogramming nested functions

2014-07-01 Thread John Myles White
eval always happens in the global scope — John On Jul 1, 2014, at 10:15 PM, Cameron Smith wrote: > Can anyone explain what I am misunderstanding about scope such that > > julia> function foo() >foo2(x) = println(x) >foo2(1); eval(parse("foo2(2)")); >end > foo (

[julia-users] metaprogramming nested functions

2014-07-01 Thread Cameron Smith
Can anyone explain what I am misunderstanding about scope such that julia> function foo() foo2(x) = println(x) foo2(1); eval(parse("foo2(2)")); end foo (generic function with 1 method) julia> foo() 1 ERROR: foo2 not defined in foo at none:3 is not the same as jul

[julia-users] Inconsistent results from linrange

2014-07-01 Thread Peter Simon
The final result below seems really strange to me. A bug? julia> x = linrange(1,10,20) 1.0:0.47368421052631576:10.0 julia> 10 .<= x # Gives expected result 20-element BitArray{1}: false false false false false false false false false false false false false false false false f

Re: [julia-users] more questions about sorted associative array

2014-07-01 Thread Kevin Squire
Hi Steve, I've been meaning to take a look at this and get back to you, but just haven't had the chance in the last week. Have you made any progress? Anyway, I'll try to take a look tomorrow. Cheers, Kevin On Monday, June 23, 2014, wrote: > Dear Julia colleagues, > > As mentioned in earlie

[julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-01 Thread Alireza Nejati
As someone who is a relative newcomer preparing packages for submission to METADATA, I'm also inclined to agree with the above posts. When I first started using Julia I was under no illusions that what's in METADATA may not necessarily be sanctioned by the core julia developers and caveat empto

Re: [julia-users] Re: Operate on one of three dimensions.

2014-07-01 Thread David A.
That fixed it. Thanks ;) On Tuesday, July 1, 2014 10:13:09 PM UTC-3, Tim Holy wrote: > > img_float * img_float is being interpreted as matrix multiplication. If > the 2D > slice is not square, then that explains the DimensionMismatch. > > If you want elementwise multiplication, you have to use

Re: [julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-01 Thread Isaiah Norton
On the discoverability side, svaksha's curated collection really deserves more attention - it is categorized and provides short summaries of code ranging from listed packages to useful fragments that never showed up on the mailing lists. http://svaksha.github.io/Julia.jl/ On Tue, Jul 1, 2014 at

Re: [julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-01 Thread Leah Hanson
I think the ease of `Pkg.clone` for packages that aren't yet ready for metadata is the biggest argument against an "extra metadata" thing. Especially since `Pkg.clone` already handles reading the REQUIRE file in the repo. Maybe the thing to do is to advertise the steps to have people try your code

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Randy Zwitch
Oh, ok, thanks! I wasn't realizing you were using '...' as splat, but rather "How did you not remember this..." On Tuesday, July 1, 2014 9:54:18 PM UTC-4, Jacob Quinn wrote: > > jinx Isaiah :) > > > On Tue, Jul 1, 2014 at 9:51 PM, Isaiah Norton > wrote: > >> Regarding this: >> > I was somewhat s

[julia-users] Re: Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-01 Thread Randy Zwitch
This doesn't seem like a great idea to me. I felt a great sense of accomplishment when I had my first package listed on METADATA, as I felt like I made a tangible contribution to the community (in the same way I'm proud of having a CRAN package). So for me, I'd question the value of having a pa

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Jacob Quinn
jinx Isaiah :) On Tue, Jul 1, 2014 at 9:51 PM, Isaiah Norton wrote: > Regarding this: > > I was somewhat surprised that I had to reference the fields in the > tuple by position > > there are two ways to do it: > 1) `value...` will splat the arguments > 2) `[datetime(year,month,day) for (year,mo

[julia-users] Re: GSoC: Julia IDE Progress update

2014-07-01 Thread Alireza Nejati
FWIW, I did a huge upgrade on my system and now that error goes away, but I still don't have autocomplete. Anyway, it's not that important, everything else is usable and nice. On Sunday, June 29, 2014 9:46:21 PM UTC+12, Mike Innes wrote: > > Hey all, > > I've released the latest version of the J

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Isaiah Norton
Regarding this: > I was somewhat surprised that I had to reference the fields in the tuple by position there are two ways to do it: 1) `value...` will splat the arguments 2) `[datetime(year,month,day) for (year,month,day) in zip(test[:Year], test[:Month], test[:DayofMonth])]` will do what you want

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Jacob Quinn
You could say test[:start_date] = [datetime(value...) for value in zip(test[:Year], test[:Month], test[:DayofMonth])] Or I think the following is what you were originally after test[:start_date] = [datetime(year,month,day) for (year,month,day) in zip(test[:Year], test[:Month], test[:DayofMonth])

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Randy Zwitch
Sorry, not following...try value how? On Tuesday, July 1, 2014 9:40:46 PM UTC-4, Isaiah wrote: > > Try "value..." > > > On Tue, Jul 1, 2014 at 9:37 PM, Randy Zwitch > wrote: > >> I have a data frame where the year, month, day, hour, etc. are in >> different columns. I want to use Datetime.jl to

Re: [julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Isaiah Norton
Try "value..." On Tue, Jul 1, 2014 at 9:37 PM, Randy Zwitch wrote: > I have a data frame where the year, month, day, hour, etc. are in > different columns. I want to use Datetime.jl to make timestamps, then do > some processing. > > I tried to attack the problem like the following (which is to

[julia-users] Question about surprising behavior of zip/using multiple columns in data frame

2014-07-01 Thread Randy Zwitch
I have a data frame where the year, month, day, hour, etc. are in different columns. I want to use Datetime.jl to make timestamps, then do some processing. I tried to attack the problem like the following (which is to say, Python-style), but it didn't work: test[:start_date] = [datetime(year,m

Re: [julia-users] Re: Operate on one of three dimensions.

2014-07-01 Thread Tim Holy
img_float * img_float is being interpreted as matrix multiplication. If the 2D slice is not square, then that explains the DimensionMismatch. If you want elementwise multiplication, you have to use .* --Tim On Tuesday, July 01, 2014 04:02:51 PM David A. wrote: > This works: > img_float[:,:,1] +

[julia-users] Lowering the (mostly social/psychological) barriers to sharing packages?

2014-07-01 Thread Iain Dunning
Hi all, Something that came up in some discussions I had at *JuliaCon* is that people perceive packages in METADATA as being for more "serious" packages, i.e. by being there there is an implication of a certain minimum quality. A lot of my efforts in the package ecosystem have been try to help

[julia-users] Re: Succinct syntax for removing a column from a DataFrame using the column name

2014-07-01 Thread Simon Kornblith
delete!(A, [:C,:D]) On Tuesday, July 1, 2014 7:38:00 PM UTC-4, Andre P. wrote: > > I figured out one way to do this... > > B = A[:, setdiff(names(A),[symbol("D"), symbol("E")])] # removes columns C > & D using column names > > A less verbose way? > > On Wednesday, July 2, 2014 7:01:56 AM UTC+9, A

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Andy Hayden
It could be what quinnj's port does https://github.com/attractivechaos/plb/blob/master/sudoku/sudoku_v1.jl. I couldn't get this working to compare... On 1 July 2014 17:13, Iain Dunning wrote: > Stripping out the dictionary stuff in search and doing it in a single > array pass has knocked me do

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Iain Dunning
Stripping out the dictionary stuff in search and doing it in a single array pass has knocked me down to elapsed time: 1.305257143 seconds (183884144 bytes allocated, 3.85% gc time) Changing to bitarrays would be the real fix, and I got halfway, but converting the code was so painful I might jus

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread andy hayden
Ha, I had exactly the same issue (I pushed a perf update with a commented out impl), I assumed it was something (very) wrong in my understanding of control flow! I don't think see how it would rely on anything, ordering (?)... perplexing. On Tuesday, 1 July 2014 16:45:04 UTC-7, Iain Dunning wro

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Iain Dunning
Yeah we changed the example, so best to take it from the one in the release version... I removed the dictionary from search() but its now no longer solving all the problems(!) - does the algorithm rely somehow on the way the dictionary is constructed? On Tuesday, July 1, 2014 6:59:02 PM UTC-4

[julia-users] Re: Succinct syntax for removing a column from a DataFrame using the column name

2014-07-01 Thread Andre P.
I figured out one way to do this... B = A[:, setdiff(names(A),[symbol("D"), symbol("E")])] # removes columns C & D using column names A less verbose way? On Wednesday, July 2, 2014 7:01:56 AM UTC+9, Andre P. wrote: > > I have a data frame with a large number of columns and I would like to > re

[julia-users] Re: Operate on one of three dimensions.

2014-07-01 Thread David A.
This works: img_float[:,:,1] + (img_float[:,:,1] * 0.5) but this gives that error: img_float[:,:,1] * (img_float[:,:,1] * 0.5) On Tuesday, July 1, 2014 7:34:04 PM UTC-3, David A. wrote: > > I'm trying to operate on just one dimension of an Array of 3 dimensions, > but getting this: ERROR: Dime

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Andy Hayden
I was using Cbc. SolveModel is a copy and paste job from JuMP (from the last release rather than master) so may not work with JuMP from master - I couldn't get the version from master working since it was incompatible with the JuMP release I had! It'd be great to just be able to just include the f

[julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Iain Dunning
JuMP won't be getting any faster, its entirely limited by the speed of the MIP solver. Which one did you use? On Tuesday, July 1, 2014 6:47:04 PM UTC-4, Iain Dunning wrote: > > I was unable to run Bench.jl (ERROR: varzm! not defined), but, on my > computer just using runtests.jl, a fixed seed, a

[julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Iain Dunning
I was unable to run Bench.jl (ERROR: varzm! not defined), but, on my computer just using runtests.jl, a fixed seed, and total time for 100 random *Initial elapsed time: 1.641434988 seconds (282491732 bytes allocated, 5.99% gc time) *Change globals to const elapsed time: 1.563094028 seconds (2618

[julia-users] Operate on one of three dimensions.

2014-07-01 Thread David Ainish
I'm trying to operate on just one dimension of an Array of 3 dimensions, but getting this: ERROR: DimensionMismatch("*") The steps I'm doing are: img = imread("path-to-image") img_float = convert(Array, img) / 255 img_float becomes of type Array{Float64,3} And trying to modify the first dimensi

[julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread andy hayden
Bench.jl has a bench_compare method which returns a DataFrame of times (I then divide the median of Python vs Julia columns), I'll add this output to the Bench script as it's useful to see (would be nice to add more stats, as it's just a DataFrame of all the solved puzzles in seconds). By defaul

[julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Iain Dunning
I'm working on improving this, but I'm not sure how you are measuring that 20% slower - can you be more specific? On Tuesday, July 1, 2014 1:37:00 PM UTC-4, andy hayden wrote: > > I recently ported Norvig's Solve Every Sudoku Puzzle > to Julia: > https://github.c

Re: [julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Stefan Karpinski
If the Sudokus were *really* huge I bet the MIP would win ;-) On Tue, Jul 1, 2014 at 6:06 PM, Iain Dunning wrote: > Hah I'm actually surprised there isn't more of a performance gap for the > MIP formulation, thats kinda cool. > > > On Tuesday, July 1, 2014 1:37:00 PM UTC-4, andy hayden wrote: >

[julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Iain Dunning
Hah I'm actually surprised there isn't more of a performance gap for the MIP formulation, thats kinda cool. On Tuesday, July 1, 2014 1:37:00 PM UTC-4, andy hayden wrote: > > I recently ported Norvig's Solve Every Sudoku Puzzle > to Julia: > https://github.com/hay

[julia-users] Succinct syntax for removing a column from a DataFrame using the column name

2014-07-01 Thread Andre P.
I have a data frame with a large number of columns and I would like to remove certain unnecessary columns as part of the initial data wrangling. I can do this succinctly using the numeric index... using DataFrames A = DataFrame(A=1:3, B=4:6, C=7:9, D=10:12, E=13:15) B = A[:, setdiff(1:end,[3,4])

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-01 Thread Laszlo Hars
>(Steve) juliarc.jl is run before the REPL is initialized I thought about that possibility, and tried also manually typing in pushdisplay(TextDisplay(STDOUT)) when the REPL is up and running. There is no difference: the Julia console output just does not appear on my STDOUT >(Keno) I fixed this s

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-01 Thread Keno Fischer
Actually, I fixed this so that any display pushed in .juliarc.jl will be on top of the display stack. On Tue, Jul 1, 2014 at 5:12 PM, Steven G. Johnson wrote: > On Tuesday, July 1, 2014 1:20:25 PM UTC-4, Laszlo Hars wrote: >> >> This is what I have in my juliarc.jl file >> ~~~ >> pushdisplay(Te

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-01 Thread Steven G. Johnson
On Tuesday, July 1, 2014 1:20:25 PM UTC-4, Laszlo Hars wrote: > > This is what I have in my juliarc.jl file > ~~~ > pushdisplay(TextDisplay(STDOUT)) > I think the problem is that .juliarc.jl is run before the REPL is initialized, whereas you want to push the display afterwards. i.e. your TextD

[julia-users] Re: A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread Steven G. Johnson
On Tuesday, July 1, 2014 1:37:00 PM UTC-4, andy hayden wrote: > > I recently ported Norvig's Solve Every Sudoku Puzzle > to Julia: > https://github.com/hayd/Sudoku.jl > > Some simple benchmarks suggest my Julia implementation solves around 20% > slower* than the P

[julia-users] How to handle this error in TCL version when "using Winston"?

2014-07-01 Thread nma%12000 . org
Just installed Julia 0.3 from git, all compiled ok. Then I did: julia> Pkg.add("Winston") INFO: Cloning cache of BinDeps from git://github.com/JuliaLang/BinDeps.jl.git INFO: Installing Winston v0.11.0 INFO: Building Cairo INFO: Building Tk Now it asked to install TK, I said OK: Installing

[julia-users] A port of Norvig's Sudoku solver to Julia

2014-07-01 Thread andy hayden
I recently ported Norvig's Solve Every Sudoku Puzzle to Julia: https://github.com/hayd/Sudoku.jl Some simple benchmarks suggest my Julia implementation solves around 20% slower* than the Python version, and 3 times faster than the implementation on JuMP (vendoriz

[julia-users] Potential bug in Task/iterators?

2014-07-01 Thread Sebastian Nowozin
Hi everyone, I followed the pattern proposed at http://slendermeans.org/julia-iterators.html (see the "fibtask" function) in order to define an iterator that is traversing a tree data structure as follows: function search(rt::Tree) function _search(node::InteriorNode) for cn in no

Re: [julia-users] Re: Capture the output of Julia's console

2014-07-01 Thread Laszlo Hars
This is what I have in my juliarc.jl file ~~~ pushdisplay(TextDisplay(STDOUT)) # display() does not write to STDOUT: evalu("1+2") vs. evalu("print(1+2)") const STDOUT_orig = STDOUT function evalu(s::String)# paste to console: evalu(""" """)\n try rd, = redirect_stdout() eva

Re: [julia-users] how to call extern c function in julia?

2014-07-01 Thread Leah Hanson
You can model your C-struct type with a Julia type. Each field of the Julia type should have a type annotation (Cint, etc) and be in the same order as the C-struct. Here's an example of Julia code wrapping a C library: https://github.com/JuliaLang/HttpParser.jl/blob/master/src/HttpParser.jl I thi

[julia-users] Re: [julia-stats] Re: [julia-dev] Re: JuliaCon Question Thread

2014-07-01 Thread Viral Shah
The plan is to do so, assuming the sound quality has come out OK. The presentations will be up nonetheless. -viral On 01-Jul-2014 12:51 pm, "Sam L" wrote: > Is the plan still to upload videos of the talks to youtube? The > presentation slides (https://github.com/JuliaCon/presentations for anyon

[julia-users] Re: [julia-stats] Re: [julia-dev] Re: JuliaCon Question Thread

2014-07-01 Thread Hunter Owens
Yep. As soon as Jiahao has a chance to edit them. -Hunter On Tue, Jul 1, 2014 at 12:51 PM, Sam L wrote: > Is the plan still to upload videos of the talks to youtube? The > presentation slides (https://github.com/JuliaCon/presentations for anyone > searching) are really interesting and I'm look

[julia-users] Re: [julia-dev] Re: JuliaCon Question Thread

2014-07-01 Thread Sam L
Is the plan still to upload videos of the talks to youtube? The presentation slides (https://github.com/JuliaCon/presentations for anyone searching) are really interesting and I'm looking forward to seeing the talks. On Tuesday, June 3, 2014 4:40:34 PM UTC-7, Gustavo Lacerda wrote: > > Awesome.

Re: [julia-users] get step size of linspace

2014-07-01 Thread Sam L
Vector{Float64} is an just array of floats in memory, and there's no way of knowing without checking that they're sorted in increasing or decreasing order and equally spaced. In order to convert from Vector{Float64} to FloatRange{Float64}, you'd have to assume that this is true or check. If yo

Re: [julia-users] get step size of linspace

2014-07-01 Thread Andrei Berceanu
And isn't there some inverse function to []? I mean, if i have a Vector{Float64} [myrange] and want to convert it into a FloatRange{Float64} myrange. On Tuesday, July 1, 2014 2:35:03 PM UTC+2, Mauro wrote: > > > Mauro, is that the only difference, the memory allocation? Can I use > ranges > >

[julia-users] Re: Building 35 day old master and get DataFrames and Distributions to run

2014-07-01 Thread Florian Oswald
nevermind - i got the most recent version to build following this: https://github.com/JuliaLang/julia/issues/7240 On Tuesday, 1 July 2014 11:23:33 UTC+1, Florian Oswald wrote: > > I'm having trouble building the current master on a unix cluster, see > https://github.com/JuliaLang/julia/issues/74

Re: [julia-users] get step size of linspace

2014-07-01 Thread Mauro
> Mauro, is that the only difference, the memory allocation? Can I use ranges > for plotting, for instance? Ranges are basically just 3 numbers: start, step & stop. Just have a look at base/range.jl On whether they can be used instead of arrays depends on the implementation of the function in q

Re: [julia-users] get step size of linspace

2014-07-01 Thread Ivar Nesje
You can use ranges in all places where you are not calling C code, or other cases where someone explicitly restricts the type of the argument. kl. 14:17:46 UTC+2 tirsdag 1. juli 2014 skrev Andrei Berceanu følgende: > > Mauro, is that the only difference, the memory allocation? Can I use > ranges

Re: [julia-users] get step size of linspace

2014-07-01 Thread Andrei Berceanu
Mauro, is that the only difference, the memory allocation? Can I use ranges for plotting, for instance? On Tuesday, July 1, 2014 1:33:34 PM UTC+2, Mauro wrote: > > > If I define an array using the syntax > > > > a = [start:step:end] > > > > how can I later recover the step? I tried step(a

Re: [julia-users] get step size of linspace

2014-07-01 Thread Mauro
> If I define an array using the syntax > > a = [start:step:end] > > how can I later recover the step? I tried step(a), but that only seems to > work for integer ranges. Why not keep the range? It should work just like an array but use less memory: a = start:step:end and step works for flo

[julia-users] Re: get step size of linspace

2014-07-01 Thread Ivar Nesje
a[2] - a[1] kl. 13:21:28 UTC+2 tirsdag 1. juli 2014 skrev Andrei Berceanu følgende: > > If I define an array using the syntax > > a = [start:step:end] > > how can I later recover the step? I tried step(a), but that only seems to > work for integer ranges. >

[julia-users] get step size of linspace

2014-07-01 Thread Andrei Berceanu
If I define an array using the syntax a = [start:step:end] how can I later recover the step? I tried step(a), but that only seems to work for integer ranges.

[julia-users] Building 35 day old master and get DataFrames and Distributions to run

2014-07-01 Thread Florian Oswald
I'm having trouble building the current master on a unix cluster, see https://github.com/JuliaLang/julia/issues/7482 I was able to build it some time ago, so this commit builds: https://github.com/JuliaLang/julia/commit/ac46d58c5a23a8020c666789ca80614f5cda4d8f that version: Julia Version 0.3.0

[julia-users] Re: truncate values in array

2014-07-01 Thread Andrei Berceanu
Thank you both! On Tuesday, July 1, 2014 11:45:19 AM UTC+2, Andrei Berceanu wrote: > > Is there something similar to numpy's > > array[array > 255.] = 255. > > for truncating values in a FloatingPoint array? >

Re: [julia-users] truncate values in array

2014-07-01 Thread Ivar Nesje
There is also: *filter(x -> x > 255., array)* Ivar kl. 11:53:36 UTC+2 tirsdag 1. juli 2014 skrev Mauro følgende: > > You need to use the element wise comparison: .> > > array[array .> 255.] = 255. > > On Tue, 2014-07-01 at 10:45, andreib...@gmail.com wrote: > > Is there something similar t

Re: [julia-users] truncate values in array

2014-07-01 Thread Mauro
You need to use the element wise comparison: .> array[array .> 255.] = 255. On Tue, 2014-07-01 at 10:45, andreiberce...@gmail.com wrote: > Is there something similar to numpy's > > array[array > 255.] = 255. > > for truncating values in a FloatingPoint array?

[julia-users] truncate values in array

2014-07-01 Thread Andrei Berceanu
Is there something similar to numpy's array[array > 255.] = 255. for truncating values in a FloatingPoint array?

Re: [julia-users] build from source modifying Make.user on hpc cluster

2014-07-01 Thread Baurzhan Muftakhidinov
If you have different CPUs then you better stick with the DYNAMIC_ARCH enabled. Just build julia with devtoolset from Centos 5/6. https://gist.github.com/crayxt/90aabcaab2c725982624 Hope it helps, On Tuesday, July 1, 2014 1:05:15 PM UTC+6, Florian Oswald wrote: > > great! thanks a lot. > > >

[julia-users] Re: how to call c function from Julia to pass struct params?

2014-07-01 Thread Ivar Nesje
If you never need to look at the fields of the struct, and the return value is a pointer to the struct, you can declare the return type as Ptr{Void}. For type safety, you might want to wrap the Ptr{Void} in a Julia immutable immutable MyType ptr::Ptr{Void} end function MyType(a::Integer, b:

Re: [julia-users] Julia dispatches to less specific method

2014-07-01 Thread Mauro
Yes, this seems odd. I think it's a bug. First, this also works: function scale!{T<:Number}(A::Tridiagonal{T}, x::T) Base.scale!(A.dl, x) Base.scale!(A.d, x) Base.scale!(A.du, x) return end and is probably what you want as T needs to be a number for

[julia-users] how to call extern c function in julia?

2014-07-01 Thread huangbo2tyut
I am newer to julia. I have build shared library of C language. I want to call some c funtions in Julia ,but I have some problems with the params type and return type. For example: the C funtion 1: MyType computer(int a, int b, ..){ //some operator MyType result; return result; } The C fun

[julia-users] how to call c function from Julia to pass struct params?

2014-07-01 Thread huangbo2tyut
I am a newbee in Julia. I want to call a c function in Julia, but I have a problem. In C: function1: myType com1(int a, int b) { do some operator; return myType; } "myType" is a struct type that I define function2: void draw(myType a) { do some operator

[julia-users] Re: Initializing a nested composite type variable

2014-07-01 Thread Kaj Wiik
Thanks! For maximum simplicity, you could define a default outer constructor: > Minmax() = Minmax{Xy}(Xy(0,0),Xy(0,0)) > > And then your example works (without the type parameter). If you want to > specify the type, then you need to slightly generalize this default > constructor to something lik

Re: [julia-users] build from source modifying Make.user on hpc cluster

2014-07-01 Thread Florian Oswald
great! thanks a lot. On 1 July 2014 00:43, Tony Kelman wrote: > Pull request opened here https://github.com/JuliaLang/julia/pull/7476 > > If you get into trouble compiling the Haswell kernels due to "no such > instruction: vpermpd", give NO_AVX a try. Or upgrade binutils, up to you. > > > > On