Re: [julia-users] Documentation in the source code

2014-12-05 Thread Viral Shah
Given that Docile.jl is almost compatible with the 0.4 stuff, we could even add it as a dependency to Compat.jl, so that package authors can start adding documentation that will work for 0.3, and will work on 0.4. Streamlining of package documentation will go a long way towards making stuff lik

Re: [julia-users] Avoiding allocation when writing to arrays of immutables

2014-12-05 Thread John Myles White
I think this might be a problem with Julia 0.3. I see it on Julia 0.3, but not on the development branch for Julia 0.4. — John On Dec 5, 2014, at 6:27 PM, Will Dobbie wrote: > Hi, > > I have a program which copies elements between two arrays of immutables in a > tight loop. The sizes of the

[julia-users] Avoiding allocation when writing to arrays of immutables

2014-12-05 Thread Will Dobbie
Hi, I have a program which copies elements between two arrays of immutables in a tight loop. The sizes of the arrays never change. I've been struggling to get it to avoid spending a large chunk of its time in the garbage collector. I have an example of what I mean below. With arrays of Int64 I

[julia-users] Re: How can I sort Dict efficiently?

2014-12-05 Thread Steven G. Johnson
On Friday, December 5, 2014 9:57:28 AM UTC-5, Michiaki Ariga wrote: > > I found there are no method such as sort_by() after v0.3. > But I want to count word frequency with Dict() and sort by its value to > find frequent word. > So, how can I sort Dict efficiently? > You may want to use a diffe

[julia-users] Re: Redefinition of type problem in IJulia an REPL

2014-12-05 Thread elextr
Putting words in the major developers mouths :) The "Julian" way is to have lots of small functions. Automatically exporting all those helper functions pollutes the namespace and increases the chance of name clashes with other packages. So "exportall" would also need an "unexport" or "local"

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

2014-12-05 Thread Matt Gushee
On Fri, Dec 5, 2014 at 5:22 PM, ivo welch wrote: > > On Fri, Dec 5, 2014 at 6:47 PM, Páll Haraldsson > wrote: >> >> what is it you want? Why is web-programming special? And wouldn't Julia be >> as least as good a fit (for server side) as any other language? > > I do not want to hijack the julia l

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

2014-12-05 Thread David Koslicki
Thanks for the suggestions: On Friday, December 5, 2014 5:40:57 PM UTC-8, Jason Merrill wrote: > > This is the best you can do if > > 1. Every input in your space of possibilities is equally likely, and > 2. You need to remember every input that you've seen > 3. You need to know the order you saw

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

2014-12-05 Thread Jameson Nash
Being able to suggest an appropriate compression algorithm would require knowing both how you intend to use the data (so that you don’t kill performance by packing the data wrong) and what the data looks like (where the “entropy” http://en.wikipedia.org/wiki/Entropy_%28information_theory%29 exists

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

2014-12-05 Thread Jason Merrill
This is the best you can do if 1. Every input in your space of possibilities is equally likely, and 2. You need to remember every input that you've seen 3. You need to know the order you saw them in If you just need to know "have I seen this input before," and you can accept some false positives

[julia-users] Re: Redefinition of type problem in IJulia an REPL

2014-12-05 Thread Greg Trzeciak
Hah, thanks for actually bothering to reply with such a simple mistake (in my proper code I exported with a typo and assumed export doesn't work in repl) Is there any paritcular reason why there is no "exportall"? On Saturday, December 6, 2014 12:17:51 AM UTC+1, ele...@gmail.com wrote: > > You

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

2014-12-05 Thread David Koslicki
Duly noted, though I did get my answer (no) pretty quickly! ;) Of course, the main problem is still an issue. But then again, it's kind of an "open problem" in bioinformatics (so I don't think this would be the correct forum to ask it in). I appreciate your help! On Friday, December 5, 2014 5:2

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

