Re: [julia-users] Re: The "then" keyword

2014-03-21 Thread Chris Foster
Given the similarity in syntax, I'd expect it to behave the same as a normal if ... end On Sat, Mar 22, 2014 at 12:05 PM, Jacob Quinn wrote: > What would return from the statement if it were false? nothing? Like if I > use it assigning a variable? I definitely see the attraction as a one liner >

Re: [julia-users] Type Parameter Scope Inconsistency?

2014-03-21 Thread Jameson Nash
It can take a bit of work to get this just right. In many cases, it is not worthwhile to check that the types are the same (to allow duck-typing). But I use the following code pattern to accomplish what you were trying for: type Bar{T} x::T end type Foo{B<:Bar, V<:Vector} y::Vector{B}

Re: [julia-users] Re: The "then" keyword

2014-03-21 Thread Jacob Quinn
What would return from the statement if it were false? nothing? Like if I use it assigning a variable? I definitely see the attraction as a one liner though. -Jacob On Mar 21, 2014 9:52 PM, "Chris Foster" wrote: > On Sat, Mar 22, 2014 at 9:23 AM, Stefan Karpinski > wrote: > > I kind of like tha

Re: [julia-users] Re: The "then" keyword

2014-03-21 Thread Chris Foster
On Sat, Mar 22, 2014 at 9:23 AM, Stefan Karpinski wrote: > I kind of like that idea, actually. > > On Fri, Mar 21, 2014 at 5:10 PM, Matt Bauman wrote: >> >> I quickly acclimated to Stefan's && idiom and now happily read and write >> code containing it. That said, it did throw me for a loop when

Re: [julia-users] Re: Not fun

2014-03-21 Thread ronubi
*The replace() function is pretty cool, but for this case all we need is indexing and concatenation:* *julia> **s = "I am a scientist."* *"I am a scientist."* *julia> **s = s[1:7] * "scholar" * s[end:end]* *"I am a scholar."*

Re: [julia-users] Re: The "then" keyword

2014-03-21 Thread Stefan Karpinski
I kind of like that idea, actually. On Fri, Mar 21, 2014 at 5:10 PM, Matt Bauman wrote: > I quickly acclimated to Stefan's && idiom and now happily read and write > code containing it. That said, it did throw me for a loop when first > learning the language. I'm not too big of a fan of reserv

Re: [julia-users] Re: Not fun

2014-03-21 Thread Stefan Karpinski
You're assuming that strings are specifically for holding sentences, which is not the case. That's one possible use case, but certainly not the only one. If you want to do this sort of thing, using a mutable array of words seems much more appropriate anyway. You can easily wrap this in a Sentence t

Re: [julia-users] Type Parameter Scope Inconsistency?

2014-03-21 Thread Jarrett Revels
I also made a typo in my question; the parameter I'm referring to is the parameter of Vector in x, i.e. T in x::Dict{Int, Vector{T}}. On Friday, March 21, 2014 5:44:19 PM UTC-4, Jarrett Revels wrote: > > Here's a gist clarifying what I'm trying to do in my second question: > https://gist.github.

Re: [julia-users] Type Parameter Scope Inconsistency?

2014-03-21 Thread Jarrett Revels
Here's a gist clarifying what I'm trying to do in my second question: https://gist.github.com/jrevels/9697093 > >>

Re: [julia-users] Re: Not fun

2014-03-21 Thread cnbiz850
Well in that example, you can always replace "scientist" with "scholar". But if I want to say "Am I also a scholar?" after thinking of saying "I am a scientist". Sure that can be handled also without much difficulty. So perhaps you can say "whether the string is mutable or not has no serious

Re: [julia-users] Re: Not fun

2014-03-21 Thread Keno Fischer
Perhaps the right thing to do here then is to make replace accept a range of characters to replace: str = "I am a scientist" replace(str,8:16,"scholar") ? On Fri, Mar 21, 2014 at 5:21 PM, Milan Bouchet-Valat wrote: > Le samedi 22 mars 2014 à 05:08 +0800, cnbiz850 a écrit : > > Well, from this

