Re: [julia-users] Re: A cheat page for Julia

2015-08-23 Thread Sisyphuss
Juno is an IDE in the skin of editor.


On Sunday, August 23, 2015 at 11:55:40 PM UTC+2, Páll Haraldsson wrote:
>
> Is Juno only an editor (I should try, but I haven't..) as you say. They 
> say, "environment". Should you say IDE?
>
> If/when Julia adoption doubles, wee never know - maybe the cheat sheet 
> helped a lot..:) To me Julia is good enough (an understatement) and people 
> just have to know about it and have the info, such as yours they think they 
> need (and maybe a visual debugger..).
>
> 2015-08-23 12:39 GMT+00:00 Ian Hellström 
> >:
>
>> I'm not sure it'll have *that* impact but thanks anyway! The latest 
>> version also shows the Julia version it applies to. That should at least 
>> help. 
>
>
>
>
> -- 
> Palli.
>


Re: [julia-users] Re: A cheat page for Julia

2015-08-23 Thread Páll Haraldsson
Is Juno only an editor (I should try, but I haven't..) as you say. They
say, "environment". Should you say IDE?

If/when Julia adoption doubles, wee never know - maybe the cheat sheet
helped a lot..:) To me Julia is good enough (an understatement) and people
just have to know about it and have the info, such as yours they think they
need (and maybe a visual debugger..).

2015-08-23 12:39 GMT+00:00 Ian Hellström :

> I'm not sure it'll have *that* impact but thanks anyway! The latest
> version also shows the Julia version it applies to. That should at least
> help.




-- 
Palli.


[julia-users] Re: A cheat page for Julia

2015-08-23 Thread Ian Hellström
Update: I renamed the page to "The Fast Track to Julia" so as not to offend 
anyone. There were some people who questioned the double entendre, so I 
thought it best to remove it completely.

On Sunday, 23 August 2015 14:39:43 UTC+2, Ian Hellström wrote:
>
> I'm not sure it'll have *that* impact but thanks anyway! The latest 
> version also shows the Julia version it applies to. That should at least 
> help. 



[julia-users] Re: A cheat page for Julia

2015-08-23 Thread Ian Hellström
I'm not sure it'll have *that* impact but thanks anyway! The latest version 
also shows the Julia version it applies to. That should at least help. 

[julia-users] Re: A cheat page for Julia

2015-08-23 Thread Marcio Sales
It will probably double the rate of new Julia adopters! This should go to 
the website. Great job and idea.


Em segunda-feira, 17 de agosto de 2015 14:07:02 UTC-3, Ian Hellström 
escreveu:
>
> Hi everyone,
>
> I just created a cheat page for Julia: http://tinyurl.com/JuliaLang. 
>
> It's full of information, so let me know what you think.
>
> Cheers,
>
> Ian.
>


[julia-users] Re: A cheat page for Julia

2015-08-20 Thread Ian Hellström
I'm glad you like it.

Yes, right now everything is for 0.3. On Bitbucket I have already prepared 
0.4 but it's not available through the tinyurl link.

I might remove the italics on homoiconic. There is no real need for it and 
it does make the colon almost invisible, I agree.

I might add something about Juno or Forio. Help on finding an IDE might be 
helpful to people who are starting out. Thanks for the idea.

I'm not sure Compat.jl is something people want to see in a cheat sheet. I 
might add it in one of the tooltips. I'll have to think about it.

Thanks again!

On Thursday, 20 August 2015 18:23:46 UTC+2, Páll Haraldsson wrote:
>
> This is great! I've seen something similar, but not in a cheat sheet form 
> this nice that I would print myself and hang on the wall (missing then 
> hovering over or clicking that is nice) or recommend to do. Everything I 
> can point to, book, free or not, especially for beginners or non-math 
> people is welcome as I'm an advocate trying to convert people..
>
> I'm a little new to "Tasks a.k.a. coroutines", but it seems your section 
> is on the basic stuff, that is 0.3 (and in general?) To start with, you do 
> not need have 0.4 specific stuff (do you already, I'm still scanning..). If 
> 0.4 is out soon and people switch fast it's not a problem or highlighting 
> incompatibilities might be in order.
>
> Juno is not Julia, probably not the right place to advertise it.. 
> Compat.jl might be however in footnotes.
>
>
> P.S. "Julia is homoiconic: programs".. looks like a typo in my font, but 
> isn't (the colon is "invisible"..) You might want to start with capital P 
> anyway but I'm not sure about adding a space *before* the colon (isn't that 
> bad form?).
>
> Thanks,
> -- 
> Palli.
>
> On Monday, August 17, 2015 at 5:07:02 PM UTC, Ian Hellström wrote:
>>
>> Hi everyone,
>>
>> I just created a cheat page for Julia: http://tinyurl.com/JuliaLang. 
>>
>> It's full of information, so let me know what you think.
>>
>> Cheers,
>>
>> Ian.
>>
>