2014-12-05 Thread David Koslicki
Good suggestion, but I've tried that already, and besides the fact that the HDF5 package (https://github.com/timholy/HDF5.jl) doesn't yet support Int128, this would result in file sizes upwards of 750Gb (too large for my purposes). On Friday, December 5, 2014 5:19:00 PM UTC-8, Jason Merrill wro

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})

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

2014-12-05 Thread Jason Merrill
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. On Friday, December 5, 2014 5:13:49 PM UTC-8, David Koslicki wrote: > > I have strings (on the a

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

2014-12-05 Thread David Koslicki
I have strings (on the alphabet {A,C,T,G}) of length 30 to 50. I am trying to hash them to save on space (as I have a few million to billion of them). I know I should be using a bloom filter (http://en.wikipedia.org/wiki/Bloom_filter) or some other such space-saving data structure, but I'm too

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

2014-12-05 Thread David Koslicki
So a better question to ask would have been: "Is the built-in julia function for hashing strings a perfect hash function". I assume the answer is no... On Friday, December 5, 2014 5:08:08 PM UTC-8, John Myles White wrote: > > For specialized cases it is possible to achieve 1-1-ness: > http://en

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

2014-12-05 Thread Jason Merrill
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 cases it is possible to achieve 1-1-ness: > http://en.wikipedia.org/wiki/Perfect_hash_func

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

2014-12-05 Thread John Myles White
For specialized cases it is possible to achieve 1-1-ness: http://en.wikipedia.org/wiki/Perfect_hash_function But this is not something that most people aspire to do for most types since 1-1-ness isn't essential in most applications and is costly to achieve. -- John On Dec 5, 2014, at 5:03 PM,

Re: [julia-users] Struggling with generic functions.

2014-12-05 Thread John Myles White
StatsBase is meant to occupy that sort of role, but there's enough disagreement that we haven't moved as far foward as I'd like. Have you read through the StatsBase codebase? -- John On Dec 2, 2014, at 8:19 PM, Rob J. Goedman wrote: > Thanks John, I’d come to a similar conclusion about there

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

2014-12-05 Thread David Koslicki
Ah, of course! I was hoping that on certain 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 repr

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: https://en.wikipedia.org/wiki/Pigeonhole_principle

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

2014-12-05 Thread John Myles White
This function is impossible to write in generality since hash functions aren't one-to-one. -- John On Dec 5, 2014, at 4:32 PM, David Koslicki wrote: > Hello, > > Is there a built in function that will undo hash()? > > i.e. I am looking for a function "dehash()" such that > dehash(hash("ACTG

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

2014-12-05 Thread David Koslicki
Hello, Is there a built in function that will undo hash()? i.e. I am looking for a function "dehash()" such that dehash(hash("ACTG")) == "ACTG" I can't seem to find this anywhere (documentation, google, this user group, etc). Thanks, ~David

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

2014-12-05 Thread ivo welch
On Fri, Dec 5, 2014 at 6:47 PM, Páll Haraldsson wrote: > All joking aside, you got me intrigued. If there is no good language, then > what is it you want? Why is web-programming special? And wouldn't Julia be > as least as good a fit (for server side) as any other language? > ​I do not want to h

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-05 Thread elextr
Have had the same problem with other open source projects I participate in, they spam anybody prominent on the ML or github. The resulting books seem to contain large parts consisting of the projects manuals, often verbatim. Cheers Lex On Saturday, December 6, 2014 3:45:19 AM UTC+10, Stefan Ka

[julia-users] Re: Redefinition of type problem in IJulia an REPL

2014-12-05 Thread elextr
You didn't export Foo from the module. Cheers Lex On Saturday, December 6, 2014 3:23:26 AM UTC+10, Greg Trzeciak wrote: > > While developing in IJulia notebook (and REPL) if I need to redefine a > type I am informed of "invalid redefinition of constant". According to > http://julia.readthedocs.

Re: [julia-users] Selecting all items in array larger than a given number

2014-12-05 Thread ggggg
> > *julia> **testarray2=testarray[testarray.>0.1]* > > *2-element Array{Float64,1}:* > > * 0.2* > > * 0.3* > Note the .> which is the broadcasting version of >

Re: [julia-users] Selecting all items in array larger than a given number

2014-12-05 Thread Tracy Wadleigh
r/find/filter/ On Fri, Dec 5, 2014 at 5:32 PM, wrote: > Hi, > > Quick question. > > Say I have an array > > testarray = [0.1,0.2,0.3] > > > Now, using an array comprehension, how could I create an array featuring > all members of testarray > 0.1? > > I tried > > testarray2 = [testarray[i] > 0.1

[julia-users] Selecting all items in array larger than a given number

2014-12-05 Thread yaoismyhero
Hi, Quick question. Say I have an array testarray = [0.1,0.2,0.3] Now, using an array comprehension, how could I create an array featuring all members of testarray > 0.1? I tried testarray2 = [testarray[i] > 0.1 for i=1:length(testarray)] and testarray2 = find(x -> x > 0.1,testarray) b

[julia-users] Initializing a SharedArray Memory Error

2014-12-05 Thread benFranklin
Hi all, I'm trying to figure out how to best initialize a SharedArray, using a C function to fill it up that computes a huge matrix in parts, and all comments are appreciated. To summarise: Is A, making an empty shared array, computing the matrix in parallel using pmap and then filling it up se

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

2014-12-05 Thread Jeff Waller
On Friday, December 5, 2014 12:43:20 PM UTC-5, Steven G. Johnson wrote: > > On Friday, December 5, 2014 9:57:42 AM UTC-5, Sebastian Nowozin wrote: >> >> I find Julia great, but for the technical computing goal, my biggest >> grime with Julia (0.3.3 and 0.4.0-dev) at the moment is the lack of sim

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Tim Holy
No cheating! --Tim On Friday, December 05, 2014 08:50:36 PM Mike Innes wrote: > I can close that issue for a case of beer, although I can't promise to > actually fix it. > > On 5 December 2014 at 20:49, Tim Holy wrote: > > Sounds like a bargain...count me in for a bottle. > > > > --Tim > > >

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Mike Innes
I can close that issue for a case of beer, although I can't promise to actually fix it. On 5 December 2014 at 20:49, Tim Holy wrote: > Sounds like a bargain...count me in for a bottle. > > --Tim > > On Friday, December 05, 2014 03:22:18 PM Stefan Karpinski wrote: > > Make it a bottle of bourbon

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Tim Holy
Sounds like a bargain...count me in for a bottle. --Tim On Friday, December 05, 2014 03:22:18 PM Stefan Karpinski wrote: > Make it a bottle of bourbon and we're talking. > > On Fri, Dec 5, 2014 at 3:21 PM, Jameson Nash wrote: > > I'll buy you a case of beer if you can close that issue > > > >

Re: [julia-users] Documentation in the source code

2014-12-05 Thread Mike Innes
I'll add some meta-documentation to the manual for this soon. On 5 December 2014 at 19:58, John Myles White wrote: > Documentation is undergoing a shift as 0.4 will be the first release with > built-in documentation tools. Check the GitHub issues for details about the > upcoming @doc macro. > >

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread cdm
looking forward to reflecting on Julia's youth ... "remember back in '15, when Karpinski killed the infamous Bezanson Bourbon Bounty Bug ? ... those were the days." go well, mate. cdm On Friday, December 5, 2014 12:23:00 PM UTC-8, Stefan Karpinski wrote: > > Make it a bottle of bourbon and w

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Stefan Karpinski
Make it a bottle of bourbon and we're talking. On Fri, Dec 5, 2014 at 3:21 PM, Jameson Nash wrote: > I'll buy you a case of beer if you can close that issue > > On Fri, Dec 5, 2014 at 2:58 PM Stefan Karpinski > wrote: > >> https://github.com/JuliaLang/julia/issues/265 – I'd really like to fix >

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Jameson Nash
I'll buy you a case of beer if you can close that issue On Fri, Dec 5, 2014 at 2:58 PM Stefan Karpinski wrote: > https://github.com/JuliaLang/julia/issues/265 – I'd really like to fix > this. > > On Fri, Dec 5, 2014 at 2:09 PM, Páll Haraldsson > wrote: > >> >> >> On Friday, December 5, 2014 5:25

Re: [julia-users] Documentation in the source code

2014-12-05 Thread John Myles White
Documentation is undergoing a shift as 0.4 will be the first release with built-in documentation tools. Check the GitHub issues for details about the upcoming @doc macro. -- John On Dec 5, 2014, at 10:40 AM, Petr Krysl wrote: > Hello, > > Does anyone know how the document functions and typ

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Stefan Karpinski
https://github.com/JuliaLang/julia/issues/265 – I'd really like to fix this. On Fri, Dec 5, 2014 at 2:09 PM, Páll Haraldsson wrote: > > > On Friday, December 5, 2014 5:25:18 PM UTC, Steven G. Johnson wrote: >> >> There is no runtime overhead in cases where the types are known at >> compile time.

[julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Páll Haraldsson
On Friday, December 5, 2014 5:25:18 PM UTC, Steven G. Johnson wrote: > > There is no runtime overhead in cases where the types are known at compile > time. > Be aware of one thing, say you define: f(x, y) = 1 + 2p(x)y; p(x) = 2x^2 + 1; You will get the same code even as if you defined p first

[julia-users] Documentation in the source code

2014-12-05 Thread Petr Krysl
Hello, Does anyone know how the document functions and types (and modules) in the "Julia style"? I looked at the source code for some of the Base functions and I couldn't really find any documentation attached to those functions. Thanks, Petr

Re: [julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Stefan Karpinski
If you do end up in a situation where type inference can't figure out what method to call, dispatch can get kind of slow, but it's still comparable to method calls in Python or Ruby. It turns out that by expressing polymorphic behaviors with multiple dispatch, the programmer somewhat unwittingly pr

Re: [julia-users] julia literals for bittypes

2014-12-05 Thread Stefan Karpinski
Hex literals are unsigned and take their size from the number of digits. On Fri, Dec 5, 2014 at 10:24 AM, John Myles White wrote: > 0x03 > > — John > > On Dec 5, 2014, at 3:17 AM, Francesco wrote: > > > When I write: > > > > julia> x = 3 > > > > I assign to x a Int64 by default. > > > > julia>

Re: [julia-users] why are variables not local by default?

2014-12-05 Thread Stefan Karpinski
What would you expect an assignment at global scope to do? If it created a local variable, what scope would it be local to? On Fri, Dec 5, 2014 at 8:41 AM, John Drummond wrote: > Thanks. I missed a couple of those links, though I did try seaching. > Yes I'd read the last performance tips, but wh

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-05 Thread Stefan Karpinski
Yes, as the contact has been so relentlessly spammy, I've started to treat it as spam. On Fri, Dec 5, 2014 at 12:23 PM, Iain Dunning wrote: > I also refused to review for them, both in this new wave of spam and the > previous one, on the basis that I don't think such a book should exist > (yet).

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

2014-12-05 Thread Steven G. Johnson
On Friday, December 5, 2014 9:57:42 AM UTC-5, Sebastian Nowozin wrote: > > I find Julia great, but for the technical computing goal, my biggest grime > with Julia (0.3.3 and 0.4.0-dev) at the moment is the lack of simple > OpenMP-style parallelism. > See the discussion at: https://github.c

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

2014-12-05 Thread Páll Haraldsson
On Friday, December 5, 2014 4:58:44 PM UTC, Mike Innes wrote: > > I suspect Tim's idea was to help out by closing issues, not by opening > them. > I guess :) I took a look and there were pages of issues (including the PhD one.. :) You seem to have succeeded in making an awesome language. I'm

[julia-users] Re: How should one think about cost of multiple dispatch?

2014-12-05 Thread Steven G. Johnson
There is no runtime overhead in cases where the types are known at compile time. In terms of performance, the key thing to understand about Julia is: * The first time you call a function f(x,y) with a given set of argument types, Julia compiles a new version of f that is specialized (partially

[julia-users] Redefinition of type problem in IJulia an REPL

2014-12-05 Thread Greg Trzeciak
While developing in IJulia notebook (and REPL) if I need to redefine a type I am informed of "invalid redefinition of constant". According to http://julia.readthedocs.org/en/latest/manual/faq/ the types in module Main cannot be redefined and as a workaround it suggests wrapping the code inside

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-05 Thread Iain Dunning
I also refused to review for them, both in this new wave of spam and the previous one, on the basis that I don't think such a book should exist (yet). I also felt that by being a reviewer, I'm authorizing the use of my name for a product I have no control over (they can just ignore what you say)

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

2014-12-05 Thread Jeff Waller
On Friday, December 5, 2014 5:47:15 AM UTC-5, Páll Haraldsson wrote: > > > > On Friday, December 5, 2014 1:11:12 AM UTC, ivo welch wrote: >> >> >> there are no good web development language environments (server, browser) >> IMHO, and julia will not fit this bill, either. >> > > You are forgettin

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

2014-12-05 Thread Mike Innes
I suspect Tim's idea was to help out by closing issues, not by opening them. On 5 December 2014 at 15:36, Páll Haraldsson wrote: > > > On Friday, December 5, 2014 2:39:11 PM UTC, Tim Holy wrote: >> >> I'm glad you're enthusiastic about Julia. If you're looking to pitch in, >> one >> good place t

Re: [julia-users] Re: Julia as a matlab mex function (and the struggle for independence from cygwin)

2014-12-05 Thread Tim Holy
Sounds good. It would be for interop in both ways, then. --Tim On Friday, December 05, 2014 08:40:39 AM Tracy Wadleigh wrote: > Rather than doing my own package, I think it makes more sense to try to add > this functionality to the existing MATLAB.jl package, where, for instance, > they already h

Re: [julia-users] How should one think about cost of multiple dispatch?

2014-12-05 Thread Isaiah Norton
Jeff talked about some of the implementation details in his JuliaCon presentation (see around :22 and :29 at least): https://www.youtube.com/watch?v=osdeT-tWjzk At a slightly higher level, Stefan's notebook is very informative: http://nbviewer.ipython.org/gist/StefanKarpinski/b8fe9dbb36c1427b9f22

[julia-users] How should one think about cost of multiple dispatch?

2014-12-05 Thread Ronald L. Rivest
Multiple dispatch is a unique and interesting feature of Julia... How is it implemented? What is the overhead incurred by multiple dispatch? (Esp. if there are a large number of methods, as for "+" ?). Cheers, Ron

Re: [julia-users] How should one think about cost of multiple dispatch?

2014-12-05 Thread John Myles White
I think you'll want an answer from Stefan, Jeff, Keno, Jameson or Viral to get a better review, but my sense is that multiple dispatch is primarily costly at compile time and pays close to zero cost at run-time. Within a function body, if the types of variables don't change, then the choice of w

Re: [julia-users] Re: Julia as a matlab mex function (and the struggle for independence from cygwin)

2014-12-05 Thread Tracy Wadleigh
Rather than doing my own package, I think it makes more sense to try to add this functionality to the existing MATLAB.jl package, where, for instance, they already have mxArray marshaling.

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-05 Thread Jacob Quinn
Sorry to hear that Evan. I'll look out for that. -Jacob On Fri, Dec 5, 2014 at 10:47 AM, cdm wrote: > > gratis or libre ... ? > > On Thursday, December 4, 2014 5:35:52 PM UTC-8, John Myles White wrote: >> >> I hate to say it, but Packt's handling of its Julia publications is >> rather troubling

Re: [julia-users] type conversion in array comprehension

2014-12-05 Thread Kevin Squire
It might just be that you're working in global scope, where the compiler isn't able to verify that the type of k won't change. What happens when you wrap that code in a function? Hopefully this behavior will change eventually (see https://github.com/JuliaLang/julia/issues/8870), since it's asked

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-05 Thread cdm
gratis or libre ... ? On Thursday, December 4, 2014 5:35:52 PM UTC-8, John Myles White wrote: > > I hate to say it, but Packt's handling of its Julia publications is rather > troubling. I received a request to review this book and told them I wasn't > free, but the truth is that I would prefer

Re: [julia-users] Re: DataFrames and NamedArrays: are they suitable for heavier computations ?

2014-12-05 Thread Tom Short
For DataFrames, it depends on what you want to do. It is difficult to get performance with DataArrays as columns using the current implementation. With the ongoing work by John Myles White on the use of a Nullable type, that should be much better. Also, you can use standard Arrays as columns of a D

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

2014-12-05 Thread Páll Haraldsson
On Friday, December 5, 2014 2:39:11 PM UTC, Tim Holy wrote: > > I'm glad you're enthusiastic about Julia. If you're looking to pitch in, > one > good place to look is the list of open issues: > https://github.com/JuliaLang/julia/issues > If you're most interested in "features," filtering on t

Re: [julia-users] Inferring constructor parameters from parameters of arguments

2014-12-05 Thread Tim Holy
When you create an inner constructor, it deletes all default constructors. So you have to provide the default outer constructor: TLPixel{T}(img:Image{T}) = TLPixel{T}(img) Despite appearances, {T} on the left hand side is very different from {T} on the right: on the left it's acting as a pa

Re: [julia-users] Inferring constructor parameters from parameters of arguments

2014-12-05 Thread Mauro
you have to provide an outer constructor as well when you define an inner one. This is a bit confusing, have a look at the manual & search the list. Here using your example using Arrays as I don't know Images: type TLPixel{T} data::T function TLPixel(img::Array{T}) new(img[1])

Re: [julia-users] Reviewing a Julia programming book for Packt

2014-12-05 Thread Evan Miller
Another reason to serve as a reviewer: to see if any passages look "familiar." There's a Packt book about Nginx development that extensively plagiarizes material from my website. The book is niche enough that I haven't bothered seeking damages, but they've been very non-helpful after many emails.

Re: [julia-users] julia literals for bittypes

2014-12-05 Thread John Myles White
0x03 — John On Dec 5, 2014, at 3:17 AM, Francesco wrote: > When I write: > > julia> x = 3 > > I assign to x a Int64 by default. > > julia> typeof(x) > Int64 > > Let say that 3 should be Uint8, then I write: > julia> x = convert(Uint8, 3) > > Is there a more idiomatic way of doing it? > Ma

Re: [julia-users] julia literals for bittypes

2014-12-05 Thread Michele Zaffalon
uint8(3) See here: http://julia.readthedocs.org/en/release-0.3/manual/integers-and-floating-point-numbers/ On Fri, Dec 5, 2014 at 12:17 PM, Francesco wrote: > When I write: > > julia> x = 3 > > I assign to x a Int64 by default. > > julia> typeof(x) > Int64 > > Let say that 3 should be Uint8, t

[julia-users] julia literals for bittypes

2014-12-05 Thread Francesco
When I write: julia> x = 3 I assign to x a Int64 by default. julia> typeof(x) Int64 Let say that 3 should be Uint8, then I write: julia> x = convert(Uint8, 3) Is there a more idiomatic way of doing it? Maybe with literals?

[julia-users] type conversion in array comprehension

2014-12-05 Thread Andrew Ellis
I'm trying to construct an array of Dicts (Dict{Symbol,Any}, to be used as initial values for MCMC chains by the Mamba package). The following problem doesn't appear to have anything to do with Mamba, though. julia> using Distributions The following works, i.e. autoamatic conversion works: r

[julia-users] How can I sort Dict efficiently?

2014-12-05 Thread Michiaki Ariga
Hi, I have a question about Dict(). I found there are no method such as sort_by() after v0.3. But I want to count word frequency with Dict() and sort by its value to find frequent word. So, how can I sort Dict efficiently? Of course, I know sort using DataFrame like following, ``` counts = Dict

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

2014-12-05 Thread Sebastian Nowozin
Hi, I find Julia great, but for the technical computing goal, my biggest grime with Julia (0.3.3 and 0.4.0-dev) at the moment is the lack of simple OpenMP-style parallelism. There is DArray and pmap, but they have large communication overheads for shared-memory parallelism, and also, quite fra

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

2014-12-05 Thread Tamas Papp
On Fri, Dec 05 2014, Páll Haraldsson wrote: > Yes I did read it. Note, I meant would you still recommend (Common) Lisp > for anything, you seem to argue well for Julia (and against > "Lisp"/S-expressions while you're at it?). Note also, I said "would you Sure -- for example, if I wanted a lan

[julia-users] Re: [ANN - SolveDSGE] A Julia package to solve DSGE models

2014-12-05 Thread Stéphane Adjemian
Hi, Actually we do plan in the coming months to add the possibility for the Dynare preprocessor to write the dynamic and static DSGE models with the julia language. These routines are used to compute the steady state of the model, and evaluate the jacobian and hessian matrices of the model (needed

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

2014-12-05 Thread Tim Holy
I'm glad you're enthusiastic about Julia. If you're looking to pitch in, one good place to look is the list of open issues: https://github.com/JuliaLang/julia/issues If you're most interested in "features," filtering on the "up for grabs" label might be a good start. Best, --Tim On Friday, Dece

[julia-users] Inferring constructor parameters from parameters of arguments

2014-12-05 Thread Andrew Gibb
I want to create a parametric type whose parameter is inferred from the parameter of an argument. A toy example: using Images type TLPixel{T} data::T function TLPixel(img::Image{T}) new(img.data[1,1]) end end If I do this: julia> tlp = TLPixel{typeof(img.data[1,1])}(img) T

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

2014-12-05 Thread Páll Haraldsson
On Friday, December 5, 2014 11:34:46 AM UTC, Tamas Papp wrote: > > > On Fri, Dec 05 2014, Páll Haraldsson > > wrote: > > > On Friday, December 5, 2014 8:54:26 AM UTC, Tamas Papp wrote: > >> > >> I find your aversion to femtolisp difficult to understand, probably > >> because I tend to think

Re: [julia-users] why are variables not local by default?

2014-12-05 Thread John Drummond
Thanks. I missed a couple of those links, though I did try seaching. Yes I'd read the last performance tips, but what I hadn't found was why it wasn't harder to have global variables or in what cases they'd be essential. On Friday, December 5, 2014 1:06:19 PM UTC, Isaiah wrote: > > See the disc

Re: [julia-users] Re: DataFrames and NamedArrays: are they suitable for heavier computations ?

2014-12-05 Thread Tim Holy
The new SubArrays steal mercilessly from the good ideas of both the old SubArray and ArrayViews, and then add some new tricks of their own. In theory, they should be a strict improvement on both of their predecessors. --Tim On Friday, December 05, 2014 05:13:28 AM David van Leeuwen wrote: > So

Re: [julia-users] Re: DataFrames and NamedArrays: are they suitable for heavier computations ?

2014-12-05 Thread David van Leeuwen
So what is the relation between ArrayViews and 0.4 `SubArray revamp'? Are they targeting different use cases or is one of them going to be phased out? On Friday, December 5, 2014 1:28:16 PM UTC+1, Tim Holy wrote: > > In 0.4, the views are a revamp of SubArray. So if NamedArrays already > int

Re: [julia-users] why are variables not local by default?

2014-12-05 Thread Isaiah Norton
See the discussions in http://julia.readthedocs.org/en/release-0.3/manual/performance-tips/ https://github.com/JuliaLang/julia/issues/524 https://github.com/JuliaLang/julia/issues/8870 (and elsewhere) On Fri, Dec 5, 2014 at 7:13 AM, John Drummond wrote: > I suspect I'm missing something here. >

Re: [julia-users] Decreasing rate of return on number of blas threads

2014-12-05 Thread Johan Sigfrids
This was first released in AMD's Bulldozer architecture in 2011. I believe, and this is speculation on my part, that the long term goal AMD is working toward are heterogeneous CPUs. This would be a CPU where you have a pile of high performance integer cores working similar to cores on CPUs today

Re: [julia-users] Re: DataFrames and NamedArrays: are they suitable for heavier computations ?

2014-12-05 Thread Tim Holy
In 0.4, the views are a revamp of SubArray. So if NamedArrays already interacts well with SubArrays, you're basically set. FYI the implementation in 0.4 is largely backwards-compatible, but there are some important differences. If you need to dig into the internal implementation of SubArrays, y

[julia-users] Re: DataFrames and NamedArrays: are they suitable for heavier computations ?

2014-12-05 Thread David van Leeuwen
Hi, On Friday, December 5, 2014 8:47:22 AM UTC+1, Ján Dolinský wrote: > > Hi, > > I am exploring DataFrames and NamedArrays packages and I would like to ask > whether their are suitable for heavier computations and whether I can use > them directly in BLAS calls (e.g. gemv() etc.). In addition,

[julia-users] why are variables not local by default?

2014-12-05 Thread John Drummond
I suspect I'm missing something here. I had a simple script to strip out nuls from a text file. placing a let at the beginning and end at the end resulted in a 70 times speed up. I'm wondering what the reason is that there isn't the equivalent of a let end wrapped around everything, and where g

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

2014-12-05 Thread Tamas Papp
On Fri, Dec 05 2014, Páll Haraldsson wrote: > On Friday, December 5, 2014 8:54:26 AM UTC, Tamas Papp wrote: >> >> I find your aversion to femtolisp difficult to understand, probably >> because I tend to think of Julia as a Lisp with the following key >> features: >> > > I don't really have an

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

2014-12-05 Thread Páll Haraldsson
On Friday, December 5, 2014 8:54:26 AM UTC, Tamas Papp wrote: > > I find your aversion to femtolisp difficult to understand, probably > because I tend to think of Julia as a Lisp with the following key > features: > I don't really have an aversion to femtolisp. I understand it's an awesome i

Re: [julia-users] Re: what's the best way to do R table() in julia? (why does StatsBase.count(x,k) need k?)

2014-12-05 Thread David van Leeuwen
With the danger that this thread becomes slightly off-topic, I would just want to add that I believe that most of the issues raised w.r.t. NamedArrays are addressed in NamedArrays v0.4.0, which is now in METATDATA. Specifically, - the type is now parameterized by its member variable types for

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

2014-12-05 Thread Páll Haraldsson
On Friday, December 5, 2014 1:11:12 AM UTC, ivo welch wrote: > > > there are no good web development language environments (server, browser) > IMHO, and julia will not fit this bill, either. > You are forgetting PHP :) All joking aside, you got me intrigued. If there is no good language, then

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

2014-12-05 Thread Tamas Papp
I find your aversion to femtolisp difficult to understand, probably because I tend to think of Julia as a Lisp with the following key features: 1) a focus on being heavily optimizable, 2) infix/M-expression-like surface syntax. But given these two (very important) differences, I find Julia very,

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

2014-12-05 Thread Tamas Papp
On Fri, Dec 05 2014, ivo welch wrote: > the most immediate problems for using julia in teaching (instead of R) are > (a) the lack of local experts and (b) the lack of books. perl won out > around here because of two books: Learning Perl and the Perl Cookbook. I > can't emphasize enough how m