Re: [julia-users] Re: Not fun

2014-03-21 Thread Milan Bouchet-Valat
Le samedi 22 mars 2014 à 05:08 +0800, cnbiz850 a écrit : > Well, from this perspective, it makes sense why those strings should not > be mutable. > > But from other perspectives, making strings immutable contradicts with > how natural languages are used. For instance, after I said "I am a > pr

Re: [julia-users] Re: The "then" keyword

2014-03-21 Thread Matt Bauman
I quickly acclimated to Stefan's && idiom and now happily read and write code containing it. That said, it did throw me for a loop when first learning the language. I'm not too big of a fan of reserving another keyword for an optional syntax… but I could perhaps support its inclusion if it we

Re: [julia-users] Re: Not fun

2014-03-21 Thread cnbiz850
Well, from this perspective, it makes sense why those strings should not be mutable. But from other perspectives, making strings immutable contradicts with how natural languages are used. For instance, after I said "I am a professor", I want to say "I am a scientist", or perhaps I change my

Re: [julia-users] Re: The "then" keyword

2014-03-21 Thread Stefan Karpinski
On the other hand, saying "4 == 2 + 2 or go home" is perfectly reasonable ;-) On Thu, Mar 20, 2014 at 6:47 PM, John Myles White wrote: > To me, this actually explains why the i == 1 && do_stuff() idiom feels so > unnatural: you'd never mix a declarative statement with an imperative > statement i

Re: [julia-users] Re: Remaining GSoC projects

2014-03-21 Thread Stefan Karpinski
Yes, I think that's a really great idea. I'll change the URL from /gsoc/2014 to /projects once we've decided on which projects we can fund (sadly it won't be nearly enough of them) and then for next year, we can just keep using the /projects URL and it will already be nicely put together and curate