[julia-users] Re: A cheat page for Julia

2015-08-20 Thread Páll Haraldsson
This is great! I've seen something similar, but not in a cheat sheet form 
this nice that I would print myself and hang on the wall (missing then 
hovering over or clicking that is nice) or recommend to do. Everything I 
can point to, book, free or not, especially for beginners or non-math 
people is welcome as I'm an advocate trying to convert people..

I'm a little new to "Tasks a.k.a. coroutines", but it seems your section is 
on the basic stuff, that is 0.3 (and in general?) To start with, you do not 
need have 0.4 specific stuff (do you already, I'm still scanning..). If 0.4 
is out soon and people switch fast it's not a problem or highlighting 
incompatibilities might be in order.

Juno is not Julia, probably not the right place to advertise it.. Compat.jl 
might be however in footnotes.


P.S. "Julia is homoiconic: programs".. looks like a typo in my font, but 
isn't (the colon is "invisible"..) You might want to start with capital P 
anyway but I'm not sure about adding a space *before* the colon (isn't that 
bad form?).

Thanks,
-- 
Palli.

On Monday, August 17, 2015 at 5:07:02 PM UTC, Ian Hellström wrote:
>
> Hi everyone,
>
> I just created a cheat page for Julia: http://tinyurl.com/JuliaLang. 
>
> It's full of information, so let me know what you think.
>
> Cheers,
>
> Ian.
>


[julia-users] Re: A cheat page for Julia

2015-08-19 Thread Ian Hellström
The updated version is now available. 

The 0.4 version is already done (and on my Bitbucket repo 
) but I'll wait with replacing the 
publicly 
available  document until Julia 0.4 is 
officially released.


Re: [julia-users] Re: A cheat page for Julia

2015-08-18 Thread Ian Hellström
It says "installed" not "install", so I believe it's correct. I may write "list 
installed..." if that helps. 

[julia-users] Re: A cheat page for Julia

2015-08-18 Thread Ian Hellström
Thanks for the detailed comments, Steven. I really appreciate it.

For now I have changed what was wrong/unclear and valid for 0.3 (locally, not 
yet online). I’ll prepare a 0.4 version and put that online as soon as 0.4 is 
officially released.

I know that the naming PascalCase vs camelCase vs init-cap CamelCase is almost 
up to each dev. Microsoft seems to be most pedantic about PascalCase vs 
camelCase: https://msdn.microsoft.com/en-us/library/x2dbyw72(v=vs.71).aspx. I 
don’t mind changing it. The official documentation calls it camel case, so I’ll 
go with that to make it more consistent.

What’s the reason you say “You can override Base.show(io, ex) rather than 
Base.showerror”? The doc seems to go with the latter and I also think it 
matches the intent (exception -> showerror): 
http://julia.readthedocs.org/en/latest/manual/control-flow/. Is there an 
advantage to overriding Base.show instead of Base.showerror?

Re: [julia-users] Re: A cheat page for Julia

2015-08-18 Thread Alex Ames
For installing packages, 'Pkg.status(pkgName)' should be 'Pkg.add(pkgName)'. 

Re: [julia-users] Re: A cheat page for Julia

2015-08-18 Thread Scott Jones
Well, even a Bactrian camel’s humps are in the middle, not right on top of 
his bum!

The camel case conventions IIRC were really popularized first by Smalltalk, 
then by Wirth with Pascal and Modula, and also (later) by Microsoft.

Another 
reference: https://msdn.microsoft.com/en-us/library/x2dbyw72(v=vs.71).aspx

