[julia-users] Re: Why does adding type assertion to field slow down this example?

2016-06-13 Thread Jason Merrill
On Thursday, June 9, 2016 at 6:36:35 PM UTC-4, Arch Robison wrote > > Yes, I know if I declare x with a concrete type such as Int, the code will > do blazingly fast. But I was poking around to see if declaring it with an > abstract type narrower than Any would help. > I think the other piece

Re: [julia-users] Symbolic Distributions?

2016-04-12 Thread Jason Merrill
On Tuesday, April 12, 2016 at 8:29:25 AM UTC-4, John Pearson wrote: > > AD numbers are subtypes of Real. This is not quite mathematically correct > (there's a long discussion on GitHub), but in this case, practicality beats > purity. > Do you have a reference to the discussion about AD numbers

Re: [julia-users] Re: possibility to define a type that is subtype of more than one supertype

2016-04-05 Thread Jason Merrill
thub.com/mauro3/SimpleTraits.jl which is (+/-) > just macro-sugar for "trait tricks". This package is a lot simpler, > easier to maintain and thus more likely to prevail until the > traitocalypse. > > On Mon, 2016-04-04 at 15:29, Jason Merrill <jwmerr...@gmail.com> wrote

[julia-users] Re: possibility to define a type that is subtype of more than one supertype

2016-04-04 Thread Jason Merrill
It is not currently possible for a type to have multiple direct supertypes. You might be interested in the Traits package: https://github.com/mauro3/Traits.jl If you don't want to add a dependency, you can use the "traits trick" directly, which seems to have first been described here:

Re: [julia-users] Re: A first package: RecVec (compute the recurrence vector of a sequence)

2016-02-29 Thread Jason Merrill
Le lundi 29 février 2016 17:22:33 UTC+1, Jason Merrill a écrit : >> >> The first page of google results didn't give me a good clue about what a >> Recurrence Vector is, and I also couldn't infer this from quickly skimming >> the package README. >> >> Taking a gue

[julia-users] Why can't I reinterpret a single value to a custom immutable type?

2015-11-04 Thread Jason Merrill
I have a custom immutable type that wraps an Int16: julia> immutable DigitSet d::Int16 end julia> isbits(DigitSet) true I was hoping to be able to reinterpret an Int16 as this type, but I get an error that confusingly says that the first argument must be a bits type: julia>

[julia-users] Re: Help on performance issues

2015-11-02 Thread Jason Merrill
I decided to write a blog post based on the Kakuro puzzle solver problem from this thread: http://squishythinking.com/2015/11/02/optimizing-kakuro-in-julia/ On Wednesday, October 21, 2015 at 7:08:35 PM UTC-4, Jason Merrill wrote: > > I got interested in trying to optimize this proble

[julia-users] Re: Help on performance issues

2015-10-21 Thread Jason Merrill
I got interested in trying to optimize this problem even further. Here are the results: https://gist.github.com/jwmerrill/5b364d1887f40f889142 I was able to get the benchmark down to a few microseconds (or ~100 microseconds if you count the time to build a look up table). Either way, it's a

Re: [julia-users] Re: Help on performance issues

2015-10-21 Thread Jason Merrill
formance. I may use this in some talks if you don't mind! > > On Wed, Oct 21, 2015 at 7:08 PM, Jason Merrill <jwmerr...@gmail.com> > wrote: > >> I got interested in trying to optimize this problem even further. Here >> are the results: >> >> https://gist.g

[julia-users] Re: Help on performance issues

2015-10-19 Thread Jason Merrill
If I'm reading correctly, it looks like decompose is intended to give all partitions of val into num summands. Julia actually has this function as part of Base: julia> collect(Vector{Int}, partitions(10, 3)) 8-element Array{Array{Int64,1},1}: [8,1,1] [7,2,1] [6,3,1] [5,4,1] [6,2,2]

[julia-users] Re: Help on performance issues

2015-10-19 Thread Jason Merrill
On Monday, October 19, 2015 at 7:39:03 AM UTC-4, Patrick Useldinger wrote: > > Hello > true but no summand may appear twice, and only numbers 1 to 9 may be used. > For example, (10, 3) yields > > Array[Int16[2,3,5],Int16[1,4,5],Int16[1,3,6],Int16[1,2,7]] > > Regards, > -Patrick > Ah, okay, I

[julia-users] Re: Help on performance issues

2015-10-19 Thread Jason Merrill
The combinations solution gives the same answers as the last solution you posted, in reverse order. julia> function decompose_jm(val, num) out = Vector{Int}[] for c in combinations(1:9, num) if sum(c) == val push!(out, c) end

[julia-users] Re: Performance compared to Matlab

2015-10-18 Thread Jason Merrill
Two quick pieces of advice: Try @code_warntype Jakes_Flat( 926, 1e-6, 5, 0, 1, 0 ) For some reason, the type of the variable "h" is not being inferred tightly (i.e. it has type any). If you can sort things out so that h is typed more concretely, I suspect you'll be able to match matlab's

Re: [julia-users] Inner constructor var args

2015-10-09 Thread Jason Merrill
9, 2015 at 7:13 PM Jason Merrill <jwme...@gmail.com > > wrote: > >> I'm trying to make a wrapper around an NTuple that takes varargs, but I >> can't figure out what the constructor should look like. I thought the >> following would work, but it throw

[julia-users] Inner constructor var args

2015-10-09 Thread Jason Merrill
I'm trying to make a wrapper around an NTuple that takes varargs, but I can't figure out what the constructor should look like. I thought the following would work, but it throws an error jwm@jason-2 ~/s/julia> julia _ _ _ _(_)_ | A fresh approach to technical

Re: [julia-users] Re: Fastest way to get # of bits of an integer value in Julia?

2015-10-06 Thread Jason Merrill
Ravi, I think you're running into the resolution of your timers there. I suspect all of those operations are much faster than a microsecond.

Re: [julia-users] John L. Gustafson's UNUMs

2015-07-31 Thread Jason Merrill
On Thursday, July 30, 2015 at 3:54:39 PM UTC-4, Jason Merrill wrote: * Wrath of Kahan, 2 In the unum computation, squaring operations are fused with squareu, but float Interval calculations are not fused. I also believe the check for the ubounds containing zero in e[z] is erroneous

Re: [julia-users] John L. Gustafson's UNUMs

2015-07-31 Thread Jason Merrill
On Friday, July 31, 2015 at 12:51:57 PM UTC-4, Jason Merrill wrote: On Thursday, July 30, 2015 at 3:54:39 PM UTC-4, Jason Merrill wrote: * Wrath of Kahan, 2 In the unum computation, squaring operations are fused with squareu, but float Interval calculations are not fused. I also believe

Re: [julia-users] John L. Gustafson's UNUMs

2015-07-31 Thread Jason Merrill
UTC-7, Jason Merrill wrote: On Thursday, July 30, 2015 at 3:54:39 PM UTC-4, Jason Merrill wrote: * Wrath of Kahan, 2 In the unum computation, squaring operations are fused with squareu, but float Interval calculations are not fused. I also believe the check for the ubounds containing zero

Re: [julia-users] John L. Gustafson's UNUMs

2015-07-30 Thread Jason Merrill
On Thursday, July 30, 2015 at 3:10:24 PM UTC-4, Job van der Zwan wrote: On Thursday, 30 July 2015 16:07:46 UTC+2, Steven G. Johnson wrote: The problem is that if you interpret an exact unum as the open interval between two adjacent exact values, what you have is essentially the same as

Re: [julia-users] John L. Gustafson's UNUMs

2015-07-30 Thread Jason Merrill
On Thursday, July 30, 2015 at 4:22:34 PM UTC-4, Job van der Zwan wrote: On Thursday, 30 July 2015 21:54:39 UTC+2, Jason Merrill wrote: Analysis of examples in the book Thanks for correcting me! The open/closed element becomes pretty crucial later on though, when he claims on page 225

Re: [julia-users] Re: John L. Gustafson's UNUMs

2015-07-30 Thread Jason Merrill
On Wednesday, July 29, 2015 at 5:31:12 PM UTC-4, Stefan Karpinski wrote: The most compelling part of the proposal to me was the claim of associativity, which I suppose comes along with the variable precision since you can actually drop trailing bits that you can't get right. I bought a

[julia-users] Re: ANN: SingularIntegralEquations.jl release v0.0.1

2015-07-07 Thread Jason Merrill
Those examples look really impressive. I'm wondering if the first figure in the README actually corresponds to the code block above it. The code looks like it is describing a plane wave incident at a 45 degree angle on a single plate, but the figure has a rotation symmetry, with several plates

Re: [julia-users] Re: Sampling a Discrete Probability Distribution Using a Vector

2015-05-27 Thread Jason Merrill
You might want to take a look at http://en.m.wikipedia.org/wiki/Alias_method There's a nice, detailed exposition at http://www.keithschwarz.com/darts-dice-coins/

Re: [julia-users] Re: compute quantity along contour

2015-02-04 Thread Jason Merrill
On Wednesday, February 4, 2015 at 8:54:27 AM UTC-8, Andrei Berceanu wrote: I'm thinking, given that the phase map was produced by applying Base.angle() on another (complex) matrix (say we call it M), it is this function which caused the phase wrapping in the first place, right? So can't I

Re: [julia-users] Writing Type-Stable Code in Julia - type stable version not that fast in 0.4

2015-01-27 Thread Jason Merrill
I just filed an issue to track this: https://github.com/JuliaLang/julia/issues/9942

[julia-users] Re: Naming of functions advice

2015-01-12 Thread Jason Merrill
Not sure if this is very helpful, but I think `roots` would be a great name to use instead of `zero`. You could maybe use `stepresponse` instead of `step`, but it's a little hard to parse with Julia's squishedcase convention. On Monday, January 12, 2015 at 11:09:54 AM UTC-8, James Crist wrote:

[julia-users] Re: Naming of functions advice

2015-01-12 Thread Jason Merrill
response(sys::LTISystem, Step) or response(sys::LTISystem, Impulse) to get the step response or the impulse response for the system. On Monday, January 12, 2015 at 3:20:10 PM UTC-8, Jason Merrill wrote: Not sure if this is very helpful, but I think `roots` would be a great name to use instead

Re: [julia-users] Re: Can I use macro to substitute the argument list of a function?

2015-01-08 Thread Jason Merrill
Can you give more context about what high level goal you are trying to achieve? Why do you want to splice arguments in this particular way? On Wednesday, January 7, 2015 8:25:16 PM UTC-8, Chi-wei Wang wrote: Any ways to achieve this? Jameson於 2015年1月7日星期三UTC-8下午7時32分59秒寫道: the declaration

Re: [julia-users] Re: Why does the following give an error: p = 1; 2p+1 ??

2015-01-05 Thread Jason Merrill
On Monday, January 5, 2015 12:13:51 PM UTC-8, Jeff Bezanson wrote: We might be able to find a more scalable syntax for different types of numbers. For example the syntax x@000 is available; `@ then digit` is always a syntax error currently. Compared to a custom string literal (e.g.

Re: [julia-users] Is this behaviour caused by a hygiene issue? If not. What causes it?

2015-01-02 Thread Jason Merrill
Really thoughtful questions here. I'll try to say something about a few of them--maybe others will have more thoughts. On Friday, January 2, 2015 7:05:48 AM UTC-5, Ismael VC wrote: Thank you Jason! When we say that Julia's macros are Lisp style macros, what are we *exactly* talking about?

Re: [julia-users] Is this behaviour caused by a hygiene issue? If not. What causes it?

2015-01-01 Thread Jason Merrill
The key to understanding macros is to understand that they are functions from syntax to syntax (or AST to AST). A macro is essentially a rule for taking one piece of code, examining it, and then replacing it with a different piece of code. When you are reading a piece of source code, you're

Re: [julia-users] warnings including module multiple times

2014-12-29 Thread Jason Merrill
On Sunday, December 28, 2014 9:24:38 PM UTC-5, Mike Innes wrote: I can only speculate about the reason that people still use include, even though Julia has nice modules. Well, I for one think that 1) Modules containing a large number of functions are OK (and this is very common in

Re: [julia-users] warnings including module multiple times

2014-12-28 Thread Jason Merrill
recommended not using it. On Sun, Dec 28, 2014 at 1:45 AM, Jason Merrill jwme...@gmail.com javascript: wrote: On Saturday, December 27, 2014 5:15:38 PM UTC-5, Stefan Karpinski wrote: You shouldn't be using include here – the way to do this is to make sure that moduleFile.jl is in your

Re: [julia-users] warnings including module multiple times

2014-12-28 Thread Jason Merrill
On Sunday, December 28, 2014 1:34:50 PM UTC-5, Mauro wrote: Now the popular packages tend use include in a way that's fairly harmless--i.e. to allow a lot of different symbols and functions to be exported from a single module, without writing all the code in a single giant file. But

Re: [julia-users] warnings including module multiple times

2014-12-27 Thread Jason Merrill
On Saturday, December 27, 2014 5:15:38 PM UTC-5, Stefan Karpinski wrote: You shouldn't be using include here – the way to do this is to make sure that moduleFile.jl is in your LOAD_PATH and then do `using moduleFile` or `import moduleFile`. I've complained before that include in user code

Re: [julia-users] any clarification of bytes allocated in @time?

2014-12-19 Thread Jason Merrill
On Friday, December 19, 2014 12:10:31 PM UTC-8, Jim Garrison wrote: On Friday, December 19, 2014 10:12:42 AM UTC-8, Tim Holy wrote: Julia's arrays grow by doubling, see http://en.wikipedia.org/wiki/Dynamic_array Is it strictly true that arrays in Julia grow by a factor of two on each

[julia-users] Re: Package development - best practices

2014-12-17 Thread Jason Merrill
I do my development in ~/.julia. I agree that it seemed weird at first, but it works fine for me. If you prefer to organize your packages somewhere else, would a symlink be sufficient? On Wednesday, December 17, 2014 2:21:44 PM UTC-8, Seth wrote: I'm wondering whether folks are actually

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-05 Thread Jason Merrill
If the space of possible hashes is smaller than the space of possible inputs (e.g. the hash is represented with fewer bits than the input data is), which is typically the case, then you can use the Pigeonhole Principle to prove what John wrote:

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-05 Thread Jason Merrill
data types it was 1-1, but I guess that was a long shot. Thanks for clarifying. On Friday, December 5, 2014 4:57:41 PM UTC-8, Jason Merrill wrote: If the space of possible hashes is smaller than the space of possible inputs (e.g. the hash is represented with fewer bits than the input data

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-05 Thread Jason Merrill
/inexperienced to do it by hand. On Friday, December 5, 2014 5:10:54 PM UTC-8, Jason Merrill wrote: There might be a good solution to the particular problem you're trying to solve, though. What are you trying to do? On Friday, December 5, 2014 5:08:08 PM UTC-8, John Myles White wrote: For specialized

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-05 Thread Jason Merrill
As a meta point, beware the XY problem: http://meta.stackexchange.com/a/66378 In other words, you'll typically get better answers faster if you start with the broad context, like On Friday, December 5, 2014 5:13:49 PM UTC-8, David Koslicki wrote: I have strings (on the alphabet {A,C,T,G}) of

Re: [julia-users] undo hash (dehash, unhash, etc)

2014-12-05 Thread Jason Merrill
, 2014 5:19:00 PM UTC-8, Jason Merrill wrote: Here's one possibility: Interpret A, C, T, G as two bit integers, i.e. A=00, C=01, T=10, G=11. A string of up to 50 of these has 2*50=100 bits, so you could store any such string as a unique Int128.

[julia-users] Re: Text editor for coding Julia: Atom vs Light Table vs Bracket

2014-11-28 Thread Jason Merrill
On Friday, November 28, 2014 10:54:33 AM UTC-6, Pileas wrote: I use Atom. It resembles so much with Sublime (maybe the same people work there). I tried Light Table. It is faster when it opens (this is a problem that Atom has so far: it is a little slow), but I find Atom easier to work

Re: [julia-users] [Offtopic:] Why you did choose the name Julia?

2014-11-24 Thread Jason Merrill
Last time this came up, Godwin's law manifested early: https://groups.google.com/d/msg/julia-users/c6rhZHMcIDs/62JB-u2MppMJ On Monday, November 24, 2014 11:40:14 PM UTC-8, Francesco Bonazzi wrote: The problem with the name Julia is that you find a lot of other stuff unrelated to programming

Re: [julia-users] Array with Substrings not subtype of Array with Strings?

2014-11-19 Thread Jason Merrill
I learned a lot on this subject from a couple of Stefan's posts in a thread that occurred a while back: https://groups.google.com/d/msg/julia-users/bldp27KJCjY/0T5kM21wSHsJ https://groups.google.com/d/msg/julia-users/bldp27KJCjY/LHM_MKaXw2YJ On Wednesday, November 19, 2014 11:09:56 AM UTC-8,

Re: [julia-users] Image processing: Otsu's method thresholding. Help with optimizing code/algorithm

2014-11-09 Thread Jason Merrill
I was fooling around with this problem a little bit tonight, and noticed that mean(in_img) is not type stable (or at least inference produces a Union type for this operation). E.g. in Aneesh's notebook, I ran @code_typed mean(in_img) and the result ended with

[julia-users] Re: Image processing: Otsu's method thresholding. Help with optimizing code/algorithm

2014-11-09 Thread Jason Merrill
On Saturday, November 8, 2014 1:52:09 PM UTC-6, Jason Merrill wrote: Here's a sketch of a different algorithm that I believe converges to the same value: 1. Initialize thresh to the mean value of the image pixels 2. Compute the mean of the pixels that are larger than thresh, mplus

[julia-users] Image processing: Otsu's method thresholding. Help with optimizing code/algorithm

2014-11-08 Thread Jason Merrill
Here's a sketch of a different algorithm that I believe converges to the same value: 1. Initialize thresh to the mean value of the image pixels 2. Compute the mean of the pixels that are larger than thresh, mplus, and smaller than thresh, mminus. 3. Set thresh to the mean of mminus and mplus,

[julia-users] Re: Metaprogramming: freakin' cool! But I don't get macros

2014-11-01 Thread Jason Merrill
On Friday, October 31, 2014 10:27:45 PM UTC-7, Franklin Fuller wrote: As a part of a project I'm working on I found myself wanting to solve a problem, which in English would be phrased: Given a vector of parameterized univariate functions [f1(x1, P1), f2(x2, P2), f3(x3, P3), ...] with

Re: [julia-users] STREAM port in Julia

2014-11-01 Thread Jason Merrill
On Saturday, November 1, 2014 9:15:43 AM UTC-7, Kapil Agarwal wrote: I need those variables as globals as otherwise I will have to pass them from one function to another all the time. It's generally better long-term design to pass the relevant state around than to have it be global. One

Re: [julia-users] STREAM port in Julia

2014-11-01 Thread Jason Merrill
On Saturday, November 1, 2014 9:35:03 AM UTC-7, Jason Merrill wrote: On Saturday, November 1, 2014 9:15:43 AM UTC-7, Kapil Agarwal wrote: I need those variables as globals as otherwise I will have to pass them from one function to another all the time. It's generally better long-term

[julia-users] Re: ANN: JLTest (An xUnit like testing framework)

2014-11-01 Thread Jason Merrill
On Thursday, October 30, 2014 8:08:23 PM UTC-4, Sal Mangano wrote: I wanted a unittest framework that worked more like unittest in python (or xUnit in in other languages) so I wrote g...@github.com:smangano/JLTest.git. If you find it useful great. I am still new to Julia so if you

[julia-users] Re: ANN: JLTest (An xUnit like testing framework)

2014-11-01 Thread Jason Merrill
On Saturday, November 1, 2014 10:01:48 AM UTC-7, Jason Merrill wrote: On Thursday, October 30, 2014 8:08:23 PM UTC-4, Sal Mangano wrote: I wanted a unittest framework that worked more like unittest in python (or xUnit in in other languages) so I wrote g...@github.com:smangano/JLTest.git

Re: [julia-users] Re: Equivalent command to IPython's %run in Julia REPL

2014-10-31 Thread Jason Merrill
On Thursday, October 30, 2014 11:42:38 PM UTC-7, Daniel Carrera wrote: The point is that Julia will parse the entire line and form a parse tree before it begins to interpret the instruction. Therefore, the @run line has to parse correctly as valid Julia syntax. If you want to type fewer

[julia-users] Re: Dict syntax that works/give no errors on both 0.3 and 0.4?

2014-10-29 Thread Jason Merrill
https://github.com/JuliaLang/Compat.jl On Tuesday, October 28, 2014 11:41:09 PM UTC-7, Sheehan Olver wrote: I change {:foo = foo, :footwo = foo2} to Dict{Any,Any}(:foo = foo, :footwo = foo2) to get rid of v0.4 deprecation warnings, but it doesn't work on v0.3 anymore. Is there

Re: [julia-users] Re: ANN: GeometricalPredicates.jl

2014-10-13 Thread Jason Merrill
Agreed, that is a very cool image. But what is at the center of the voronoi cells that are not inside the logo? Did you add some random points or something? On Monday, October 13, 2014 2:00:47 PM UTC-7, Stefan Karpinski wrote: That image is so cool! On Mon, Oct 13, 2014 at 4:47 PM, Ariel

[julia-users] IJulia is much slower than Julia just in terminal

2014-09-28 Thread Jason Merrill
It will be easier for someone to give you a good answer if you post a working example of something that is slower in IJulia than in the terminal.

[julia-users] Creating geometry plots with Julia

2014-09-26 Thread Jason Merrill
You might consider Compose, which is the geometry layer that sits below Gadfly. Or if you really want to get down to nuts and bolts, you could just use Cairo directly.

[julia-users] Re: ambiguous +(...) definitions between Images and DataArrays

2014-09-23 Thread Jason Merrill
https://github.com/JuliaLang/julia/issues/6190 On Monday, September 22, 2014 10:46:25 PM UTC-7, Don MacMillen wrote: I am seeing ambiguous method definitions when using both the Images and the DataArray packages. I have already done Pkg.update() and Pkg.build(Images) and

[julia-users] Re: Why does map allocate so much more than a list comprehension?

2014-09-22 Thread Jason Merrill
On Monday, September 22, 2014 4:46:31 PM UTC-7, Carlos P wrote: and inlining the function seems to allocate even much more memory (almost 25 times more)... Any reason why? data = rand(10^6) f1(data) = [sin(i) for i in data] julia @time f1(data); elapsed time: 0.023104734 seconds

[julia-users] Re: some Python / Julia comparisons

2014-09-21 Thread Jason Merrill
on the length of the string or its first char or something like that, but I decided not to mess with that. On Saturday, September 20, 2014 11:43:11 AM UTC-7, Jason Merrill wrote: One thing that's really nice about Julia is that it's often straightforward to transliterate python code (or matlab code

[julia-users] Re: some Python / Julia comparisons

2014-09-21 Thread Jason Merrill
On Sunday, September 21, 2014 12:21:37 PM UTC-7, Jason Trenouth wrote: On Sunday, 21 September 2014 19:23:20 UTC+1, Jason Merrill wrote: I got curious, and ended up implementing this myself: I was trying to see how little I could change the code to speed things up while showing off some

[julia-users] Re: some Python / Julia comparisons

2014-09-21 Thread Jason Merrill
On Saturday, September 20, 2014 10:45:31 AM UTC-7, stone...@gmail.com wrote: Hi Jason, Could it be possible for you to create a Julia program to compare it with the famous Jake Vanderplas post ? http://jakevdp.github.io/blog/2013/06/15/numba-vs-cython-take-2/ Under which type of problem

[julia-users] Re: some Python / Julia comparisons

2014-09-20 Thread Jason Merrill
One thing that's really nice about Julia is that it's often straightforward to transliterate python code (or matlab code) in a fairly literal way and end up with working code that has similar, or sometimes better performance. But another nice thing about Julia is that it allows you to fairly

Re: [julia-users] Are dataframes indexed?

2014-09-07 Thread Jason Merrill
John, if you haven't already, you might want to read up a bit on column oriented databases. It seems like these map more closely to dataframes in their current form, and it'd be good to understand what's been done with them, and what is/isn't possible before deciding to move to a row-oriented

[julia-users] Re: FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-07 Thread Jason Merrill
Glad I could help. I've been following Chebfun for a few years, and really admire the work that you and that team have done.

Re: [julia-users] Re: Suprises with for loops

2014-09-07 Thread Jason Merrill
I haven't run into this problem in Julia, but making too many things iterable can make it hard to write generalized flatten. I.e. you might want to say something like if an element is not iterable, push it onto the accumulator; otherwise, flatten it recursively. Doesn't work like you'd expect

[julia-users] Re: ANN: revamped Images based on Color, FixedPointNumbers

2014-09-05 Thread Jason Merrill
This looks amazing. Thanks for all the hard work on this package (and thanks also to the other contributors, I know there have been several). It seems like Images now sits on much better foundations than other image processing frameworks I've seen (e.g. matlab, or anything in the python

[julia-users] Re: FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-02 Thread Jason Merrill
Really impressive. It's cool to see people implementing so many state of the art algorithms in Julia. On Monday, September 1, 2014 2:33:31 PM UTC-7, Alex Townsend wrote: I have written a package FastGauss.jl available here: https://github.com/ajt60gaibb/FastGauss.jl to compute Gauss

[julia-users] Re: FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-02 Thread Jason Merrill
On Monday, September 1, 2014 2:33:31 PM UTC-7, Alex Townsend wrote: I have written a package FastGauss.jl available here: https://github.com/ajt60gaibb/FastGauss.jl I am a Julia beginner (only been learning for 2 weeks) so I am assuming the code can be improved in a million and one

[julia-users] Re: FastGauss.jl: fast computation of Gauss quadrature rules

2014-09-02 Thread Jason Merrill
On Tuesday, September 2, 2014 5:57:43 AM UTC-7, Alex Townsend wrote: On Tuesday, 2 September 2014 03:00:10 UTC-4, Jason Merrill wrote: On Monday, September 1, 2014 2:33:31 PM UTC-7, Alex Townsend wrote: I have written a package FastGauss.jl available here: https://github.com/ajt60gaibb

[julia-users] [OT] v8 team implements trig functions in JS, ships, later implements them correctly

2014-08-28 Thread Jason Merrill
If you love the details of floating point math, may I humbly recommend reading https://code.google.com/p/v8/issues/detail?id=3006 This isn't so Julia related, per se, but I find it fascinating, and can't think of a better place to find other people who might also. Here's my TLDR: 1. Someone

Re: [julia-users] [OT] v8 team implements trig functions in JS, ships, later implements them correctly

2014-08-28 Thread Jason Merrill
On Thursday, August 28, 2014 4:46:24 PM UTC-7, Stefan Karpinski wrote: Someone once asked me about using JavaScript for numerical computing. Numerical computing with javascript is my day job: https://www.desmos.com/. I got interested in this whole saga because our unit tests started failing.

Re: [julia-users] Re: Can this magic square function be further optimized?

2014-08-26 Thread Jason Merrill
On Tuesday, August 26, 2014 3:11:51 AM UTC-7, Andreas Lobinger wrote: Oldschool julia users and developers have a tendency to discourage vectorized forms, but i'm still waiting for a convicing example to go for explicit loops in the general case. How long is it from the time a new language

Re: [julia-users] function version of

2014-08-20 Thread Jason Merrill
On Wednesday, August 20, 2014 3:22:07 PM UTC-7, Jeff Bezanson wrote: You know, it's interesting: it's easy to write down a grammar in formal language that is actually ambiguous. Code is not ambiguous. I think this was at least part of the motivation for PEGs. They are closer to modeling the

[julia-users] Re: Semi-OT: Recommendations for learning just enough C for Julia

2014-08-15 Thread Jason Merrill
On Friday, August 15, 2014 10:15:55 AM UTC-7, Randy Zwitch wrote: I know the standard recommendation of KR for people who want to learn C. But what would people's recommendations be to learn *just enough* C to be comfortable using C libraries from within Julia? The problem with KR isn't

[julia-users] N-Dimensional point set datastructure

2014-08-09 Thread Jason Merrill
I'm working on some algorithms that operate on a point set in N dimensions, and I'm most interested in small N. My first thought was to represent the points by a 1D array of some kind of Point type, with Point just being a type alias of NTuple{N, T}, or something morally equivalent. But now

Re: [julia-users] Re: Gadfly histogram woes

2014-08-03 Thread Jason Merrill
I just tried this out, and using Gadfly, RDatasets diamonds = dataset(ggplot2, diamonds) plot(diamonds, x=Carat, Geom.histogram) works for me with Gadfly 0.3.4, Julia 0.3.0-rc1, and IJulia 0.1.12. On Sunday, August 3, 2014 8:08:46 PM UTC-7, Dave Kleinschmidt wrote: Sorry, should

[julia-users] Re: ANN: EM algorithm for regularized L0 regression. More regreg Julia code out there?

2014-07-30 Thread Jason Merrill
This looks pretty awesome. In terms of simplicity, almost too good to be true, really. One comment: it might be faster and/or more stable to use backslash to solve a linear system instead of finding an explicit inverse, i.e. change line 57 from theta = xt_eta * inv(X * xt_eta .+

Re: [julia-users] Re: ANN: EM algorithm for regularized L0 regression. More regreg Julia code out there?

2014-07-30 Thread Jason Merrill
Jason Merrill jwme...@gmail.com: This looks pretty awesome. In terms of simplicity, almost too good to be true, really. One comment: it might be faster and/or more stable to use backslash to solve a linear system instead of finding an explicit inverse, i.e. change line 57 from

Re: [julia-users] Re: Correlation sparse array is very slow.

2014-07-28 Thread Jason Merrill
No. julia d=rand(10,3) 10x3 Array{Float64,2}: 0.933615 0.900428 0.601756 0.226293 0.57221 0.638165 0.466379 0.422646 0.0512318 0.974844 0.96944 0.576568 0.501572 0.708026 0.750814 0.387061 0.652366 0.533456 0.488878 0.527256 0.389493 0.70682 0.372663 0.291916 0.680118

[julia-users] specialized functions for unknown types

2014-07-06 Thread Jason Merrill
I believe that Julia's JIT already does this for generic functions. That is, when it encounters a new set of concrete argument types, it compiles a new specialized version of the function for those particular types.

[julia-users] Re: specialized functions for unknown types

2014-07-06 Thread Jason Merrill
Oh, right. I missed part of your point. Thanks for clarifying.

Re: [julia-users] Globals for Subset Sum

2014-06-25 Thread Jason Merrill
You could also use an inner function that closes over the array that you're pushing onto: function subsetsum(m::Int, n::Int, w::Array{Int,1}, x::Array{Bool,1}, s::Int, k::Int, r::Int) result = Array{Int}[] function inner(s, k, r) local j::Int = 0

[julia-users] Re: How quickly calculate distances arrays etc.

2014-05-25 Thread Jason Merrill
There are optimized distance calculations for a number of different metrics in Distance.jl: https://github.com/JuliaStats/Distance.jl On Sunday, May 25, 2014 1:42:15 AM UTC-7, paul analyst wrote: How quickly calculate distances arrays etc. This is an array of quotients, on the diagonal must

[julia-users] Re: Easy way to declare function works on array of floats

2014-05-25 Thread Jason Merrill
On Sunday, May 25, 2014 2:11:41 PM UTC-7, Adam Smith wrote: Actually, no. I'm not going to pretend this is a good thing. You're right that it is consistent and logical when you're using an academic type-correctness viewpoint. However, it is not consistent from a developer perspective, and

[julia-users] Re: Easy way to declare function works on array of floats

2014-05-25 Thread Jason Merrill
See also https://groups.google.com/forum/#!searchin/julia-users/invariance$20covariance$20contravariance for discussions of different possibilities for handling inheritance with typed parameters. I was convinced by Stefan's arguments there that Julia's invariance is the least bad strategy.

[julia-users] Re: how to Replicate array, translate from matlab

2014-05-16 Thread Jason Merrill
Julia has repmat. You can look up its methods like this: julia methods(repmat) # 3 methods for generic function repmat: repmat(a::AbstractArray{T,1},m::Int64) at abstractarray.jl:964 repmat(a::Union(AbstractArray{T,2},AbstractArray{T,1}),m::Int64) at abstractarray.jl:950

[julia-users] Re: Julia: First Month

2014-05-07 Thread Jason Merrill
Glad to hear that you've been enjoying picking up Julia. I've felt the same way about Julia having a more gradual on-ramp than some other cool languages. You don't have to wrap your head around a new paradigm to get started, but there are lots of nice advanced features waiting for you when

Re: [julia-users] Re: Julia: First Month

2014-05-07 Thread Jason Merrill
humans to write and read to express ideas, and the AST is designed to be easy for a human to work with through a machine. The transformation between is complex and not one to one. Ivar kl. 09:12:44 UTC+2 onsdag 7. mai 2014 skrev Jason Merrill følgende: Glad to hear that you've been

[julia-users] Re: Julia: First Month

2014-05-07 Thread Jason Merrill
and not one to one. Yes, exactly. homoiconic is not a synonym for good. It's a tradeoff between uniformity and expressiveness, or uniformity and readability, or uniformity and familiarity, or something like that. Ivar kl. 09:12:44 UTC+2 onsdag 7. mai 2014 skrev Jason Merrill følgende: Glad

[julia-users] Re: Extract variables from expression

2014-05-07 Thread Jason Merrill
Operationally, variables are Symbols in the parse tree, minus those occurring in e.g. the first argument of a :call expression or a :conditional expression, or some other special forms. You can get a feel for the structure of a parsed expression using head and args recursively: julia

[julia-users] Array/Cell - a useful distinction, or not?

2014-04-29 Thread Jason Merrill
Do you find yourself dealing with heterogeneous arrays often? It might be useful to post some examples where this comes up to the list. Julia compiles specialized versions of functions for the concrete types they are called with at run time, so you should usually think of the types in function

[julia-users] Array/Cell - a useful distinction, or not?

2014-04-29 Thread Jason Merrill
Suppose the types that you want existed. Let's call them ConcreteArray, and Cell. ConcreteArray gives the guarantee that all of it's elements are stored directly with a fixed stride. Can you give some examples of functions that would use these in their type signature?

[julia-users] Re: Array/Cell - a useful distinction, or not?

2014-04-29 Thread Jason Merrill
On Tuesday, April 29, 2014 9:29:56 AM UTC-7, Oliver Woodford wrote: On Tuesday, April 29, 2014 5:14:01 PM UTC+1, Jason Merrill wrote: Suppose the types that you want existed. Let's call them ConcreteArray, and Cell. ConcreteArray gives the guarantee that all of it's elements are stored

Re: [julia-users] Re: Help me optimize Stochastic Gradient Descent of Least Squares Error

2014-04-27 Thread Jason Merrill
On Sunday, April 27, 2014 12:04:26 AM UTC-7, Elliot Saba wrote: Since we have made sure that our for loops have the right boundaries, we can assure the compiler that we're not going to step out of the bounds of an array, and surround our code in the @inbounds macro. This is not something

Re: [julia-users] All packages for numerical math

2014-04-25 Thread Jason Merrill
On Thursday, April 24, 2014 11:57:33 PM UTC-7, Tomas Lycken wrote: And as soon as you start working with complex analysis, I'm not entirely sure the trapezoidal rule is valid at all. It might just be because the article author was lazy, but the Wikipedia article only talks about integrals

[julia-users] Re: A project for compact expressiveness

2014-04-14 Thread Jason Merrill
Number of tokens might be a more useful quantitative measure of concise code than number of characters. But there's no simple number that can substitute for good taste. On Monday, April 14, 2014 4:19:49 AM UTC-5, Mike Innes wrote: People often talk about code concision as if it's a simple

Re: [julia-users] Hyper-Dual numbers

2014-04-07 Thread Jason Merrill
John, Jeff has updated his source files with the MIT license and I've pasted those into the LICENSE file of the Julia package. Jason Merrill has also given good feedback that I'm still looking into. My interpretation of his feedback (a single package covering different hyper number types

  1   2   >