Re: [julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Ivar Nesje
3 sections is appropriate * About Julia * Using Julia * Using Julia, but non free access (if we are going to list those at all). kl. 21:40:37 UTC+1 fredag 21. mars 2014 skrev Stefan Karpinski følgende: > > I think we should split the publications page into two sections: papers > about Julia at th

Re: [julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Stefan Karpinski
I think we should split the publications page into two sections: papers about Julia at the top and papers using Julia below. On Fri, Mar 21, 2014 at 4:35 PM, Tobias Knopp wrote: > At some point we probably should start thinking about initiating a > scientific journal around Julia. > There might

Re: [julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Tobias Knopp
At some point we probably should start thinking about initiating a scientific journal around Julia. There might be already enough momentum for such a thing given how many academic people are around here. Am Freitag, 21. März 2014 21:17:43 UTC+1 schrieb Isaiah: > > Could just use existing Publica

Re: [julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Jonathan Malmaud
Levi is the an author on the Foulds paper I mentioned, so maybe that's what you're thinking of. I gather Simon Kornblith and and Tim Holy are using Julia for experimental neuroscience data analysis, so obviously the lead time for any publications that result from that will be longer than the machi

Re: [julia-users] Re: Not fun

2014-03-21 Thread Stefan Karpinski
On Fri, Mar 21, 2014 at 12:12 PM, J Luis wrote: > I too want acknowledge all your work to explain why things work the way > they do. But I want also say that I did read the docs before asking. It > just happened that I missed that first part on the "Strings" that talk > about strings immutability

Re: [julia-users] Re: Not fun

2014-03-21 Thread Stefan Karpinski
Sure, there are always exceptions. In that particular case, you may want to work with the data as mutable arrays of bytes, rather than as strings. Did you want to replace the 16th byte or replace the *character* starting at the 16th byte? What if that's a multibyte character? What if the 16th byte

Re: [julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Isaiah Norton
Could just use existing Publications page and add categories "About Julia" vs "Using Julia" There's also: http://ieee-hpec.org/2013/index_htm_files/49.pdf (which falls somewhere between the two categories) On Fri, Mar 21, 2014 at 4:08 PM, Jonathan Malmaud wrote: > Ya, that > works

Re: [julia-users] Re: Scientific papers using Julia

2014-03-21 Thread John Myles White
I think there should also be another paper with Levi Boyles as an author. -- John On Mar 21, 2014, at 1:08 PM, Jonathan Malmaud wrote: > Ya, that works. Out of the published papers that use Julia for numeric > computing, and cite the main Julia paper, we have > > Foulds, James, et al. "Stoch

[julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Jonathan Malmaud
Ya, that works. Out of the published papers that use Julia for numeric computing, and cite the main Julia paper, we have - Foulds, James, et al. "Stochastic collapsed variational Bayesian inferen

Re: [julia-users] Re: [UCIMLRepo] New package for downloading datasets from UCI ML repositories

2014-03-21 Thread Siddhant Jain
Hello Jiahao, Thank you for your response. I have submitted my application. Please let me know if you have any query/feedback regarding the application. Thank you. Siddhant Jain

[julia-users] Re: Html Templating - Inquiry

2014-03-21 Thread Keith Campbell
One templating library that is available is @jverzani's Mustache.jl is a Julia version of Mustache, available at https://github.com/jverzani/Mustache.jl. On Friday, March 21, 2014 3:10:27 PM UTC-4, Joseph Curtin wrote: > > Hello All, > > Has anyone seen anything like jinja2 in the Julia-Ecosyst

[julia-users] Html Templating - Inquiry

2014-03-21 Thread Joseph Curtin
Hello All, Has anyone seen anything like jinja2 in the Julia-Ecosystem? ( https://github.com/mitsuhiko/jinja2 ) If there isn't one yet; I'll build an engine or implement the support for jinja2 in julia. How many of you are interested in a templating library and what features would you want it to

[julia-users] writedlm problem

2014-03-21 Thread Eythan Weg
Hi, I think this should work: julia> a=["a" "b"; "d" ""] 2x2 Array{ASCIIString,2}: "a" "b" "d" "" julia> writedlm("/tmp/data.tsv", a) ERROR: BoundsError() in writedlm_cell at datafmt.jl:301 in writedlm at datafmt.jl:314 in anonymous at datafmt.jl:353 in open at io.jl:368 in writedlm a

[julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Ivar Nesje
I realised that about 10 seconds after pushing send. Strange how doing something irreversible clears the mind. You might search for citations of those two papers. Ivar kl. 19:19:11 UTC+1 fredag 21. mars 2014 skrev Jonathan Malmaud følgende: > > Well, those are papers about Julia. I meant papers

[julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Jonathan Malmaud
Well, those are papers about Julia. I meant papers that just use Julia as an implementation language in the course of doing other research. Sorry for not being clear. On Friday, March 21, 2014 11:10:12 AM UTC-7, Ivar Nesje wrote: > > It is prominently placed on our homepage: > http://julialang.

[julia-users] Re: Array of images

2014-03-21 Thread Ivar Nesje
Also, append is called push!() in Julia push!(a, imread()) Regards Ivar kl. 19:13:49 UTC+1 fredag 21. mars 2014 skrev Ivar Nesje følgende: > > Why can you not create an empty array? > > It might not be totally obvious, but `a = []` creates a special array, > that can store nothing. You migh

[julia-users] Re: Array of images

2014-03-21 Thread Ivar Nesje
Why can you not create an empty array? It might not be totally obvious, but `a = []` creates a special array, that can store nothing. You might have better success with specifying a type `a = Any[]`, or use the special Array{Any,1} syntax `a = {}`. kl. 19:07:47 UTC+1 fredag 21. mars 2014 skrev

Re: [julia-users] Array of images

2014-03-21 Thread Jacob Quinn
Actually, you can create an empty array and append (though in Julia vernacular, it's push!). a = Image[] for image in images push!(a, image) end Or something along those lines. -Jacob On Fri, Mar 21, 2014 at 2:07 PM, Paulo Castro wrote: > Hi, > > I am starting using Julia, and I'm having

[julia-users] Re: Array of images

2014-03-21 Thread Patrick O'Leary
You can grow arrays, but you need to use push!() to do so. You could also use an array comprehension to construct the array. On Friday, March 21, 2014 1:07:47 PM UTC-5, Paulo Castro wrote: > > Hi, > > I am starting using Julia, and I'm having a simple problem. I have some > images on a directory

[julia-users] Re: Scientific papers using Julia

2014-03-21 Thread Ivar Nesje
It is prominently placed on our homepage: http://julialang.org/publications/ Ivar kl. 19:07:40 UTC+1 fredag 21. mars 2014 skrev Jonathan Malmaud følgende: > > Is someone curating a list somewhere of published work that uses Julia? >

[julia-users] Scientific papers using Julia

2014-03-21 Thread Jonathan Malmaud
Is someone curating a list somewhere of published work that uses Julia?

[julia-users] Array of images

2014-03-21 Thread Paulo Castro
Hi, I am starting using Julia, and I'm having a simple problem. I have some images on a directory, and I want to iterate over each one, open it with Images' imread(), and store it on an array. I cannot create a empty array and append images to it. How can I achieve this? Thanks, Paulo

[julia-users] pycall error

2014-03-21 Thread Tang Ross
I try to do this: @pyimport Crypto.Cipher.AES as AES @pyimport Crypto.Hash.SHA256 as SHA256 key = "hello world" hash = SHA256.new() hash[:update](key) secret = hash[:digest]() cipher = AES.new(secret) but I get the following error: PyError (Ptr) UnicodeDecodeError('utf8', "\xb9M'\xb9\x93M>\x08

[julia-users] Re: Sum of Laguerre polynomials

2014-03-21 Thread Paweł Biernat
W dniu piątek, 21 marca 2014 13:44:17 UTC+1 użytkownik Steven G. Johnson napisał: > > > It would be better to avoid the NaNs in the first place (which come when > you multiply 0 * Inf, from an underflow times an overflow). For one thing, > floating-point exceptions are slow. For another thing,

Re: [julia-users] Spectrum of a tridiagonal matrix with the Sturm sequence method

2014-03-21 Thread Jarvist Moore Frost
Ah wonderful, thankyou both. Ivar; you're quite right about being able to get rid of the array for t, I was just following term for term the mathematical expression. Jiahao; your code is indeed much more elegant! Thank you for pointing me in its direction. How efficient is the M::SymTridiagonal

Re: [julia-users] Re: Not fun

2014-03-21 Thread Andrew Dabrowski
On Friday, March 21, 2014 11:37:33 AM UTC-4, Stefan Karpinski wrote: > > Getting back to your original example, I would counter that you never > really want to just do something like "replace the 16th character of this > string" in isolation. How did you figure out the index 16? What you really

Re: [julia-users] Re: Not fun

2014-03-21 Thread J Luis
I too want acknowledge all your work to explain why things work the way they do. But I want also say that I did read the docs before asking. It just happened that I missed that first part on the "Strings" that talk about strings immutability and error message does not help much leading us to th

Re: [julia-users] Re: Not fun

2014-03-21 Thread Jacob Quinn
Thanks to Ivar and Stefan for the great explanations. I think often we hear "don't do this, don't do that", but it's great to hear some good anecdotes and reasoning. Also excited to see the improvements in Strings under the hood. -Jacob On Fri, Mar 21, 2014 at 11:37 AM, Stefan Karpinski wrote:

Re: [julia-users] Re: Not fun

2014-03-21 Thread Stefan Karpinski
On Thu, Mar 20, 2014 at 10:59 PM, J Luis wrote: > Well, ... thanks > > But "naive" question though. If we can do it with elaborate tricks, why > not just have a clean & simple way? > The bottom line for whether something should be mutable or not is psychological: is the thing a value or a contai

[julia-users] Re: Remaining GSoC projects

2014-03-21 Thread Mike Innes
Absolutely - the plan is to keep the ideas list around so that people who want to get involved have a nice set of projects to pick from. Aside from anything else it's probably a good idea to separate "actual issues" and "would be cool" projects. That said, if we're keeping the ideas list around

Re: [julia-users] Re: Not fun

2014-03-21 Thread Ivar Nesje
We try to be helpful, and answer the questions as asked. We also provide advice for improvements, if the question is likely to lead to a poor program. Julia gives you as a programmer lots of power, and if you don't follow advice, you might end up in trouble. If you change the internal represen

[julia-users] Re: Sum of Laguerre polynomials

2014-03-21 Thread Steven G. Johnson
On Thursday, March 20, 2014 5:32:15 PM UTC-4, Paweł Biernat wrote: > > Taking into account your suggestions I came up with an ad-hoc > implementation tailored for my needs. Instead of computing > Laguerre(n,1,t-n) I compute the whole expression > Laguerre(n,1,t-n)*exp(-(t-n))*(t-n) via a func

Re: [julia-users] Re: Not fun

2014-03-21 Thread Andreas Lobinger
Hello colleagues, this conversation is covering one of the most dangerous things that you can do in SW engineering: - How can i do X? - This is not meant to be used. But i have a work around for you. You can be absolutely sure that this will propagate and be the new default way. (I'm cleanin

Re: [julia-users] Re: I had an idea to (ab)use the type system. It failed miserably. Why?

2014-03-21 Thread andrew cooke
sorry for the noise, but explaining it to someone else made me realise i still didn't have it right. below it the expanded typed. native and llvm code. above are wrong. this is for the 10 -1 1 loop. it's pretty clean - no unboxing in the native code (at least, no QWORDs which i think is that

[julia-users] Re: Some pointers for installing SDL 1.2 on Windows for Julia?

2014-03-21 Thread Robert Ennis
Just posting a link to the relevant issue for any others that might come across this: https://github.com/rennis250/SDL.jl/issues/3 Best, Rob On Tuesday, February 25, 2014 4:26:20 AM UTC+1, Joshua Olson wrote: > > The SDL package looks promising, except I don't know which SDL 1.2 library > to in

[julia-users] Re: OpenGL issue

2014-03-21 Thread Robert Ennis
Hey Alex, Sorry for the huge delay on this. Not sure if you've tried an updated version of the package since, but this should be fixed now. Best, Rob On Monday, January 20, 2014 6:45:34 AM UTC+1, Alex Zlov wrote: > > > > I'm trying to run NeHe examples from GLUT package and get following > con

Re: [julia-users] Re: I had an idea to (ab)use the type system. It failed miserably. Why?

2014-03-21 Thread andrew cooke
above is typed code is wrong. it's actually: $(Expr(:lambda, {:r}, {{:n,:#s7,:#s6,:i},{{:r,TypedRange{S,I,E},0},{:n,Any,2},{:#s7,Any,2},{:#s6,(Any,Any),18},{:i,Any,18}},{}}, :(begin # /home/andrew/.julia/v0.3/IntModN/src/Range.jl, line 44: n = 0 # line 45: #s7 = top(start)(r:

Re: [julia-users] Re: I had an idea to (ab)use the type system. It failed miserably. Why?

2014-03-21 Thread andrew cooke
i get to within a factor of 10 of the standard iterator. that's not wonderful, i know, but looking at the generated code it doesn't appear to understand that the parameters are integers (hence my comment above). (but i am only guessing here, i don't really understand things that much). here's

[julia-users] Remaining GSoC projects

2014-03-21 Thread Oliver Lylloff
Hello all, After seeing all the good project proposals for GSoC, I realized than only one or two lucky projects will eventually be worked on during the summer. What will happen to the remaining? Would it be a good idea to keep them at julialang.org as inspiration for e.g. a bachelor's or maste

Re: [julia-users] Re: Not fun

2014-03-21 Thread Keith Campbell
> > There is also MutableStrings.jl > at https://github.com/tanmaykm/MutableStrings.jl. >