On Tuesday, August 18, 2015 at 7:13:57 AM UTC-4, Milan Bouchet-Valat wrote:
>
> Le lundi 17 août 2015 à 22:01 -0700, Scott Jones a écrit : 
> > > On Monday, August 17, 2015 at 4:14:25 PM UTC-4, Steven G. Johnson 
> > > wrote: 
> > > I think the term "CamelCase" is more common than "Pascal case"; if 
> > > you write it as "CamelCase" it is clear that it starts with caps. 
> > > 
> > I've heard Pascal case to indicate starting out with caps, but Camel 
> > case more often refers to lower case first letter.  (i.e. there is a 
> > hump in the *middle* of the name, like a camel). 
> Well, "camel" is ambiguous. Lower case first letters certainly match 
> the dromedary camel... :-) 
>
> https://en.wikipedia.org/wiki/Camel 
>
>
> Regards 
>
> > Here's the definition from Wikipedia: 
> > > Although the first letter of a camel case compound word may or may 
> > > not be capitalized, the term camel case generally implies lowercase 
> > > first letter.[2][3] For clarity, this article calls the two 
> > > alternatives upper camel case and lower camel case. Some people and 
> > > organizations use the term camel case only for lower camel case. 
> > > Other synonyms include: 
> >   
>


Re: [julia-users] Re: A cheat page for Julia

2015-08-18 Thread Milan Bouchet-Valat
Le lundi 17 août 2015 à 22:01 -0700, Scott Jones a écrit :
> > On Monday, August 17, 2015 at 4:14:25 PM UTC-4, Steven G. Johnson 
> > wrote:
> > I think the term "CamelCase" is more common than "Pascal case"; if 
> > you write it as "CamelCase" it is clear that it starts with caps.
> > 
> I've heard Pascal case to indicate starting out with caps, but Camel 
> case more often refers to lower case first letter.  (i.e. there is a 
> hump in the *middle* of the name, like a camel).
Well, "camel" is ambiguous. Lower case first letters certainly match
the dromedary camel... :-)

https://en.wikipedia.org/wiki/Camel


Regards

> Here's the definition from Wikipedia:
> > Although the first letter of a camel case compound word may or may 
> > not be capitalized, the term camel case generally implies lowercase 
> > first letter.[2][3] For clarity, this article calls the two 
> > alternatives upper camel case and lower camel case. Some people and 
> > organizations use the term camel case only for lower camel case. 
> > Other synonyms include:
>  


[julia-users] Re: A cheat page for Julia

2015-08-18 Thread Sisyphuss


On Monday, August 17, 2015 at 10:14:25 PM UTC+2, Steven G. Johnson wrote:
>
> Comments:
>
> Your "subtype declaration" section is wrong: the abstract type does not 
> define a block (you should just have "abstract Foo", not "abstract Foo ... 
> end")
>
> The "String" type is deprecated in favor of AbstractString in 0.4
>
> [1:10] is deprecated in 0.4, in favor of [1:10;] to explicitly vcat.
>
> You can just use +, not .+, for element-wise addition.  (It doesn't hurt 
> to do .+, but it is unnecessary.)
>
> help("func") is gone in 0.4
>
> Pkg.build("Package") is useful to rebuild a package if the package build 
> failed or your system configuration changed.
>
> char(n) is deprecated in favor of Char(n) in 0.4
>
> "Beware of multi-byte Unicode characters" is a bit misleading; it is not 
> the Unicode "character" (technically you are referring to "codepoints") 
> that is multi-byte, but rather the codepoint's *encoding* in UTF-8 (the 
> default in Julia).  Maybe "Beware of multi-byte Unicode encodings in UTF-8"
>
> (Of course, there are many other subtleties with Unicode: e.g. your 
> example string "Ångström" can also be written "Ångström", which looks 
> identical but actually uses a different set of codepoints via "combining 
> characters".)
>
> UintN in Julia 0.4 is deprecated in favor of UIntN (note caps).
>
> Note there is also Complex{T}; Complex128 is just a shorthand for 
> Complex{Float64}.
>
> im is the "imaginary unit", not the "imaginary number".
>
> eps() is an abbreviation for eps(Float64).  eps(T) is also defined for 
> other types.
>
> In 0.4, TypeName(val) automatically calls convert(TypeName, val) if no 
> other constructor is available.   This also means that, when you are 
> defining your own type, you should extend Base.convert if you have new 
> conversions, rather than adding constructors.
>
> eye(N) is an NxN identity; calling it "N-dimensional" may confuse people 
> into thinking it returns an N-dimensional array.
>
> M' is a synonym for ctranspose(M) (conjugate transpose).  M.' is 
> transpose(M) without conjugation.  Of course, for real matrices they are 
> equivalent.
>
> Note that we can also do "for i in 1:10" ... this syntax is perhaps a bit 
> clearer in that it generalizes to iterating over other kinds of containers.
>
> To exit a loop you do "break", not "exit" (which is a function).
>
> Functions with ! appended mutate at least one of their arguments.   Not 
> necessarily the first one (e.g. see A_ldiv_B!), although this is the most 
> common.
>
> If you need tail-call optimization, it is more idiomatic to simply write a 
> loop.
>
> Instead of in(val,arr), you can simply do "val in arr"
>
> The dictionary syntax has changed in 0.4: use Dict(a=>b, ...)
>
> {...} is deprecated in 0.4.  Use Any[...].
>
> it is more idiomatic to put "do" on the same line:
>
> map(collection) do elem
>...
> end
>
>
> You can override Base.show(io, ex) rather than Base.showerror.
>
> "import ModuleName" does *not* import "all names".  It imports the module, 
> but the only symbol imported is ModuleName itself; everything else must be 
> accessed via ModuleName.something.
>

Or `importall MyModule` ?
 

>
> You should think of macros as being evaluated at parse-time, not run-time. 
>  Basically:
> * a macro is a function evaluated at parse-time that takes an 
> expression in and returns an expression out, and the latter is inserted 
> into the parsed code.
> * a generated function is a function evaluated at compile-time which 
> takes types in and returns an expression out, which is inserted into the 
> code and compiled
> * an ordinary function is a function evaluated at run-time which takes 
> values in and returns values out.
>
> @test_approx_eq does not check equality to machine precision.  It checks 
> equality at much lower precision.  In 0.4, you can also just use @test x ≈ 
> y, where ≈ is \approx and is a synonym for the isapprox function.
>
> The typical convention in Julia is to avoid underscores unless they are 
> needed for readability.  i.e. we have iseven, not is_even.  This does not 
> differ for variables vs. functions.
>
> I think the term "CamelCase" is more common than "Pascal case"; if you 
> write it as "CamelCase" it is clear that it starts with caps.
>
> For performance, you should avoid abstract types in collections, but also 
> as fields of types.
>

I thinks using abstract types as fields doesn't hurt much, except that the 
object will be packed into an Array.
 


[julia-users] Re: A cheat page for Julia

2015-08-17 Thread Scott Jones

>
> On Monday, August 17, 2015 at 4:14:25 PM UTC-4, Steven G. Johnson wrote:
>
I think the term "CamelCase" is more common than "Pascal case"; if you 
> write it as "CamelCase" it is clear that it starts with caps.
>

I've heard Pascal case to indicate starting out with caps, but Camel case 
more often refers to lower case first letter.  (i.e. there is a hump in the 
*middle* of the name, like a camel).

Here's the definition from Wikipedia:

> Although the first letter of a camel case compound word may or may not be 
> capitalized, the term *camel case* generally implies lowercase first 
> letter.[2] [3] 
>  For clarity, this 
> article calls the two alternatives *upper camel case* and *lower camel 
> case*. Some people and organizations use the term *camel case* only for 
> lower camel case. Other synonyms include:


 


[julia-users] Re: A cheat page for Julia

2015-08-17 Thread Steven G. Johnson
Comments:

Your "subtype declaration" section is wrong: the abstract type does not 
define a block (you should just have "abstract Foo", not "abstract Foo ... 
end")

The "String" type is deprecated in favor of AbstractString in 0.4

[1:10] is deprecated in 0.4, in favor of [1:10;] to explicitly vcat.

You can just use +, not .+, for element-wise addition.  (It doesn't hurt to 
do .+, but it is unnecessary.)

help("func") is gone in 0.4

Pkg.build("Package") is useful to rebuild a package if the package build 
failed or your system configuration changed.

char(n) is deprecated in favor of Char(n) in 0.4

"Beware of multi-byte Unicode characters" is a bit misleading; it is not 
the Unicode "character" (technically you are referring to "codepoints") 
that is multi-byte, but rather the codepoint's *encoding* in UTF-8 (the 
default in Julia).  Maybe "Beware of multi-byte Unicode encodings in UTF-8"

(Of course, there are many other subtleties with Unicode: e.g. your example 
string "Ångström" can also be written "Ångström", which looks identical but 
actually uses a different set of codepoints via "combining characters".)

UintN in Julia 0.4 is deprecated in favor of UIntN (note caps).

Note there is also Complex{T}; Complex128 is just a shorthand for 
Complex{Float64}.

im is the "imaginary unit", not the "imaginary number".

eps() is an abbreviation for eps(Float64).  eps(T) is also defined for 
other types.

In 0.4, TypeName(val) automatically calls convert(TypeName, val) if no 
other constructor is available.   This also means that, when you are 
defining your own type, you should extend Base.convert if you have new 
conversions, rather than adding constructors.

eye(N) is an NxN identity; calling it "N-dimensional" may confuse people 
into thinking it returns an N-dimensional array.

M' is a synonym for ctranspose(M) (conjugate transpose).  M.' is 
transpose(M) without conjugation.  Of course, for real matrices they are 
equivalent.

Note that we can also do "for i in 1:10" ... this syntax is perhaps a bit 
clearer in that it generalizes to iterating over other kinds of containers.

To exit a loop you do "break", not "exit" (which is a function).

Functions with ! appended mutate at least one of their arguments.   Not 
necessarily the first one (e.g. see A_ldiv_B!), although this is the most 
common.

If you need tail-call optimization, it is more idiomatic to simply write a 
loop.

Instead of in(val,arr), you can simply do "val in arr"

The dictionary syntax has changed in 0.4: use Dict(a=>b, ...)

{...} is deprecated in 0.4.  Use Any[...].

it is more idiomatic to put "do" on the same line:

map(collection) do elem
   ...
end


You can override Base.show(io, ex) rather than Base.showerror.

"import ModuleName" does *not* import "all names".  It imports the module, 
but the only symbol imported is ModuleName itself; everything else must be 
accessed via ModuleName.something.

You should think of macros as being evaluated at parse-time, not run-time. 
 Basically:
* a macro is a function evaluated at parse-time that takes an 
expression in and returns an expression out, and the latter is inserted 
into the parsed code.
* a generated function is a function evaluated at compile-time which 
takes types in and returns an expression out, which is inserted into the 
code and compiled
* an ordinary function is a function evaluated at run-time which takes 
values in and returns values out.

@test_approx_eq does not check equality to machine precision.  It checks 
equality at much lower precision.  In 0.4, you can also just use @test x ≈ 
y, where ≈ is \approx and is a synonym for the isapprox function.

The typical convention in Julia is to avoid underscores unless they are 
needed for readability.  i.e. we have iseven, not is_even.  This does not 
differ for variables vs. functions.

I think the term "CamelCase" is more common than "Pascal case"; if you 
write it as "CamelCase" it is clear that it starts with caps.

For performance, you should avoid abstract types in collections, but also 
as fields of types.


[julia-users] Re: A cheat page for Julia

2015-08-17 Thread Ian Hellström
Thanks for the input. With the tooltips I was not trying to make a printable 
page. I might make a style sheet for printing though, as a compromise. 

[julia-users] Re: A cheat page for Julia

2015-08-17 Thread Waldir Pimenta
Great job with the tooltips :) that's a nice way to present information 
compactly without making it hard for beginners who don't know the jargon.

On Monday, August 17, 2015 at 6:07:02 PM UTC+1, Ian Hellström wrote:
>
> Hi everyone,
>
> I just created a cheat page for Julia: http://tinyurl.com/JuliaLang. 
>
> It's full of information, so let me know what you think.
>
> Cheers,
>
> Ian.
>


[julia-users] Re: A cheat page for Julia

2015-08-17 Thread Jeffrey Sarnoff
I have two suggestions:

Change the pale colors to something less pale.  I am not critical of your 
aesthetic, just pragmatic. 
Generally, printing on white with more saturated, deeper rather than 
lighter colors is more readable.
Also try to avoid pure yellows and pure reds, they are difficult for people 
who have some color blindness.

Add selecting cols, rows, subarrays from multidimensional arrays [colons, 
and in a matrix which is row, col]

On Monday, August 17, 2015 at 1:07:02 PM UTC-4, Ian Hellström wrote:
>
> Hi everyone,
>
> I just created a cheat page for Julia: http://tinyurl.com/JuliaLang. 
>
> It's full of information, so let me know what you think.
>
> Cheers,
>
> Ian.
>