Re: [julia-users] Re: Input a data from the console

2016-10-28 Thread Ismael Venegas Castelló
IMO the parametric method with multiple dispatch is more Julian.

Re: [julia-users] Re: Trait for exactness of numbers

2016-10-27 Thread Ismael Venegas Castelló
I see thank you very much for your answer! :D

El martes, 25 de octubre de 2016, 13:20:50 (UTC-5), Tim Holy escribió:
>
> > Why not use dispatch instead?
>
> Because subtyping isn't powerful enough for all needs. For example:
>
>
> julia> using Unitful
>
> julia> const mm = u"mm"
> mm
>
> julia> isa(3.2mm, AbstractFloat)
> false
>
>
> You'd probably like to use the fancy logic of `FloatRange` if you're 
> constructing a range `3.2mm:0.1mm:4.8mm`, so the solution is to dispatch on 
> a trait that indicates that arithmetic isn't exact (which is what really is 
> going on inside that code anyway---who cares what kind of number type it 
> is).
>
> Best,
> --Tim
>
> On Tue, Oct 25, 2016 at 12:55 PM, Ismael Venegas Castelló <
> ismael...@gmail.com > wrote:
>
>> Why not use dispatch instead?
>>
>> isexact(::Integer) = true
>> isexact(::Rational) = true
>> isexact(x::Complex) = isexact(x.re)
>> isexact(::Any) = false
>
>
>

[julia-users] Re: Input a data from the console

2016-10-27 Thread Ismael Venegas Castelló


"""
`input(prompt::String="")::String`

Read a string from STDIN. The trailing newline is stripped.

The prompt string, if given, is printed to standard output without a
trailing newline before reading input.
"""
function input(prompt::String = "")::String
print(prompt)
return chomp(readline())
end




El jueves, 27 de octubre de 2016, 10:16:25 (UTC-5), Aleksandr Mikheev 
escribió:
>
> Hello,
>
> How could I input a data from the console? For instance, I would like to 
> make such that user is able to input the value of x. Is there any way to do 
> it like in Fortran or something? I can't find anything in documentation.
>
> P.S. Also, I believe there is a way to input a string using readline() 
> function. However, if I do something like:
>
> a = readline()
> "asd"
>
> then I will get "\"asd\"\r\n".
>
> How to avoid these excess symbols?
>
> Thank you in advance!
>


[julia-users] Re: Trait for exactness of numbers

2016-10-25 Thread Ismael Venegas Castelló
Why not use dispatch instead?

isexact(::Integer) = true
isexact(::Rational) = true
isexact(x::Complex) = isexact(x.re)
isexact(::Any) = false

[julia-users] Julia-i18n: Reviewers needed!

2016-10-23 Thread Ismael Venegas Castelló
Reviewers needed help us bring #JuliaLang website to your native language 
...one string at a time!

Kudos to Akis Vassiliadis for completing 33% of the Greek translations by 
himself and with that moving his language to the top of the list!





   - *julia-website i18n project:* 
   https://www.transifex.com/julialang-i18n/julialang-web
   - *Julia-i18n:* https://github.com/Julia-i18n/julia-i18n
   - *Dashboard:* https://github.com/Julia-i18n/julia-i18n/projects/1
   - *Chat room:* https://gitter.im/Julia-i18n/julia-i18n
   - *Twitter:* https://twitter.com/julia_i18n
   

Contributing is easy.


[julia-users] Re: prblem with space after "ś", "ć" ERROR: UnicodeError: invalid character index

2016-10-20 Thread Ismael Venegas Castelló
You can use collect(graphemes(s))[3], for example, see also this SO question 
and it's answers:

http://stackoverflow.com/questions/39501900/truncate-string-in-julia/39505998#39505998

[julia-users] Re: Julia types newbie question

2016-10-18 Thread Ismael Venegas Castelló
You can do something like this:

C:\Users\Ismael 
 
λ julia5   
  
   _   
  
   _   _ _(_)_ |  By greedy hackers for greedy hackers. 
 
  (_) | (_) (_)|  Documentation: http://docs.julialang.org 
  
   _ _   _| |_  __ _   |  Type "?help" for help.   
  
  | | | | | | |/ _' |  |   
  
  | | |_| | | | (_| |  |  Version 0.5.0 (2016-09-19 18:14 UTC) 
  
 _/ |\__'_|_|_|\__'_|  |  Official http://julialang.org/ release   
  
|__/   |  x86_64-w64-mingw32   
  

 
julia> Base.sum{T<:Real, S<:Real}(::Type{T}, xs::Range{S})::T = sum(xs) 
 

 
julia> r = 1:100; sum(r), sum(Int32, r), sum(Rational{Int16}, r), 
sum(Complex{BigInt}, r)
(5050,5050,5050//1,5050 + 0im) 
  

 
julia> for T ∈ (Int32, Rational{Int16}, Complex{BigInt})   
  
   @assert sum(T, 1:100) |> typeof == T 
 
   end 
  

 
julia> 
  



El lunes, 17 de octubre de 2016, 8:19:51 (UTC-5), Ángel de Vicente escribió:
>
> Hi, 
>
> probably a very basic question, but I'm just starting to play around 
> with Julia types. 
>
> I was hoping to improve the performance of a little program I wrote, so 
> I decided to try Int32 integers instead of the default Int64, but if I 
> try to use sum, it seems that it is expecting Int64 and the result is 
> Int64, defeating the purpose of working with Int32 and actually making 
> the code much slower than the naive version. 
>
> , 
> | julia> typeof(sum([i for i in Int32(1):Int32(100)])) 
> 
>| 
> | Int64 
> ` 
>
> Do I have to write down my own Int32::sum function? I assume I'm missing 
> something quite obvious? 
>
> Thanks, 
> -- 
> Ángel de Vicente 
> http://www.iac.es/galeria/angelv/   
>


Re: [julia-users] Re: translating julia

2016-10-13 Thread Ismael Venegas Castelló
Hello Milan, 

I have already changed the review option, so now only the reviewed strings 
are shown in production, un reviewed strings are still shown in staging. I 
have named you team administrator so you can review and even organize the 
French team, if there is anything else I can do for you, please do let me 
know, thank you very much!

Cheers!


El lunes, 10 de octubre de 2016, 20:11:50 (UTC-5), Milan Bouchet-Valat 
escribió:
>
> (Sorry, this message was apparently blocked since Saturday. Sending it 
> again.) 
>
> Le samedi 08 octobre 2016 à 07:59 -0700, Ismael Venegas Castelló a 
> écrit : 
> > 
> > I got a mail today and I published a response, but I'm not sure why 
> > it doesn't show up here, so I'll paste it verbatim: 
> OK, I had kept it private to avoid sounding too negative and risking 
> discouraging contributors. But since you made it public... :-) 
>
> > 
> > Hi Milan!  
> > 
> > Thank you for stating your concern,  
> > 
> > > 
> > >  but I'm worried that we completely destroy the professional aspect 
> > of the website 
> > 
> > I agree with you but, I think that we need a banner in the julia 
> > website stating that the translations are not done by professionals 
> > but by volunteers and also inviting them to join and improve the 
> > translations in their own languages.  
> > 
> > I'll activate another option that is more strict, in which only 
> > reviewed translations will be able to be shown in the website (as 
> > opposed to only translated but un reviewed ones), but anyway, since 
> > this is a collaborative effort we need to work as a team. For example 
> > Transifex doesn't prohibit someone of reviewing his/her own 
> > translations, even when I've tried to make clear that this is not a 
> > good practice, there is no way to enforce it. 
> OK, it's great that you can require reviews before publishing. That 
> should really improve the quality of translations, even if people can 
> cheat (in general, I think we can assume good faith from contributors). 
>
> > 
> > However, please join the French team and un review, comment and 
> > correct the strings in order to improve the quality, there is no 
> > other way (other than paying for professional translations). 
> > 
> > The team is small but growing, and the project has just started, if 
> > we state publicly that the translations are crowd sourced by the 
> > community and an ongoing progress, then I'm sure no one will expect 
> > them to be of professional grade yet, and no reputation will be 
> > affected. 
> > 
> > Expecting professional translation from the get go, is unrealistic 
> > without investing money into the project. And waiting, g for all the 
> > crowd sourced translations to become of professional grade, would 
> > kill the motivation of the contributors, as this has already 
> > happened, the project was stagnant for 1+ year (with the 
> > infrastructure already being ready and tested). If the project had 
> > continued, maybe today we would already have much more complete 
> > translations of near professional grade. 
> > 
> > So I think the best way to approach this is not to be conservative, 
> > but to be open and transparent, so we can get more help and others 
> > can't be disappointed for the current status, and the reputation of 
> > all, not only of the Julia project, but also of the contributors that 
> > are willing to translate for us, remains intact and even become more 
> > positive. 
> Sure, I don't expect a professional level from the start. But I think 
> we'd better validate the translations slowly so that they are only 
> online when teams are confident about them, than rush to publish poor 
> quality translations. As you note, teams need some time to be set up. 
>
> I've just joined the French team and made a suggestion, but I'm not 
> sure I have the permissions to review other's translations. For 
> example, who's in charge of deciding whether my suggestion is better 
> than the existing one? 
>
>
> Keep up the good work. I'm sure in the end it will be great -- I'd just 
> like to ensure we don't have to go through a too messy period with 
> broken translations everywhere. 
>
>
>
> Regards 
>
> > 
> > Think synergy! 
> > 
> > Regards, 
> > Ismael Venegas Castelló 
> > 
> > 
> > 2016-10-08 8:46 GMT-05:00 Milan Bouchet-Valat <>: 
> > > 
> > > Hi! 
> > > 
> > > I really appreciate the progress of tra

[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-10-13 Thread Ismael Venegas Castelló
Ihave finally got word from Transifex, it seems this feature wasnt 
supported in Live, but they implemented it because of us! :D

Hi Ismael, 
>
> Thank you for contacting Transifex support and submitting your request. 
>
> Regarding your case, I would like to mention that in case of Live, RTL 
> languages are not fully supported and that's why you are facing such an 
> issue!
>
> However, I talked to one of our developers about this and he is currently 
> working on it in order to make this work!
>
> I will get back to you when I have any new update on this!
>
> Thank you for reaching out to us and bringing this issue to our attention!
>
> I will keep you posted!
>
> Regards,
> Nina


Hi Ismael, 

I hope you are fine!

I am reaching out to you in order to inform you that the feature you are 
looking for is now available in Live settings. 

In order to achieve what you want, all you need to do is to enable the 
following option for both staging and production servers:

[image: Screen_Shot_2016-10-13_at_10_09_42_AM.png]

I hope that the above helps!

Feel free to reach out to me in case you need any further assistance!

I hope you have a nice day ahead!

Regards,

> Nina 


I have enabled that option, please let me know if it's fixed now, so I can 
put the Persian translations back on production, thanks! 

El jueves, 6 de octubre de 2016, 0:13:38 (UTC-5), rafz...@gmail.com 
escribió:
>
> Thanks for removing the translation.
>
> On Thursday, October 6, 2016 at 12:23:44 AM UTC+3:30, rafz...@gmail.com 
> wrote:
>>
>> Thanks for your quick response.
>> I see that the Persian translation is already published before the 
>> resolving the RTL issue. IMO it is better to unpublish it until the issue 
>> is cleared.
>>
>> On Wednesday, October 5, 2016 at 6:22:41 PM UTC+3:30, Ismael Venegas 
>> Castelló wrote:
>>>
>>> Hello! I've asked for support to Transifex regarding the RTL issue and 
>>> how to fix it, I'll let you know about their answer as soon as I get it. 
>>> You can watch a tutorial I made about using Transifex for translation, I 
>>> hope you find it useful, and ples let me know what do you think about it! 
>>>
>>>
>>> https://www.livecoding.tv/ismael-vc/videos/Or5Gr-julia-language-website-i18n-tutorial
>>>
>>> Cheers
>>>
>>> El miércoles, 5 de octubre de 2016, 7:37:44 (UTC-5), rafz...@gmail.com 
>>> escribió:
>>>>
>>>> Hi,
>>>> I have recently started a new translation for Persian, and almost done 
>>>> the home page.
>>>> Here one little problem exists, as you can see on 
>>>> http://julialanges.github.io/ the Persian page layout direction is LTR 
>>>> (like the other langs) while it must be RTL.
>>>> any suggestion?
>>>> thanks 
>>>> <https://en.wikipedia.org/wiki/Persian_language>
>>>>
>>>

Re: [julia-users] Re: translating julia

2016-10-08 Thread Ismael Venegas Castelló
I'll leave this references here.

Attract more contributors to i18n #428

https://github.com/JuliaLang/julialang.github.com/issues/428

Julia-i18n dashboard

https://github.com/Julia-i18n/julia-i18n/projects/1



[julia-users] Re: translating julia

2016-10-08 Thread Ismael Venegas Castelló
*I got a mail today and I published a response, but I'm not sure why it 
doesn't show up here, so I'll paste it verbatim:*

Hi Milan! 

Thank you for stating your concern, 

> but I'm worried that we completely destroy the professional aspect of the 
website

I agree with you but, I think that we need a banner in the julia website 
stating that the translations are *not *done by professionals but by 
volunteers and also inviting them to join and improve the translations in 
their own languages. 

I'll activate another option that is more strict, in which only reviewed 
translations will be able to be shown in the website (as opposed to only 
translated but un reviewed ones), but anyway, since this is a collaborative 
effort we need to work as a team. For example Transifex doesn't prohibit 
someone of reviewing his/her own translations, even when I've tried to make 
clear that this is not a good practice, there is no way to enforce it.

However, please join the French team and un review, comment and correct the 
strings in order to improve the quality, there is no other way (other than 
paying for professional translations).

The team is small but growing, and the project has just started, if we 
state publicly that the translations are crowd sourced by the community and 
an ongoing progress, then I'm sure no one will expect them to be of 
professional grade yet, and no reputation will be affected.

Expecting professional translation from the get go, is unrealistic without 
investing money into the project. And waiting, g for all the crowd sourced 
translations to become of professional grade, would kill the motivation of 
the contributors, as this has already happened, the project was stagnant 
for 1+ year (with the infrastructure already being ready and tested). If 
the project had continued, maybe today we would already have much more 
complete translations of near professional grade.

So I think the best way to approach this is not to be conservative, but to 
be open and transparent, so we can get more help and others can't be 
disappointed for the current status, and the reputation of all, not only of 
the Julia project, but also of the contributors that are willing to 
translate for us, remains intact and even become more positive.

Think synergy!

Regards,
Ismael Venegas Castelló

2016-10-08 8:46 GMT-05:00 Milan Bouchet-Valat <>:

> Hi!
>
> I really appreciate the progress of translations of the website. But
> I've just realized the French version of the site contains lots of
> mistakes, including incorrect translations, typos, and case issues. In
> some cases one cannot understand what the sentence means.
>
> Can I recommend extra care when translating Julia? Typically,
> translations shouldn't be done by a single person, and should only be
> published after having been reviewed by another contributor. The rule
> should be that it's better to have an English sentence than a broken
> approximately translated one. Translations can do more harm than good
> without a lot of care.
>
> Sorry for sounding too negative, but I'm worried that we completely
> destroy the professional aspect of the website by having random people
> do weird things in each language no core developer understands. It's
> very hard to keep control over that. Do you know whether the French
> team is organized yet?
>
> Regards
>
>
> Le vendredi 30 septembre 2016 à 08:30 +0200,  a
> écrit :
> >  Hi Ismael
> > That's it. I8 I have a little github with forks to put my examples. I
> > read gitter and saw that most of translation was on stating now.
> > I found the search field on translation page.
> > Thanks
> > Best Henri
> >
> > Le 29/09/2016 à 23:48, Ismael Venegas Castelló a écrit :
> > > Hello Henri!
> > >
> > > Just a question, you are aishenri in GitHub right? Because I
> > > answered this same question at julia-i18n chat room at Gitter, just
> > > want to make sure, I don't want to leave any question unanswered.
> > >
> > > https://gitter.im/JuliaLangEs/julia-i18n?at=57ed5568be5dec755007a21
> > > c
> > >
> > > Cheers
> > > Ismael Venegas Castelló
> > >
> > >
> > > > Hi Ismael,
> > > > I would like to translate "home" first,  but I noticed it's
> > > > difficult to find all text about it ?
> > > > Is there a way to research a precise text ?
> > > > I already translated a good part of it but I need to see it so
> > > > that I can be sûre of that.
> > > >
> > > > Best
> > > > Henri
> > > > Le 28/09/2016 à 11:54, henri@gmail.com a écrit :
> > > > > I am w

[julia-users] Linux distributions with Julia >= 0.5.0

2016-10-08 Thread Ismael Venegas Castelló
Just do: 

sudo pacman -S julia 

And you are done! :D

[julia-users] Linux distributions with Julia >= 0.5.0

2016-10-08 Thread Ismael Venegas Castelló
I think you are looking for Arch Linux!

https://www.archlinux.org/packages/community/x86_64/julia

If you need a GUI and easy setup, there are se eral distros that come with a 
desktop and are based on Arch:

https://wiki.archlinux.org/index.php/Arch_based_distributions#Desktop

[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-10-05 Thread Ismael Venegas Castelló
I have re applied the translations, just so everybody knows, translations 
are never, ever deleted, even if the original strings are somehow marked as 
ignored, even if the website endpoint is deleted, translations always stay 
stored. Please check out that page now, it should be fixed:




In the image above, you can see that this particular string changed, there 
is no mention about Snow Leopard anymore, when an update like this happens, 
you will see it as "untranslated" but if you pay more attention you'll see 
it has a suggestion that matches almost fully. In this case I just reused 
your translated string but removed the Snow Leopard mention from the 
translation and then clicked "save" again.






In this other image, you can see that you have a new string, this doesn't 
have any prior suggestions, so it must be a new string, that was added to 
this page, your current progress without this string translated is 97%, you 
just need to translate it and you'll have 100% in this page again, if you 
have any more doubts, suggestion or you want to report anything else, 
please do not hesitate to do so. I has been very busy which is why I was 
late to answer your concern, have a very good day!


El domingo, 2 de octubre de 2016, 13:07:36 (UTC-5), Mosè Giordano escribió:
>
> Hi,
>
> last week I completely translated 
> http://julialang.org/downloads/platform.html to Italian (or at least I 
> thought I did it), but now most of the translations disappeared, without 
> recent changes to 
> https://github.com/JuliaLang/julialang.github.com/blob/master/downloads/platform.md.
>   
> What happened to them?  Did someone else notice similar phenomena?  I'd not 
> be very happy to translate the same strings over and over again just 
> because they disappear for some random reasons.
>
> Bye,
> Mosè
>


[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-10-05 Thread Ismael Venegas Castelló
Hello! I've asked for support to Transifex regarding the RTL issue and how 
to fix it, I'll let you know about their answer as soon as I get it. You 
can watch a tutorial I made about using Transifex for translation, I hope 
you find it useful, and ples let me know what do you think about it! 

https://www.livecoding.tv/ismael-vc/videos/Or5Gr-julia-language-website-i18n-tutorial

Cheers

El miércoles, 5 de octubre de 2016, 7:37:44 (UTC-5), rafz...@gmail.com 
escribió:
>
> Hi,
> I have recently started a new translation for Persian, and almost done the 
> home page.
> Here one little problem exists, as you can see on 
> http://julialanges.github.io/ the Persian page layout direction is LTR 
> (like the other langs) while it must be RTL.
> any suggestion?
> thanks 
> 
>


[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-10-05 Thread Ismael Venegas Castelló
Hello,

I'm sorry for any trouble, I have reported this issue to Transifex, it may 
have been my fault, but  I've been paying a lot of attention so this 
doesn't happen, but fear not, your translations are not lost, they were 
somehow misapplied, so I'm currently re applying them as I write this, so 
that page should be as it was before, please check it out later on today 
and tell me if this problem has been solved for you.

> I'd not be very happy to translate the same strings over and over again 
just because they disappear for some random reasons.

Believe me no one wants to do that, again I'm sorry I don't know what 
happened, I'll also let you know when I get word back from Transifex about 
this reported issue, I certainly hope this was not my fault.

Cheers!

El domingo, 2 de octubre de 2016, 13:07:36 (UTC-5), Mosè Giordano escribió:
>
> Hi,
>
> last week I completely translated 
> http://julialang.org/downloads/platform.html to Italian (or at least I 
> thought I did it), but now most of the translations disappeared, without 
> recent changes to 
> https://github.com/JuliaLang/julialang.github.com/blob/master/downloads/platform.md.
>   
> What happened to them?  Did someone else notice similar phenomena?  I'd not 
> be very happy to translate the same strings over and over again just 
> because they disappear for some random reasons.
>
> Bye,
> Mosè
>


Re: [julia-users] Re: translating julia

2016-09-29 Thread Ismael Venegas Castelló
Hello Henri!

Just a question, you are aishenri in GitHub right? Because I answered this 
same question at julia-i18n chat room at Gitter, just want to make sure, I 
don't want to leave any question unanswered.


   - https://gitter.im/JuliaLangEs/julia-i18n?at=57ed5568be5dec755007a21c
   

Cheers
Ismael Venegas Castelló


El jueves, 29 de septiembre de 2016, 2:19:46 (UTC-5), Henri Girard escribió:
>
> Hi Ismael,
>
> I would like to translate "home" first,  but I noticed it's difficult to 
> find all text about it ?
>
> Is there a way to research a precise text ?
>
> I already translated a good part of it but I need to see it so that I can 
> be sûre of that.
>
>
> Best
> Henri
> Le 28/09/2016 à 11:54, henri@gmail.com  a écrit :
>
> I am wondering if one must write the html mark when translating ?
>
> Le 28/09/2016 à 10:26, Ismael Venegas Castelló a écrit :
>
> Hello Henri! 
>
> Currently French is about 0% translated, we are adding to production the 
> languages that at minimum have the home page translated 90 %, but you can 
> see the current progress of all the languages in the staging site here:
>
>
>- http://julialanges.github.io
>
> You can see here a video I did tonight, were I am translating, in order to 
> give a taste of the workflow involved in doing this with Transifex Live.
>
> Please let me know if you have any doubt and I will gladly help you as 
> much as I can and thank you very much for your interest and support to this 
> project.
>
> Cheers,
> Ismael Venegas Castelló
>
> El miércoles, 28 de septiembre de 2016, 2:49:32 (UTC-5), Henri Girard 
> escribió: 
>>
>> I went to french translation startet to translate but can't see it on 
>> julialang.org ? 
>> it's not actualized ?
>> Regards
>>
>
>
>

Re: [julia-users] Re: translating julia

2016-09-28 Thread Ismael Venegas Castelló
Hi Henri!

In order to watch your content updated in the staging site, one of the 
project administrators have to push your changes to staging. I usually do 
this several times a day or at least once a day. The Transifex Live feature 
uses the WYSIWYG (What You See Is What You Get) approach, so you will see 
your changes reflected in staging (after pushing them) and it will be 
exactly the same output.

If you'd like to show and share your current language status in staging to 
other friends, you could ping me at the current julia-i18n chat room 
@Ismael-VC (https://gitter.im/JuliaLangEs/julia-i18n) and I will try to 
update the staging site ASAP and send you a notification once it's done. 
Please focus your efforts at the beginning in translating 100% the Julia 
home page, so your language translations can be added to the production 
site, don't forget to notify me when this is done, so I can push your 
translations to production ASAP.

I am wondering if one must write the html mark when translating ?
>

Yes, please check out the following images:

The first one show a "copy" button used to copy the current string in it's 
original language to the translation text box, this will copy the HTML 
portions too as is!

<https://lh3.googleusercontent.com/-HJ98jYLC21U/V-vqRj37EKI/BCI/25p-L3n2Kf8xJ4RlX95V1Yaa8G7vqm3-ACLcB/s1600/copy.PNG>
 
In the standard editor (not the live one!) you can select the option to 
show this extended HTML

<https://lh3.googleusercontent.com/-xGFvmFf8zfA/V-vqr7ABGWI/BCM/o95J3KtrjRslbqZGuHRk8XFEHTooDR_sACLcB/s1600/html.PNG>

If you do not format the string translation correctly, Transifex won't 
allow you to save the string!

Note: I have pushed to staging just now!

As always if you have any other doubt, please do not hesitate to contact me 
and I'll try to help you ASAP, thanks for your support in this project.

Cheers,
Ismael Venegas Castelló

El miércoles, 28 de septiembre de 2016, 4:54:51 (UTC-5), Henri Girard 
escribió:
>
> I am wondering if one must write the html mark when translating ?
>
> Le 28/09/2016 à 10:26, Ismael Venegas Castelló a écrit :
>
> Hello Henri! 
>
> Currently French is about 0% translated, we are adding to production the 
> languages that at minimum have the home page translated 90 %, but you can 
> see the current progress of all the languages in the staging site here:
>
>
>- http://julialanges.github.io
>
> You can see here a video I did tonight, were I am translating, in order to 
> give a taste of the workflow involved in doing this with Transifex Live.
>
> Please let me know if you have any doubt and I will gladly help you as 
> much as I can and thank you very much for your interest and support to this 
> project.
>
> Cheers,
> Ismael Venegas Castelló
>
> El miércoles, 28 de septiembre de 2016, 2:49:32 (UTC-5), Henri Girard 
> escribió: 
>>
>> I went to french translation startet to translate but can't see it on 
>> julialang.org ? 
>> it's not actualized ?
>> Regards
>>
>
>

[julia-users] Re: translating julia

2016-09-28 Thread Ismael Venegas Castelló
I forgot to link the video I mentioned, oops

here it is: 
*https://www.livecoding.tv/ismael-vc/videos/oyvBm-julia-language-website-i18n 
*

Cheers

El miércoles, 28 de septiembre de 2016, 2:49:32 (UTC-5), Henri Girard 
escribió:
>
> I went to french translation startet to translate but can't see it on 
> julialang.org ? 
> it's not actualized ?
> Regards
>


[julia-users] Re: translating julia

2016-09-28 Thread Ismael Venegas Castelló
Hello Henri!

Currently French is about 0% translated, we are adding to production the 
languages that at minimum have the home page translated 90 %, but you can 
see the current progress of all the languages in the staging site here:


   - http://julialanges.github.io
   
You can see here a video I did tonight, were I am translating, in order to 
give a taste of the workflow involved in doing this with Transifex Live.

Please let me know if you have any doubt and I will gladly help you as much 
as I can and thank you very much for your interest and support to this 
project.

Cheers,
Ismael Venegas Castelló

El miércoles, 28 de septiembre de 2016, 2:49:32 (UTC-5), Henri Girard 
escribió:
>
> I went to french translation startet to translate but can't see it on 
> julialang.org ? 
> it's not actualized ?
> Regards
>


Re: [julia-users] Re: Why does Julia 0.5 keep complaining about method re-definitions?

2016-09-28 Thread Ismael Venegas Castelló
Daniel indeed Suppressor provides the following macros: @suppress (will 
suppress both STDERR and STDOUT), @suppress_out (just STDOUT) and 
@suppress_err (just STDERR), notice that STDERR suppresses warnings but not 
errors! This can be easily understood reading code in the README:

julia> using Suppressor 

julia> @suppress begin  
   println("This string doesn't get printed!")  
   warn("This warning is ignored.") 
   end  

julia> @suppress_out begin  
   println("This string doesn't get printed!")  
   warn("This warning is important")
   end
WARNING: This warning is important  

julia> @suppress_err begin  
   println("This string gets printed!") 
   warn("This warning is unimportant")  
   end  
This string gets printed!   

julia> @suppress begin
   println("This string doesn't get printed!")
   warn("This warning is ignored.")
   error("Remember that errors are still printed!")
   end
--
ErrorException  Stacktrace (most recent 
call last)
[#2] — anonymous
   ⌙ at :?

[#1] — macro expansion;
   ⌙ at Suppressor.jl:16 [inlined]

Remember that errors are still printed!

julia>


So in order to ignore the error you would have to explicitly wrap it in a 
try and explicitly silence it. Also notice that:

import("foo.jl")

is a syntax error, you're supposed to do:

@suppress include("foo.jl")

instead. If you find a bug please file an issue, thanks!


El miércoles, 28 de septiembre de 2016, 2:56:04 (UTC-5), Daniel Carrera 
escribió:
>
> Suppressor.jl would suppress everything, right?
>
> So the idea is that one would use `@suppress import("foo.jl")` ?
>
> As heavy as ClobberingReload.jl is, I appreciate that it only suppresses 
> *one* error -- the annoying "you redefined a method" error that IMO should 
> never have existed in the first place. If there are other errors, like 
> syntax errors, in my script, I do want to hear about those. Or have I 
> misunderstood how Suppressor.jl works?
>
> Cheers,
> Daniel.
>
>
> On 28 September 2016 at 07:36, Chris Rackauckas  > wrote:
>
>> You could've just used Suppressor.jl 
>> ...
>>
>> On Tuesday, September 27, 2016 at 9:55:53 PM UTC-7, K leo wrote:
>>>
>>>
>>> On Wednesday, September 28, 2016 at 12:53:12 PM UTC+8, K leo wrote:

 This a very heavy install.  It's fetching tons of things that I have 
 not used.  Not sure what they are, but seems like trashing my system.

>>>
>>> julia> Pkg.clone("git://github.com/cstjean/ClobberingReload.jl.git")
>>> INFO: Cloning ClobberingReload from git://
>>> github.com/cstjean/ClobberingReload.jl.git
>>> INFO: Computing changes...
>>> INFO: Cloning cache of IJulia from 
>>> https://github.com/JuliaLang/IJulia.jl.git
>>> INFO: Cloning cache of Nettle from 
>>> https://github.com/staticfloat/Nettle.jl.git
>>> INFO: Cloning cache of ZMQ from https://github.com/JuliaLang/ZMQ.jl.git
>>> INFO: Installing Conda v0.3.2
>>> INFO: Installing IJulia v1.3.2
>>> INFO: Installing Nettle v0.2.4
>>> INFO: Installing ZMQ v0.3.4
>>> INFO: Building Nettle
>>> INFO: Building ZMQ
>>> INFO: Building IJulia
>>> INFO: Installing Jupyter via the Conda package.
>>> INFO: Downloading miniconda installer ...
>>>   % Total% Received % Xferd  Average Speed   TimeTime Time 
>>>  Current
>>>  Dload  Upload   Total   SpentLeft 
>>>  Speed
>>> 100 25.9M  100 25.9M0 0  1104k  0  0:00:24  0:00:24 --:--:-- 
>>> 2297k
>>> INFO: Installing miniconda ...
>>> PREFIX=/home/xxx/.julia/v0.5/Conda/deps/usr
>>> installing: _cache-0.0-py27_x0 ...
>>> installing: python-2.7.11-0 ...
>>> installing: conda-env-2.4.5-py27_0 ...
>>> installing: openssl-1.0.2g-0 ...
>>> installing: pycosat-0.6.1-py27_0 ...
>>> installing: pyyaml-3.11-py27_1 ...
>>> installing: readline-6.2-2 ...
>>> installing: requests-2.9.1-py27_0 ...
>>> installing: sqlite-3.9.2-0 ...
>>> installing: tk-8.5.18-0 ...
>>> installing: yaml-0.1.6-0 ...
>>> installing: zlib-1.2.8-0 ...
>>> installing: conda-4.0.5-py27_0 ...
>>> installing: pycrypto-2.6.1-py27_0 ...
>>> installing: pip-8.1.1-py27_1 ...
>>> installing: wheel-0.29.0-py27_0 ...
>>> installing: setuptools-20.3-py27_0 ...
>>> Python 2.7.11 :: Continuum Analytics, Inc.
>>> creating default environment...
>>> installation finished.
>>> Fetching package metadata: 
>>> Solving package specifications: .
>>>
>>> Pa

[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-09-28 Thread Ismael Venegas Castelló
Julia website i18n

I've made a video of me translating the Julia website, just in case anyone 
is curious of how the workflow is like, you can help us translate the 
website to your native language ...one string at a time:



   - 
   
*https://www.livecoding.tv/ismael-vc/videos/oyvBm-julia-language-website-i18n*
   

Let me know what you guys think! [image: :smiley:]

El jueves, 22 de septiembre de 2016, 1:32:13 (UTC-5), Ismael Venegas 
Castelló escribió:
>
> Looking how to contribute to Julia? Check out the web translation project 
> on Transifex. 
> Help us bring Julia internationalization to your native language one 
> string at a time!
>
>
>- https://www.transifex.com/julialang-i18n/julialang-web
>- https://gitter.im/JuliaLangEs/julia-i18n
>- https://github.com/JuliaLang/julialang.github.com/pull/252
>
>

[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-09-24 Thread Ismael Venegas Castelló


The Julia website is now officially also in Spanish, more languages are 
coming soon!


* http://julialang.org


There are still translations and reviews to do, if you are looking for a 
way to contribute to Julia, check the website internationalization project 
on Transifex:


* https://www.transifex.com/julialang-i18n/julialang-web


Contributing is very easy, you just need to register, explore the graphic 
interface a little bit and start translating.


Help us bring Julia internationalization to your native language ...one 
string at a time!


Cheers,

Ismael Venegas Castelló


El jueves, 22 de septiembre de 2016, 1:32:13 (UTC-5), Ismael Venegas 
Castelló escribió:
>
> Looking how to contribute to Julia? Check out the web translation project 
> on Transifex. 
> Help us bring Julia internationalization to your native language one 
> string at a time!
>
>
>- https://www.transifex.com/julialang-i18n/julialang-web
>- https://gitter.im/JuliaLangEs/julia-i18n
>- https://github.com/JuliaLang/julialang.github.com/pull/252
>
>

[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-09-22 Thread Ismael Venegas Castelló
Dear Patrick,

Basically Transifex got us covered there, it has a nifty feature called 
transifex live which automatically extracts and updates the string database 
in the correct way, all the translators have to do is fiddle around with 
the web interface to get used to it, and start translating and reviewing! :D

Transifex live demo:


   - https://www.transifex.com/live_demo
   

Transifex live documentation:


   - http://docs.transifex.com/live
   

You can see here the relevant issue and pull request for adding this into 
the Julia web page, they include lots of technical details about how this 
all works:


   - https://github.com/JuliaLang/julialang.github.com/issues/187
   - https://github.com/JuliaLang/julialang.github.com/pull/252
   
As always if you have any doubt, please don't hesitate to ask and I will 
try to answer all your questions.

Cheers,
Ismael Venegas Castelló

El jueves, 22 de septiembre de 2016, 4:55:41 (UTC-5), Patrick Kofod 
Mogensen escribió:
>
> How does this sync with the "original website"? I mean, what if something 
> changes on the original website?
>
> On Thursday, September 22, 2016 at 8:35:38 AM UTC+2, Ismael Venegas 
> Castelló wrote:
>>
>> I forgot, you guys can see the staging domain here:
>>
>>
>>- http://julialanges.github.io
>>
>> Please let me know what you think!
>>
>> El jueves, 22 de septiembre de 2016, 1:32:13 (UTC-5), Ismael Venegas 
>> Castelló escribió:
>>>
>>> Looking how to contribute to Julia? Check out the web translation 
>>> project on Transifex. 
>>> Help us bring Julia internationalization to your native language one 
>>> string at a time!
>>>
>>>
>>>- https://www.transifex.com/julialang-i18n/julialang-web
>>>- https://gitter.im/JuliaLangEs/julia-i18n
>>>- https://github.com/JuliaLang/julialang.github.com/pull/252
>>>
>>>

[julia-users] Re: julia-i18n: Translators and reviewer needed!

2016-09-21 Thread Ismael Venegas Castelló
I forgot, you guys can see the staging domain here:


   - http://julialanges.github.io
   
Please let me know what you think!

El jueves, 22 de septiembre de 2016, 1:32:13 (UTC-5), Ismael Venegas 
Castelló escribió:
>
> Looking how to contribute to Julia? Check out the web translation project 
> on Transifex. 
> Help us bring Julia internationalization to your native language one 
> string at a time!
>
>
>- https://www.transifex.com/julialang-i18n/julialang-web
>- https://gitter.im/JuliaLangEs/julia-i18n
>- https://github.com/JuliaLang/julialang.github.com/pull/252
>
>

[julia-users] julia-i18n: Translators and reviewer needed!

2016-09-21 Thread Ismael Venegas Castelló
Looking how to contribute to Julia? Check out the web translation project 
on Transifex. 
Help us bring Julia internationalization to your native language one string 
at a time!


   - https://www.transifex.com/julialang-i18n/julialang-web
   - https://gitter.im/JuliaLangEs/julia-i18n
   - https://github.com/JuliaLang/julialang.github.com/pull/252
   


[julia-users] Re: Julia for Data Science book (Technics Publications)

2016-09-14 Thread Ismael Venegas Castelló
I advice you to add a reference to your book, via a pull request to:

   - https://github.com/JuliaLang/julialang.github.com
   
Which should go in this file:

   - 
   
https://github.com/JuliaLang/julialang.github.com/blob/master/learning/index.md
   

El martes, 13 de septiembre de 2016, 19:58:23 (UTC-5), Zacharias Voulgaris 
escribió:
>
> Hi everyone,
>
>  
>
> I’m fairly new in this group but I’ve been an avid Julia user since Ver. 
> 0.2. About a year ago I decided to take the next step and start using Julia 
> professionally, namely for data science projects (even if at that time I 
> was a PM in Microsoft). Shortly afterwards, I started writing a book about 
> it, focusing on how we can use this wonderful tool for data science 
> projects. My aim was to make it easy for everyone to learn to make use of 
> their Julia know-how for tackling data science project, but also to help 
> more experienced data scientists to do what they usually do but instead of 
> Python / R / Scala, use a more elegant tool (Julia). I’m writing this post 
> because this book is finally a reality.
>
>  
>
> In this book, which is titled Julia for Data Science and published by 
> Technics Publications, I cover various data science topics. These include 
> data engineering, supervised and unsupervised  machine learning, 
> statistics, and some graph analysis. Also, since the focus is on 
> applications rather than digging into the deeper layers of the language, I 
> make use of IJulia instead of Juno, while I also refrain from delving into 
> custom types and meta-programming. Yet, in this book I make use of tools 
> and metrics that are rarely, if ever, mentioned in other data science books 
> (e.g. the T-SNE method, some variants of Jaccard Similarity, some 
> alternative error averages for regression, and more). Also, I try to keep 
> assumptions about the reader’s knowledge to a minimum, so there are plenty 
> of links to references for the various concepts used in the book, from 
> reliable sources. Finally, the book includes plenty of reference sections 
> at the end, so you don’t need to remember all the packages introduced, or 
> all the places where you can learn more about the language. Each chapter is 
> accompanied by a series of questions and some exercises, to help you make 
> sure you comprehend everything you’ve read, while at the end I include a 
> full project for you to practice on (answers to all the exercises and the 
> project itself are at an appendix). All the code used in the book is 
> available on Jupyter files, while the data files are also available in .csv 
> and text format.
>
>  
>
> The book is available in both paperback and eBook format (PDF, Kindle, and 
> Safari) at the publisher’s website: https://technicspub.com/analytics
>
>  
>
> Please note that for some reason the Packt publishing house, which has had 
> the monopoly on Julia books up until now, decided to follow suit, which is 
> why it is releasing a book with the same title next month (clearly, 
> imagination is not their strongest suit!). So, please make sure that you 
> don’t confuse the two books. My goal is not to make a quick buck through 
> this book (which is why I’m not publishing it via Packt); instead, I aim to 
> make Julia more well-known to the data science world while at the same time 
> make data science more accessible to all Julia users. 
>
>  
>
> Thanks,
>
>  
>
> Zack
>


Re: [julia-users] Re: Conda.jl needs a new maintainer

2016-09-06 Thread Ismael Venegas Castelló
Hello everyone!

Viral I don't find the JuliaPy organization is it on github? There iare 
also Gettext.jl, Pandas.jl, GeographicLibPy.jl, PyLexYacc.jl, PyLogging.jl, 
PyX.jl and SGP4.jl as far as I can tell, plus from the ones Steven 
mentioned.

El martes, 6 de septiembre de 2016, 9:42:08 (UTC-5), Viral Shah escribió:
>
> Created JuliaPy and sent the invites to authors and contributors of 
> various py*.jl packages.
>
> -viral
>
> On Tuesday, September 6, 2016 at 7:32:34 PM UTC+5:30, Steven G. Johnson 
> wrote:
>>
>> Viral, can you set up JuliaPy and send invites to the relevant people?
>>
>

Re: [julia-users] Re: Use reference of array comprehension internal variables?

2016-08-10 Thread Ismael Venegas Castelló
OMG that's awesome, we need more docs about this feature, thank you very 
much Stefan!

El miércoles, 10 de agosto de 2016, 12:02:34 (UTC-5), Stefan Karpinski 
escribió:
>
> julia> [(x, y, z) for x = 1:n for y = x:n for z = y:n if x^2 + y^2 == z^2]
> 6-element Array{Tuple{Int64,Int64,Int64},1}:
>  (3,4,5)
>  (5,12,13)
>  (6,8,10)
>  (8,15,17)
>  (9,12,15)
>  (12,16,20)
>
> On Wed, Aug 10, 2016 at 12:58 PM, Ismael Venegas Castelló <
> ismael...@gmail.com > wrote:
>
>> In order to be a little more specific I wanted to add, that it seems 
>> weird that I can use the variables for the if clause, but not for creating 
>> the other ranges, it's just that I don't know how to express myself 
>> correctly, I hope you can understand me.
>>
>>
>> El miércoles, 10 de agosto de 2016, 11:56:00 (UTC-5), Ismael Venegas 
>> Castelló escribió:
>>>
>>> Is there a way to make reference of the internal variables of an array 
>>> comprehension? I'm trying to improve this Rosetta Code task:
>>>
>>>
>>>- https://rosettacode.org/wiki/List_comprehensions#Julia
>>>
>>>
>>> const n = 20
>>> sort(filter(x -> x[1] < x[2] && x[1]^2 + x[2]^2 == x[3]^2, [(a, b, c) 
>>> for a=1:n, b=1:n, c=1:n]))
>>>
>>>
>>> In Python it's:
>>>
>>> In [2]: n = 20
>>>
>>> In [3]: [(x,y,z) for x in xrange(1,n+1) for y in xrange(x,n+1) for z in 
>>> xrange(y,n+1) if x**2 + y**2 == z**2]
>>> Out[3]: [(3, 4, 5), (5, 12, 13), (6, 8, 10), (8, 15, 17), (9, 12, 15), (
>>> 12, 16, 20)]
>>>
>>>
>>> I'll update the task with:
>>>
>>> julia> [(x, y, z) for x = 1:n, y = 1:n, z = 1:n if x < y && x^2 + y^2 == 
>>> z^2] |> sort
>>> 6-element Array{Tuple{Int64,Int64,Int64},1}:
>>>  (3,4,5)
>>>  (5,12,13)
>>>  (6,8,10)
>>>  (8,15,17)
>>>  (9,12,15)
>>>  (12,16,20)
>>>
>>> But I tried this and it doesn't work, I wonder why? 
>>>
>>> julia> [(x, y, z) for x = 1:n, y = x:n, z = y:n if x^2 + y^2 == z^2]
>>> ERROR: UndefVarError: x not defined
>>>
>>> Is there a way to do this? Thanks in advance!
>>>
>>
>

[julia-users] Re: Use reference of array comprehension internal variables?

2016-08-10 Thread Ismael Venegas Castelló
In order to be a little more specific I wanted to add, that it seems weird 
that I can use the variables for the if clause, but not for creating the 
other ranges, it's just that I don't know how to express myself correctly, 
I hope you can understand me.

El miércoles, 10 de agosto de 2016, 11:56:00 (UTC-5), Ismael Venegas 
Castelló escribió:
>
> Is there a way to make reference of the internal variables of an array 
> comprehension? I'm trying to improve this Rosetta Code task:
>
>
>- https://rosettacode.org/wiki/List_comprehensions#Julia
>
>
> const n = 20
> sort(filter(x -> x[1] < x[2] && x[1]^2 + x[2]^2 == x[3]^2, [(a, b, c) for 
> a=1:n, b=1:n, c=1:n]))
>
>
> In Python it's:
>
> In [2]: n = 20
>
> In [3]: [(x,y,z) for x in xrange(1,n+1) for y in xrange(x,n+1) for z in 
> xrange(y,n+1) if x**2 + y**2 == z**2]
> Out[3]: [(3, 4, 5), (5, 12, 13), (6, 8, 10), (8, 15, 17), (9, 12, 15), (12
> , 16, 20)]
>
>
> I'll update the task with:
>
> julia> [(x, y, z) for x = 1:n, y = 1:n, z = 1:n if x < y && x^2 + y^2 == z
> ^2] |> sort
> 6-element Array{Tuple{Int64,Int64,Int64},1}:
>  (3,4,5)
>  (5,12,13)
>  (6,8,10)
>  (8,15,17)
>  (9,12,15)
>  (12,16,20)
>
> But I tried this and it doesn't work, I wonder why? 
>
> julia> [(x, y, z) for x = 1:n, y = x:n, z = y:n if x^2 + y^2 == z^2]
> ERROR: UndefVarError: x not defined
>
> Is there a way to do this? Thanks in advance!
>


[julia-users] Use reference of array comprehension internal variables?

2016-08-10 Thread Ismael Venegas Castelló
Is there a way to make reference of the internal variables of an array 
comprehension? I'm trying to improve this Rosetta Code task:


   - https://rosettacode.org/wiki/List_comprehensions#Julia


const n = 20
sort(filter(x -> x[1] < x[2] && x[1]^2 + x[2]^2 == x[3]^2, [(a, b, c) for a=
1:n, b=1:n, c=1:n]))


In Python it's:

In [2]: n = 20

In [3]: [(x,y,z) for x in xrange(1,n+1) for y in xrange(x,n+1) for z in 
xrange(y,n+1) if x**2 + y**2 == z**2]
Out[3]: [(3, 4, 5), (5, 12, 13), (6, 8, 10), (8, 15, 17), (9, 12, 15), (12, 
16, 20)]


I'll update the task with:

julia> [(x, y, z) for x = 1:n, y = 1:n, z = 1:n if x < y && x^2 + y^2 == z^2
] |> sort
6-element Array{Tuple{Int64,Int64,Int64},1}:
 (3,4,5)
 (5,12,13)
 (6,8,10)
 (8,15,17)
 (9,12,15)
 (12,16,20)

But I tried this and it doesn't work, I wonder why? 

julia> [(x, y, z) for x = 1:n, y = x:n, z = y:n if x^2 + y^2 == z^2]
ERROR: UndefVarError: x not defined

Is there a way to do this? Thanks in advance!


[julia-users] Re: Fbls - a simple but flexible Julia DB

2016-04-26 Thread Ismael Venegas Castelló
what's up

Fbls is an attempt at adding more degrees of freedom to the database 
paradigm, it's an itch I've been scratching for a while now. I'm all for 
standards as interfaces and theory as a starting point; but I'm drawing a 
line in the sand right here, the madness has to stop. All I ever really 
cared about was the ability to store, index and retrieve my data. I'm sick 
and tired of having feature check lists, academia and arbitrary limitations 
shoved down my throat; of being forced to bend ideas backwards around hairy 
solutions to the wrong problem, just to gain basic persistence.


Amen! :D

El martes, 19 de abril de 2016, 11:30:49 (UTC-5), fblscode escribió:
>
> Hi Juliets,
> Just started working on my first major Julia project and thought I'd share 
> some of the results so far:
>
> https://github.com/fblscode/Fbls.jl
>
> A few issues that I'm still struggling with:
>
> 1) I would like to add support for using arrays, dicts and other kinds of 
> sequences as field values. The problem I'm having is figuring out if a 
> value is iterable / associable. I'm aware of the informal protocols, but 
> using method_exists to check for them on concrete values isn't working. 
>
> 2) The Fbls event type specifies the types of the arguments it expects as 
> a Tuple{...}. Is there any way to steal the tuple parametric magic to avoid 
> having to leak information about using Tuples? What I'm looking for a way 
> to specify a type as having an arbitrary number of type parameters and 
> being able to them to generate tuple types.
>
> 3) Is there any way to specify parametric function types? The Function 
> type takes no type parameters, and I can't find anything else.
>
> 4) The whole experience was so Lisp like that I found myself reaching for 
> special vars, without success. Is there anything comparable lurking in 
> there somewhere?
>
> Any help appreciated...
>
> Peace
>


Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Ismael Venegas Castelló
Does the field code has a use for non anon funcs? I can see that the g.code
object is a LambdaStaticData, so only for anon funcs. I was trying to
understand the implementation differences.
​

Ismael Venegas Castelló

*Data Analyst*

Cel. 044 55 6434 0229

ivene...@richit.com.mx

Cerro San Francisco 357, C.P. 04200

Campestre Churubusco, Coyoacán

Ciudad de México
<http://t.sidekickopen50.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Frichit.com.mx%2F&si=4656540167962624&pi=b98a84b1-775e-4f1f-89e0-6b127c581e94>

<https://www.facebook.com/richitsolution>
<http://t.sidekickopen50.com/e1t/c/5/f18dQhb0S7lC8dDMPbW2n0x6l2B9nMJW7t5XX43Mx_82W1p1tN-8q-fZWW3LPXXH56dKBHf5NSPJF02?t=https%3A%2F%2Ftwitter.com%2Frichitsolution&si=4656540167962624&pi=b98a84b1-775e-4f1f-89e0-6b127c581e94>
  

Tel. 6718 1818
richit.com.mx

2016-04-26 22:52 GMT-05:00 Yichao Yu :

> On Tue, Apr 26, 2016 at 10:42 PM, Ismael Venegas Castelló
>  wrote:
> > Why is `f.code` an `UndefRefError`?
> >
> > julia> f.code
> >
> > ERROR: UndefRefError: access to undefined reference
> >
>
> Because it doesn't exist.
>
> >
> >
> > El martes, 26 de abril de 2016, 18:27:50 (UTC-5), Yichao Yu escribió:
> >>
> >> On Tue, Apr 26, 2016 at 6:39 PM,   wrote:
> >> > I wonder how to print the expression of a function, e.g. x.^2 for the
> >> > following example.
> >> >
> >> > julia> f(x) = x.^2
> >> > f (generic function with 1 method)
> >> >
> >> > julia> f
> >> > f (generic function with 1 method)
> >> >
> >> > If it is not possible for the expression of a function as simple as
> the
> >> > above to be printed, is there a way to display more info for a
> function,
> >> > instead of just the reference of the container f?
> >> >
> >> > I searched in the past threads and didn't any similar question. But
> this
> >> > may
> >> > be the case because what I'm asking is, again, a dumb question.
> >> >
> >> > Thanks.
> >>
> >>
> >>
> http://julia.readthedocs.org/en/latest/search/?q=code_lowered&check_keywords=yes&area=default#
> >>
> >> >
> >> > Calvin
>


Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Ismael Venegas Castelló
This works with anonymous functions though:

julia> g = (x) -> x.^2
(anonymous function)

julia> g.code

AST(:($(Expr(:lambda, Any[:(x::Any)], Any[Any[Any[:x,:Any,0]],Any[],0,Any
[]], :(begin  # none, line 1:
return x .^ 2
end)





El martes, 26 de abril de 2016, 21:42:29 (UTC-5), Ismael Venegas Castelló 
escribió:
>
> Why is `f.code` an `UndefRefError`?
>
> julia> f.code
>
> ERROR: UndefRefError: access to undefined reference
>
>
>
> El martes, 26 de abril de 2016, 18:27:50 (UTC-5), Yichao Yu escribió:
>>
>> On Tue, Apr 26, 2016 at 6:39 PM,   wrote: 
>> > I wonder how to print the expression of a function, e.g. x.^2 for the 
>> > following example. 
>> > 
>> > julia> f(x) = x.^2 
>> > f (generic function with 1 method) 
>> > 
>> > julia> f 
>> > f (generic function with 1 method) 
>> > 
>> > If it is not possible for the expression of a function as simple as the 
>> > above to be printed, is there a way to display more info for a 
>> function, 
>> > instead of just the reference of the container f? 
>> > 
>> > I searched in the past threads and didn't any similar question. But 
>> this may 
>> > be the case because what I'm asking is, again, a dumb question. 
>> > 
>> > Thanks. 
>>
>>
>> http://julia.readthedocs.org/en/latest/search/?q=code_lowered&check_keywords=yes&area=default#
>>  
>>
>> > 
>> > Calvin 
>>
>

Re: [julia-users] How to print out the expression of a simple function

2016-04-26 Thread Ismael Venegas Castelló
Why is `f.code` an `UndefRefError`?

julia> f.code

ERROR: UndefRefError: access to undefined reference



El martes, 26 de abril de 2016, 18:27:50 (UTC-5), Yichao Yu escribió:
>
> On Tue, Apr 26, 2016 at 6:39 PM,  > 
> wrote: 
> > I wonder how to print the expression of a function, e.g. x.^2 for the 
> > following example. 
> > 
> > julia> f(x) = x.^2 
> > f (generic function with 1 method) 
> > 
> > julia> f 
> > f (generic function with 1 method) 
> > 
> > If it is not possible for the expression of a function as simple as the 
> > above to be printed, is there a way to display more info for a function, 
> > instead of just the reference of the container f? 
> > 
> > I searched in the past threads and didn't any similar question. But this 
> may 
> > be the case because what I'm asking is, again, a dumb question. 
> > 
> > Thanks. 
>
>
> http://julia.readthedocs.org/en/latest/search/?q=code_lowered&check_keywords=yes&area=default#
>  
>
> > 
> > Calvin 
>


[julia-users] Re: How to change REPL mode on startup?

2016-04-22 Thread Ismael Venegas Castelló
You could achieve this behaviour by using an `@async` function and checking 
until `isdefined(Base,:active_repl)`, like so:

function setup()
@async while true
if isdefined(Base,:active_repl)
# enable LipsREPL
LispREPL.initrepl(Base.active_repl)

# enable sticky shell mode
sticky_shell_mode(true)

# enable CxxREPL
!(v"0.4" <= VERSION < v"0.5-") && @eval using Cxx

break
else
sleep(0.25)
end
end
end

My current full `.juliarc.jl`:


   - https://gist.github.com/Ismael-VC/7f44ff56aa53ab2df42dff81fa8feb52
   
Then I would try using `REPL.setup_inferface` as Keno mentions inside that 
async loop and have it execute and change to your repl as soon as 
`Base.active_repl` is instantiated.


El viernes, 15 de abril de 2016, 8:16:53 (UTC-5), lapeyre@gmail.com 
escribió:
>
> I have a REPL mode for an application: 
> https://github.com/jlapeyre/SJulia.jl/blob/master/src/sjulia_repl.jl
>
> I start julia in a terminal,  load the package with 'using SJulia', and 
> then press '=' to enter the alternative mode.  This works fine.
>
> I would like to do this in one step. e.g.  enter 'sjulia' in a terminal 
> and then start in the alternative mode. Problems are:
>
> 1. I have to execute a julia function to start the REPL mode 'after' the 
> REPL starts and I see the julia prompt. Otherwise there is no active REPL. 
> Using .juliarc.jl or julia -e apparently loads and runs code before 
> starting the REPL.  I would like the alternative REPL mode to be created 
> without entering anything at the julia prompt.
>
> 2. Once I create the alternative REPL, I am still in the standard julia 
> REPL mode. To switch to the alternative mode, I enter '='. I would like to 
> enter this mode automatically. There is a function Base.LineEdit.transition 
> that seems to do this. But, it takes a data structure (of type 
> Base.LineEdit.MIState' ) as an argument that I don't know how to get at.  I 
> can probably find it buried somewhere in Base.active_repl, but, I have not 
> been able to so far.
>
> -John
>


Re: [julia-users] Julia on Android (and/or the web) - a scientific calculator on steroids.. good for tablets

2016-03-10 Thread Ismael Venegas Castelló
Of course I understand that, it's not my intention to make assumptions or 
tell people otherwise. I just wanted to show to the community that the 
interest for Julia on Android is anything but fading away. I've never 
participated in an event such as GSOC, but since this semester I return to 
School I'm interested in considering this and the possibilities that may 
arise. :D I'm going to educate myself about all that a GSOC project 
entails, thanks for your help.

El jueves, 10 de marzo de 2016, 5:22:53 (UTC-6), Lutfullah Tomak escribió:
>
> Hi Ismael,
> As I said I cannot do on my own since I've just started a new job. If 
> there is an interested student I can help him/her though
> I am not software engineer. I've just curious about julia on android as 
> you are. So, it's a little overestimate you do on gitter
> sorry about that. I can write a suggestion about it in julia-opt or a 
> related place and intersted party can carry on there.
>
> On Thursday, March 10, 2016 at 6:38:37 AM UTC+2, Ismael Venegas Castelló 
> wrote:
>>
>> Here is a keep recap of what I've been able to achieve so far:
>>
>> * https://gitter.im/termux/termux?at=56e0f41a6fde057c26856001
>>
>>
>> <https://lh3.googleusercontent.com/-7oxuTda5nZk/VuD6Rx2cskI/A9E/WDmYW4Lp8j0/s1600/julia-arm.jpg>
>>
>>
>> El miércoles, 9 de marzo de 2016, 10:35:53 (UTC-6), Lutfullah Tomak 
>> escribió:
>>>
>>> Sure I can write a proposal or suggestion and  if there is an interested 
>>> student I can help the work. I use my phone a substitute for pc so much and 
>>> right now I use a linux chroot app for julia but it is slow compared to 
>>> native apps like termux provides. The thing is I've recently started to a 
>>> new job so it may not be straight away. 
>>>
>>> On Wednesday, March 9, 2016 at 8:32:02 AM UTC+2, Viral Shah wrote:
>>>>
>>>> How about making this a GSOC project? Could you perhaps submit a PR to 
>>>> the GSOC project page on julialang.org with these ideas, since you 
>>>> seem to have made the most amount of progress here? 
>>>>
>>>> -viral 
>>>>
>>>>
>>>>
>>>> > On 09-Mar-2016, at 11:47 AM, Lutfullah Tomak  
>>>> wrote: 
>>>> > 
>>>> > I think the most crictical one that toolchain misses is (lib)gfortran 
>>>> support. I managed to build gfortran for cross compile but I think I am 
>>>> missing pure hard float libgfortran to compile libopenblas with. For 
>>>> android, libopenblas expect hard float libraries. In google provided 
>>>> toolchain, hard float libraries in .../armv7-a/hard but I don't have 
>>>> .../armv7-a/hard directory in my personal build of toolchain. 
>>>> Nevertheless, 
>>>> I can build openblas with lapack support but netlib provided tests does 
>>>> not 
>>>> work well. Blas passes tests. 
>>>> > Also, for some dependecies including llvm, there is an app called 
>>>> termux. They have source package build system available at 
>>>> https://github.com/termux/termux-packages . It can be helpful to look 
>>>> at. They listed julia in their package suggestion page for some time 
>>>> https://termux.com/package-suggestions.html . 
>>>>
>>>>

Re: [julia-users] Julia on Android (and/or the web) - a scientific calculator on steroids.. good for tablets

2016-03-09 Thread Ismael Venegas Castelló
Here is a keep recap of what I've been able to achieve so far:

* https://gitter.im/termux/termux?at=56e0f41a6fde057c26856001




El miércoles, 9 de marzo de 2016, 10:35:53 (UTC-6), Lutfullah Tomak 
escribió:
>
> Sure I can write a proposal or suggestion and  if there is an interested 
> student I can help the work. I use my phone a substitute for pc so much and 
> right now I use a linux chroot app for julia but it is slow compared to 
> native apps like termux provides. The thing is I've recently started to a 
> new job so it may not be straight away. 
>
> On Wednesday, March 9, 2016 at 8:32:02 AM UTC+2, Viral Shah wrote:
>>
>> How about making this a GSOC project? Could you perhaps submit a PR to 
>> the GSOC project page on julialang.org with these ideas, since you seem 
>> to have made the most amount of progress here? 
>>
>> -viral 
>>
>>
>>
>> > On 09-Mar-2016, at 11:47 AM, Lutfullah Tomak  
>> wrote: 
>> > 
>> > I think the most crictical one that toolchain misses is (lib)gfortran 
>> support. I managed to build gfortran for cross compile but I think I am 
>> missing pure hard float libgfortran to compile libopenblas with. For 
>> android, libopenblas expect hard float libraries. In google provided 
>> toolchain, hard float libraries in .../armv7-a/hard but I don't have 
>> .../armv7-a/hard directory in my personal build of toolchain. Nevertheless, 
>> I can build openblas with lapack support but netlib provided tests does not 
>> work well. Blas passes tests. 
>> > Also, for some dependecies including llvm, there is an app called 
>> termux. They have source package build system available at 
>> https://github.com/termux/termux-packages . It can be helpful to look 
>> at. They listed julia in their package suggestion page for some time 
>> https://termux.com/package-suggestions.html . 
>>
>>

[julia-users] Re: JuliaCon 2016: Program Committee Office Hours on the 5th of March at 15:00 UTC

2016-03-02 Thread Ismael Venegas Castelló
Everyone,

Here is the link to the JuliaCon 2016: Program Committee Office Hours, 
Google Hangout: 

   - https://plus.google.com/events/cdjm6biluacltttiocv46e5s8mg

Looking forward to hearing your ideas and seeing you at JuliaCon! 

On behalf of the JuliaCon 2016 organisers, 
Ismael Venegas Castelló
JuliaCon 2016 Proceedings Chair


El miércoles, 2 de marzo de 2016, 16:55:22 (UTC-6), Pontus Stenetorp 
escribió:
>
> Everyone, 
>
> With the JuliaCon 2016 proposal deadline at the 18th of March only being a 
> few 
> weeks away, it is high time to consider what to submit for this years 
> JuliaCon. 
> In order to help potential speakers, we will arrange a public session on 
> the 
> 5th of March at 15:00 UTC where you can interact directly with members of 
> the 
> Program Committee to ask for feedback on your ideas and proposals. 
>
> Maybe you have wondered... 
>
> * Which one of my ideas is the best one? 
> * How interested would the community be in hearing about... 
> * What would be the best way to improve my proposal? 
> * Or any other question you can come up with! 
>
> We will to provide you with feedback that hopefully will lead to you being 
> able 
> to write a better proposal.  The session will be hosted on Google 
> Hangouts and we will follow up this e-mail with a link shortly. 
>
> Looking forward to hearing your ideas and seeing you at JuliaCon! 
>
> On behalf of the JuliaCon 2016 organisers, 
> Pontus Stenetorp 
> JuliaCon 2016 Program Chair 
> Research Associate 
> University College London 
>


[julia-users] The Klopper Lectures - Video Tutorials!

2016-02-23 Thread Ismael Venegas Castelló
Hello everyone just wanted to let you know about this excellent videos I 
found today at YouTube.

*The Klopper Lectures* by Dr. Juan Klopper:

https://www.youtube.com/playlist?list=PLsu0TcgLDUiIznEhN165XmykqyLgzwY0Y

Cheers! :D


[julia-users] equivalent of python's string.title() in julia

2016-02-05 Thread Ismael Venegas Castelló
I made this IJulia gist:

bit.ly/JLTitle

[julia-users] equivalent of python's string.title() in julia

2016-02-05 Thread Ismael Venegas Castelló
You can do something like:

title(s::AbstractString) = join([ucfirst(w) for w in split(s, ' ')], ' 
')::typeof(s)

[julia-users] Re: Crashing REPL experimenting for macro aliases

2016-02-02 Thread Ismael Venegas Castelló
The macro alias is good, but the way you call it is not, instead like this:

julia> eval(Expr(:macrocall, symbol("@m"), :(1+2)))
Expr
  head: Symbol call
  args: Array(Any,(3,))
1: Symbol +
2: Int64 1
3: Int64 2
  typ: Any

Also please do submit a bug report as the crash error indicates, with as 
much info as you can. even when you should get an error you shouldn't get a 
segmentation fault.

* https://github.com/JuliaLang/julia/issues


El martes, 2 de febrero de 2016, 0:32:34 (UTC-6), Leonardo escribió:
>
> Hello,
> I'm looking for a way to create a macro aliases (at now, without success)
>
> I've defined simple macro:
> macro m(ex)
>   dump(ex)
> end
>
> and command 
> dump(:(@m(1+2)))
> returns:
> Expr
>   head: Symbol macrocall
>   args: Array(Any,(2,))
> 1: Symbol @m
> 2: Expr
>   head: Symbol call
>   args: Array(Any,(3,))
> 1: Symbol +
> 2: Int64 1
> 3: Int64 2
>   typ: Any
>   typ: Any
>
> then I've simulated a call to macro m with:
> eval(Expr(:macrocall,[symbol("@m"),:(1+2)]))
>
> but this cause a crash of REPL:
> Please submit a bug report with steps to reproduce this fault, and any 
> error mes
> sages that follow (in their entirety). Thanks.
> Exception: EXCEPTION_ACCESS_VIOLATION at 0x82792b10 -- unknown function 
> (ip: 000
> 082792B10)
> unknown function (ip: 82792B10)
> (I use Julia 0.4.3 under Win64 platform)
>
> BTW, if anyone can suggest me how to define a macro alias ...
>
> Many thanks
>
> Leonardo
>
>

[julia-users] Re: Julia Benchmarks Feedback

2016-01-27 Thread Ismael Venegas Castelló
but then again the benchmarks are flawed because other implementations are 
also timing the interpreters startup time.

El martes, 26 de enero de 2016, 22:07:54 (UTC-6), George escribió:
>
> I was surprised to se the results on the following benchmarks:
> https://github.com/kostya/benchmarks
>
> Some benchmarks of different languages 
> Brainfuck
>
> Brainfuck 
> bench.b
> LanguageTime,sMemory, Mb
> Nim Clang 3.21 0.7
> Felix 4.07 1.3
> Nim Gcc 4.52 0.6
> Java 4.94 147.6
> C++ 5.08 1.1
> Rust 5.46 4.9
> Scala 5.90 116.3
> D 6.57 1.0
> D Ldc 6.61 0.9
> Crystal 6.97 1.3
> Go 7.29 1.3
> Javascript Node 8.74 15.0
> D Gdc 8.87 1.0
> Julia 9.25 59.0
> Javascript V8 9.41 8.1
> Go Gcc 13.60 10.0
> Python Pypy 13.94 55.4
> Javascript Jx 17.14 11.0
> C# Mono 18.08 15.4
> OOC 48.86 1.3
> Ruby JRuby 87.05 124.1
> Ruby Topaz 112.91 36.0
> Ruby JRuby9K 160.15 297.2
> Ruby 226.86 8.0
> Tcl 262.20 2.7
> Python 452.44 4.9
> Ruby Rbx 472.08 45.0
> Python3 480.78 5.5 mandel.b
>
> Mandel in Brainfuck 
> 
> LanguageTime,sMemory, Mb
> Nim Clang 28.96 1.0
> Felix 40.06 3.7
> D Ldc 43.30 0.9
> D 45.29 1.2
> Rust 46.34 4.9
> Crystal 48.62 1.3
> Nim Gcc 50.45 0.9
> Go 52.56 7.6
> Java 55.14 69.9
> Cpp 56.63 1.1
> Scala 64.37 126.4
> D Gdc 70.12 1.5
> Go Gcc 85.67 10.7
> Javascript Node 92.65 15.8
> Julia 94.33 56.9
> ...



Re: [julia-users] Re: Julia Benchmarks Feedback

2016-01-27 Thread Ismael Venegas Castelló
I haven't really paid attention to the code, but I just subbmited a simple 
test funtion for his benchmarks in order to avoid timing the JIT, nothing 
cientific, but more accurate though:

* https://github.com/kostya/benchmarks/pull/79

function test()
  for i in 1:2# First time it's also JIT compiling!
@time main()
  end
end

test()



El miércoles, 27 de enero de 2016, 14:25:01 (UTC-6), Stefan Karpinski 
escribió:
>
> Except that appears to be using Julia's * operator for Float64 arrays 
> which would call BLAS, no?
>
> On Wed, Jan 27, 2016 at 2:29 PM, Ismael Venegas Castelló <
> ismael...@gmail.com > wrote:
>
>> Native in this context means it's apure Julia implementation, ie. it's 
>> not calling an underliying C/Fortran library, see:
>>
>> * 
>> https://github.com/kostya/benchmarks/blob/master/matmul/matmul-native.jl
>>
>> It seems the author has updated the code to use @time, but it's still 
>> timing the JIT. I'll send him a PR
>>
>>
>> El miércoles, 27 de enero de 2016, 8:33:28 (UTC-6), Sisyphuss escribió:
>>>
>>> In the Matmul benchmark, "Julia Native" ranks 1st. 
>>> What is Julia Native?
>>>
>>>
>>> On Wednesday, January 27, 2016 at 7:02:51 AM UTC+1, Nitin Arora wrote:
>>>>
>>>> Check out this thread. There seems to be discussion on this matter 
>>>> already. Looks like the code used for these benchmarks was not well 
>>>> optimized for Julia and looks they are including Julia startup time and 
>>>> JIT 
>>>> compilation.
>>>>
>>>> https://groups.google.com/d/topic/julia-users/4AgBccftrps/discussion
>>>>
>>>> and 
>>>>
>>>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>>>
>>>>
>>>> On Tuesday, January 26, 2016 at 8:07:54 PM UTC-8, George wrote:
>>>>>
>>>>> I was surprised to se the results on the following benchmarks:
>>>>> https://github.com/kostya/benchmarks
>>>>>
>>>>> Some benchmarks of different languages 
>>>>> <https://github.com/kostya/benchmarks#brainfuck>Brainfuck
>>>>>
>>>>> Brainfuck <https://github.com/kostya/benchmarks/tree/master/brainfuck>
>>>>> <https://github.com/kostya/benchmarks#benchb>bench.b
>>>>> LanguageTime,sMemory, Mb
>>>>> Nim Clang 3.21 0.7
>>>>> Felix 4.07 1.3
>>>>> Nim Gcc 4.52 0.6
>>>>> Java 4.94 147.6
>>>>> C++ 5.08 1.1
>>>>> Rust 5.46 4.9
>>>>> Scala 5.90 116.3
>>>>> D 6.57 1.0
>>>>> D Ldc 6.61 0.9
>>>>> Crystal 6.97 1.3
>>>>> Go 7.29 1.3
>>>>> Javascript Node 8.74 15.0
>>>>> D Gdc 8.87 1.0
>>>>> Julia 9.25 59.0
>>>>> Javascript V8 9.41 8.1
>>>>> Go Gcc 13.60 10.0
>>>>> Python Pypy 13.94 55.4
>>>>> Javascript Jx 17.14 11.0
>>>>> C# Mono 18.08 15.4
>>>>> OOC 48.86 1.3
>>>>> Ruby JRuby 87.05 124.1
>>>>> Ruby Topaz 112.91 36.0
>>>>> Ruby JRuby9K 160.15 297.2
>>>>> Ruby 226.86 8.0
>>>>> Tcl 262.20 2.7
>>>>> Python 452.44 4.9
>>>>> Ruby Rbx 472.08 45.0
>>>>> Python3 480.78 5.5 <https://github.com/kostya/benchmarks#mandelb>
>>>>> mandel.b
>>>>>
>>>>> Mandel in Brainfuck 
>>>>> <https://github.com/kostya/benchmarks/blob/master/brainfuck/mandel.b>
>>>>> LanguageTime,sMemory, Mb
>>>>> Nim Clang 28.96 1.0
>>>>> Felix 40.06 3.7
>>>>> D Ldc 43.30 0.9
>>>>> D 45.29 1.2
>>>>> Rust 46.34 4.9
>>>>> Crystal 48.62 1.3
>>>>> Nim Gcc 50.45 0.9
>>>>> Go 52.56 7.6
>>>>> Java 55.14 69.9
>>>>> Cpp 56.63 1.1
>>>>> Scala 64.37 126.4
>>>>> D Gdc 70.12 1.5
>>>>> Go Gcc 85.67 10.7
>>>>> Javascript Node 92.65 15.8
>>>>> Julia 94.33 56.9
>>>>> ...
>>>>
>>>>
>

[julia-users] Re: Julia Benchmarks Feedback

2016-01-27 Thread Ismael Venegas Castelló
Native in this context means it's apure Julia implementation, ie. it's not 
calling an underliying C/Fortran library, see:

* https://github.com/kostya/benchmarks/blob/master/matmul/matmul-native.jl

It seems the author has updated the code to use @time, but it's still 
timing the JIT. I'll send him a PR

El miércoles, 27 de enero de 2016, 8:33:28 (UTC-6), Sisyphuss escribió:
>
> In the Matmul benchmark, "Julia Native" ranks 1st. 
> What is Julia Native?
>
>
> On Wednesday, January 27, 2016 at 7:02:51 AM UTC+1, Nitin Arora wrote:
>>
>> Check out this thread. There seems to be discussion on this matter 
>> already. Looks like the code used for these benchmarks was not well 
>> optimized for Julia and looks they are including Julia startup time and JIT 
>> compilation.
>>
>> https://groups.google.com/d/topic/julia-users/4AgBccftrps/discussion
>>
>> and 
>>
>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>
>>
>> On Tuesday, January 26, 2016 at 8:07:54 PM UTC-8, George wrote:
>>>
>>> I was surprised to se the results on the following benchmarks:
>>> https://github.com/kostya/benchmarks
>>>
>>> Some benchmarks of different languages 
>>> Brainfuck
>>>
>>> Brainfuck 
>>> bench.b
>>> LanguageTime,sMemory, Mb
>>> Nim Clang 3.21 0.7
>>> Felix 4.07 1.3
>>> Nim Gcc 4.52 0.6
>>> Java 4.94 147.6
>>> C++ 5.08 1.1
>>> Rust 5.46 4.9
>>> Scala 5.90 116.3
>>> D 6.57 1.0
>>> D Ldc 6.61 0.9
>>> Crystal 6.97 1.3
>>> Go 7.29 1.3
>>> Javascript Node 8.74 15.0
>>> D Gdc 8.87 1.0
>>> Julia 9.25 59.0
>>> Javascript V8 9.41 8.1
>>> Go Gcc 13.60 10.0
>>> Python Pypy 13.94 55.4
>>> Javascript Jx 17.14 11.0
>>> C# Mono 18.08 15.4
>>> OOC 48.86 1.3
>>> Ruby JRuby 87.05 124.1
>>> Ruby Topaz 112.91 36.0
>>> Ruby JRuby9K 160.15 297.2
>>> Ruby 226.86 8.0
>>> Tcl 262.20 2.7
>>> Python 452.44 4.9
>>> Ruby Rbx 472.08 45.0
>>> Python3 480.78 5.5 
>>> mandel.b
>>>
>>> Mandel in Brainfuck 
>>> 
>>> LanguageTime,sMemory, Mb
>>> Nim Clang 28.96 1.0
>>> Felix 40.06 3.7
>>> D Ldc 43.30 0.9
>>> D 45.29 1.2
>>> Rust 46.34 4.9
>>> Crystal 48.62 1.3
>>> Nim Gcc 50.45 0.9
>>> Go 52.56 7.6
>>> Java 55.14 69.9
>>> Cpp 56.63 1.1
>>> Scala 64.37 126.4
>>> D Gdc 70.12 1.5
>>> Go Gcc 85.67 10.7
>>> Javascript Node 92.65 15.8
>>> Julia 94.33 56.9
>>> ...
>>
>>

[julia-users] Re: Julia vs Clojure for Distributed Scientific Simulations

2016-01-27 Thread Ismael Venegas Castelló
Correction, none of those videos are dated "dated", they are from the las 
JuliaCon, I removed the old videos from the list but forgot to remove the 
comment of some being dated.

Also check out the Julia package ecosystem, there are lots of scientific 
computing libraries:

* http://pkg.julialang.org
* http://pkg.julialang.org/pulse.html
* https://twitter.com/JuliaHeartbeat
* https://github.com/svaksha/Julia.jl

El miércoles, 27 de enero de 2016, 9:53:13 (UTC-6), Ismael Venegas Castelló 
escribió:
>
> How are you benchmarking the Julia code? If you share the microbenchmarks 
> you are doing, we can help you with that, the final decision is yours. 
> Julia es actually a lot like lisp but with "normal" syntax, support for 
> unicode (lots of mathematical symbols also) see: 
>
> * 
> https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm#L6-L22
>
> Julia has very good support for parallel and distributed computing: 
>
> * http://julia.readthedocs.org/en/latest/manual/parallel-computing
>
> True multithreading is coming as an experimental feature for v0.5:
>
> * https://github.com/JuliaLang/julia/labels/multi-threading
>
> As a side note Julia parser is implemented in Scheme; Femtolisp to be 
> precise, try:
>
> $ julia --lisp# :D
>
> And also there is LispSyntax.jl currently in *alpha* development, it may 
> not be in time for your work, but suggestions, bug reports and pull 
> requests are always welcome:
>
> * Code: https://github.com/swadey/LispSyntax.jl
> * LispREPL: https://github.com/swadey/LispREPL.jl
> * Documentation: http://lispsyntaxjl.readthedocs.org/en/latest
> * Gitter chat room: https://gitter.im/swadey/LispSyntax.jl
> * Demo @utnil: https://gist.github.com/Ismael-VC/57e02bf4bf31cfdbe4a2 
> * Demo @code_native: 
> https://gist.github.com/Ismael-VC/c57523f74fb1f1e3f562
>
> I haven't seen any distributed benchmark between Julia and Clojure, be the 
> first to make one, we are here to help each other!
>
> I'm still learning Lisp, Scheme, Clojure, Hy, Pixie, etc. in order for me 
> to contribute to this project.
>
> finally I'm not sure myself, but I have only seen reference to Clojure's 
> Incanter and core.matrix as libraries geared towards scientific computing, 
> in that regard the Julia community is very focused on scientific computing 
> (altough julia is not a domain specific language, it's actually general 
> purpose), here are some Julia videos (some are dated) related to 
> distributed computing:
>
> * Cluster managers and parallel Julia: 
> https://www.youtube.com/watch?v=XJAQ24NS458
> * Distributed memory direct linear algebra and optimization: 
> https://www.youtube.com/watch?v=x-93-IDFdxM
> * Distributed algorithms for full-waveform-inversion: 
> https://www.youtube.com/watch?v=k71RYq2eK50
> * Multithreading Julia: https://www.youtube.com/watch?v=GvLhseZ4D8M
> * Using Julia on a Cray Supercomputer: 
> https://www.youtube.com/watch?v=NwyKz2KLdtY
> * Introduction to Julia: https://www.youtube.com/watch?v=gQ1y5NUD_RI
>
> El martes, 26 de enero de 2016, 22:07:55 (UTC-6), George escribió:
>>
>> I'm working on a scientific simulation that is going to require a 
>> distributed environment.  There has been some discussion about whether to 
>> use Julia or Clojure for this project.  A few micro benchmarks seem to have 
>> different results for each language.  I'm not yet sold as to which language 
>> may be more expressive in this situation, but Lisp might be a preferred 
>> option mathematically for modeling purposes.
>>
>> Does anyone have any practical experience in dealing with both of these 
>> languages and what your experiences were?  
>>
>> Are there any meaningful benchmarks that compare the two, especially in a 
>> distributed environment?
>>
>>
>> Thanks!
>>
>> -George
>>
>

[julia-users] Re: Julia vs Clojure for Distributed Scientific Simulations

2016-01-27 Thread Ismael Venegas Castelló
How are you benchmarking the Julia code? If you share the microbenchmarks 
you are doing, we can help you with that, the final decision is yours. 
Julia es actually a lot like lisp but with "normal" syntax, support for 
unicode (lots of mathematical symbols also) see: 

* https://github.com/JuliaLang/julia/blob/master/src/julia-parser.scm#L6-L22

Julia has very good support for parallel and distributed computing: 

* http://julia.readthedocs.org/en/latest/manual/parallel-computing

True multithreading is coming as an experimental feature for v0.5:

* https://github.com/JuliaLang/julia/labels/multi-threading

As a side note Julia parser is implemented in Scheme; Femtolisp to be 
precise, try:

$ julia --lisp# :D

And also there is LispSyntax.jl currently in *alpha* development, it may 
not be in time for your work, but suggestions, bug reports and pull 
requests are always welcome:

* Code: https://github.com/swadey/LispSyntax.jl
* LispREPL: https://github.com/swadey/LispREPL.jl
* Documentation: http://lispsyntaxjl.readthedocs.org/en/latest
* Gitter chat room: https://gitter.im/swadey/LispSyntax.jl
* Demo @utnil: https://gist.github.com/Ismael-VC/57e02bf4bf31cfdbe4a2 
* Demo @code_native: https://gist.github.com/Ismael-VC/c57523f74fb1f1e3f562

I haven't seen any distributed benchmark between Julia and Clojure, be the 
first to make one, we are here to help each other!

I'm still learning Lisp, Scheme, Clojure, Hy, Pixie, etc. in order for me 
to contribute to this project.

finally I'm not sure myself, but I have only seen reference to Clojure's 
Incanter and core.matrix as libraries geared towards scientific computing, 
in that regard the Julia community is very focused on scientific computing 
(altough julia is not a domain specific language, it's actually general 
purpose), here are some Julia videos (some are dated) related to 
distributed computing:

* Cluster managers and parallel Julia: 
https://www.youtube.com/watch?v=XJAQ24NS458
* Distributed memory direct linear algebra and optimization: 
https://www.youtube.com/watch?v=x-93-IDFdxM
* Distributed algorithms for full-waveform-inversion: 
https://www.youtube.com/watch?v=k71RYq2eK50
* Multithreading Julia: https://www.youtube.com/watch?v=GvLhseZ4D8M
* Using Julia on a Cray Supercomputer: 
https://www.youtube.com/watch?v=NwyKz2KLdtY
* Introduction to Julia: https://www.youtube.com/watch?v=gQ1y5NUD_RI

El martes, 26 de enero de 2016, 22:07:55 (UTC-6), George escribió:
>
> I'm working on a scientific simulation that is going to require a 
> distributed environment.  There has been some discussion about whether to 
> use Julia or Clojure for this project.  A few micro benchmarks seem to have 
> different results for each language.  I'm not yet sold as to which language 
> may be more expressive in this situation, but Lisp might be a preferred 
> option mathematically for modeling purposes.
>
> Does anyone have any practical experience in dealing with both of these 
> languages and what your experiences were?  
>
> Are there any meaningful benchmarks that compare the two, especially in a 
> distributed environment?
>
>
> Thanks!
>
> -George
>


[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Ismael Venegas Castelló
That is just one implementation of scheme among many, try:

julia --lisp

;-)

El martes, 26 de enero de 2016, 17:49:00 (UTC-6), Sisyphuss escribió:
>
> Didn't imagine that the Scheme is called "gauche" in Ubuntu...
>
> P.S. "gauche" is a French word, which means "left"
>
>
>
> On Wednesday, January 27, 2016 at 12:24:14 AM UTC+1, Ismael Venegas 
> Castelló wrote:
>>
>> I wondered the same first time I saw quine-relay! ...Yusuke is genius :D
>>
>> * https://github.com/mame/quine-relay
>>
>> El martes, 26 de enero de 2016, 16:49:29 (UTC-6), Sisyphuss escribió:
>>>
>>> I didn't know that a man can learn so many languages... is he a genius? 
>>>
>>>
>>> On Tuesday, January 26, 2016 at 11:39:00 PM UTC+1, Ismael Venegas 
>>> Castelló wrote:
>>>>
>>>> @ylluminate <https://github.com/ylluminate> looking at the structure 
>>>> of the Julia programs, I can only see @kostya 
>>>> <https://github.com/kostya> is timing both Julia startup, the JIT and 
>>>> the code at the same time, which is wrong
>>>>
>>>>- https://github.com/kostya/benchmarks/blob/master/base64/test.jl
>>>>- 
>>>>https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26
>>>>
>>>> Let's continue this discussion at julia-users:
>>>>
>>>>- https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps
>>>>
>>>>
>>>> El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas 
>>>> Castelló escribió:
>>>>>
>>>>> Continues: 
>>>>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>>>>
>>>>

[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Ismael Venegas Castelló
I'll try to fix one of them in my spare time, and see if he can fix the 
rest.

El martes, 26 de enero de 2016, 17:41:25 (UTC-6), Sisyphuss escribió:
>
> See what I find :"yes, i am bad at julia, pr please how to better code in 
> it. or i can remove the tests with julia."
> Ref: https://github.com/kostya/benchmarks/issues/9
>
>
>
> On Wednesday, January 27, 2016 at 12:24:14 AM UTC+1, Ismael Venegas 
> Castelló wrote:
>>
>> I wondered the same first time I saw quine-relay! ...Yusuke is genius :D
>>
>> * https://github.com/mame/quine-relay
>>
>> El martes, 26 de enero de 2016, 16:49:29 (UTC-6), Sisyphuss escribió:
>>>
>>> I didn't know that a man can learn so many languages... is he a genius? 
>>>
>>>
>>> On Tuesday, January 26, 2016 at 11:39:00 PM UTC+1, Ismael Venegas 
>>> Castelló wrote:
>>>>
>>>> @ylluminate <https://github.com/ylluminate> looking at the structure 
>>>> of the Julia programs, I can only see @kostya 
>>>> <https://github.com/kostya> is timing both Julia startup, the JIT and 
>>>> the code at the same time, which is wrong
>>>>
>>>>- https://github.com/kostya/benchmarks/blob/master/base64/test.jl
>>>>- 
>>>>https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26
>>>>
>>>> Let's continue this discussion at julia-users:
>>>>
>>>>- https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps
>>>>
>>>>
>>>> El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas 
>>>> Castelló escribió:
>>>>>
>>>>> Continues: 
>>>>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>>>>
>>>>

[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Ismael Venegas Castelló
I wondered the same first time I saw quine-relay! ...Yusuke is genius :D

* https://github.com/mame/quine-relay

El martes, 26 de enero de 2016, 16:49:29 (UTC-6), Sisyphuss escribió:
>
> I didn't know that a man can learn so many languages... is he a genius? 
>
>
> On Tuesday, January 26, 2016 at 11:39:00 PM UTC+1, Ismael Venegas Castelló 
> wrote:
>>
>> @ylluminate <https://github.com/ylluminate> looking at the structure of 
>> the Julia programs, I can only see @kostya <https://github.com/kostya> is 
>> timing both Julia startup, the JIT and the code at the same time, which is 
>> wrong
>>
>>- https://github.com/kostya/benchmarks/blob/master/base64/test.jl
>>- 
>>https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26
>>
>> Let's continue this discussion at julia-users:
>>
>>- https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps
>>
>>
>> El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas Castelló 
>> escribió:
>>>
>>> Continues: 
>>> https://github.com/JuliaLang/julia/issues/14808#event-527206420
>>>
>>

[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Ismael Venegas Castelló
I was also saddened to see this observation:

*Julia instead is slowing down and it disappeared from my radar during the 
last 9 month. It is still young and promising but it slowed down a bit this 
year so I don’t think it deserve the Top 5 for now.*

http://www.davideaversa.it/2015/12/the-most-promising-languages-of-2016

*@ylluminate*: that is just one opinion! ;)

El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas Castelló 
escribió:
>
> Continues: https://github.com/JuliaLang/julia/issues/14808#event-527206420
>


[julia-users] Re: Lies... and then benchmarks...

2016-01-26 Thread Ismael Venegas Castelló


@ylluminate <https://github.com/ylluminate> looking at the structure of the 
Julia programs, I can only see @kostya <https://github.com/kostya> is 
timing both Julia startup, the JIT and the code at the same time, which is 
wrong

   - https://github.com/kostya/benchmarks/blob/master/base64/test.jl
   - https://github.com/kostya/benchmarks/blob/master/base64/run.sh#L25-L26

Let's continue this discussion at julia-users:

   - https://groups.google.com/forum/#!topic/julia-users/4AgBccftrps


El martes, 26 de enero de 2016, 16:36:22 (UTC-6), Ismael Venegas Castelló 
escribió:
>
> Continues: https://github.com/JuliaLang/julia/issues/14808#event-527206420
>


[julia-users] Lies... and then benchmarks...

2016-01-26 Thread Ismael Venegas Castelló
Continues: https://github.com/JuliaLang/julia/issues/14808#event-527206420


[julia-users] Re: Expression object for "unquote"

2016-01-18 Thread Ismael Venegas Castelló
That's because in the case of expressions, we are interested in the AST, 
show representation is just an abstraction of that, there is also dump and 
xdump:

julia> ex = :(:($x))
:($(Expr(:quote, :($(Expr(:$, :x))

julia> Meta.show_sexpr(ex); println()
(:quote, (:$, :x))

julia> dump(ex)

Expr  
  head: Symbol quote
  args: Array(Any,(1,))
1: Expr  
  head: Symbol $
  args: Array(Any,(1,))
1: Symbol x
  typ: Any
  typ: Any

julia> ex.args[1].args[1] = :y
:y

julia> ex
:($(Expr(:quote, :($(Expr(:$, :y))

julia> Meta.show_sexpr(ex); println()
(:quote, (:$, :y))

julia> dump(ex)
Expr  
  head: Symbol quote
  args: Array(Any,(1,))
1: Expr  
  head: Symbol $
  args: Array(Any,(1,))
1: Symbol y
  typ: Any
  typ: Any

You could overwrite those methods or write your own that prints them the 
way you want to.

El domingo, 17 de enero de 2016, 1:50:05 (UTC-6), vis...@stanford.edu 
escribió:
>
> Hi!
>
> Was messing around with exceptions, and trying to see under the hood and 
> construct macro expressions. 
>
> Eg, Meta.show_sexpr(:(:(+ 1 2))) -> (:quote, (:call, :+, 1, 2))
>
> but how do you build an unquote expression?
>
> Meta.show_sexpr(:(:($(x+5) + 1))) -> (:quote, (:call, :+, (:$, (:call, :+, 
> :x, 5)), 1))
>
>
> But Expr(:quote, Expr(:call, :+, Expr(:$, Expr(:call, :+, :x, 5)), 1)) -> 
> :($(Expr(:quote, :($(Expr(:$, :(x + 5))) + 1
>
> In other words, it's not processing into the appropriate expression, and 
> there's some weird intermediate syntax going on. 
>
>
> How does one build an unquote expression? I.e, an expression that would 
> eval to unquoting a variable?
>


[julia-users] Re: ANN: Lisp.jl gitter chat room online!

2016-01-09 Thread Ismael Venegas Castelló
S-Expressions for Julia!

* https://en.wikipedia.org/wiki/S-expression

El sábado, 9 de enero de 2016, 10:21:20 (UTC-6), Ismael Venegas Castelló 
escribió:
>
> Come join us, welcome everybody! :D
>
> * https://gitter.im/swadey/Lisp.jl
>


[julia-users] ANN: Lisp.jl gitter chat room online!

2016-01-09 Thread Ismael Venegas Castelló
Come join us, welcome everybody! :D

* https://gitter.im/swadey/Lisp.jl


Re: [julia-users] Why SimpleVector / svec?

2016-01-06 Thread Ismael Venegas Castelló
Thanks for explaining this to me Matt, I still think builtins should be 
wrapped into julia functions, instead of diferentiating them more, could we 
switch to arrays instead of keep using svecs once julia defines the array 
type? That I'll try to figure out today.

El martes, 5 de enero de 2016, 9:09:08 (UTC-6), Matt Bauman escribió:
>
> On Tuesday, January 5, 2016 at 3:23:14 AM UTC-5, Ismael Venegas Castelló 
> wrote:
>
>> Why force `methods` to work with anything?
>>
>
> Because you can call anything:
>
> julia> call(x::Char) = x+1
> call (generic function with 1038 methods)
>
> julia> 'c'()
> 'd'
>
> julia> methods('c')
> 1-element Array{Any,1}:
>  call(x::Char) at none:1
>
> There's been a much stronger push for documenting the external interfaces, 
> but there's more and more internal developer documentation these days, too (
> http://docs.julialang.org/en/latest/devdocs/julia/).  It's getting better.
>
> I believe flisp.boot is a generated file.
>
> Builtins are simply functions (and types) that are written in C; necessary 
> for bootstrapping.  You can find the mapping between their Julia names and 
> the C definitions here: 
> https://github.com/JuliaLang/julia/blob/baf174f5c252a438006c6f23ed7097fbab004025/src/builtins.c#L1202-L1284.
>  
>  Search for their C names to find their definitions.  They accept any 
> number of Any arguments within their function definitions, but those that 
> require a certain number of arguments have error checking within the C 
> function.
>
> Also note that anonymous functions have the type `Function`, too.  The 
> introspection utility you want is `isgeneric`.  I imagine lots of this will 
> change with the jb/functions branch, where all functions are generic.
>


[julia-users] Re: Juliabox cannot start after Pkg.add (unlink error in read-only file system)

2016-01-06 Thread Ismael Venegas Castelló
Point releases are being taged monthly! ;-)

El martes, 5 de enero de 2016, 20:58:17 (UTC-6), David Gleich escribió:
>
> Thanks for that! I figured someone else must have run into this but my 
> googling and searching efforts were in vain!
>
> Is the time-frame for the next release imminent? I was hoping to use 
> juliabox in a class I'm starting next week, but this issue could be 
> problematic for many of those students to work around. 
>
> Or, I guess I could try and write a routine that would automatically edit 
> their .juliarc file to add it ... hmm...
>
> David
>
> On Tuesday, January 5, 2016 at 11:51:33 AM UTC-5, Steven G. Johnson wrote:
>>
>> See https://github.com/JuliaLang/JuliaBox/issues/338 for a workaround; 
>> this should be fixed in the next Julia 0.4.x release.
>>
>

[julia-users] Re: Overriding the = operator

2016-01-05 Thread Ismael Venegas Castelló
You could use another similar operator like \coloneq:

julia> ≔(var, block) = @eval $var = $block
≔ (generic function with 1 method)

julia> @show :foo ≔ "some foo"; foo
:foo ≔ "some foo" = "some foo"
"some foo"

julia> @show :foo ≔ 42; foo
:foo ≔ 42 = 42
42

julia> macro ≔(v, b)
   e = Expr(:global, v)
   :($e; $(esc(v)) = $(esc(b)))
   end

julia> @≔ foo :FOO
:FOO

julia> @≔ foo :FOO; foo
:FOO

julia> macro ≔(v, b)
   e = Expr(:global, v)
   :(global $e; $(esc(v)) = $(esc(b)))

julia> @≔ bar "some bar"; bar
"some bar"

julia> @≔ bar 7; bar
7



El martes, 5 de enero de 2016, 3:18:07 (UTC-6), Julia Tylors escribió:
>
> Hi,
>
> How can i override the = operator?
>
> Thanks
>
> function ={T}(x::T,y::T)
> ...
> end
>
> didn't work
>
> Thanks
>


Re: [julia-users] Why SimpleVector / svec?

2016-01-05 Thread Ismael Venegas Castelló
I have but sadly github sucks at searching, but it's not only that. I think 
that all this builtins are treated wrong at several non useful levels, for 
example:

julia> methods(is)
ERROR: ArgumentError: argument is not a generic function
 in methods at reflection.jl:180

julia> methods(1)
0-element Array{Any,1}

julia> methods("a")
0-element Array{Any,1}

julia> methods('c')
0-element Array{Any,1}

Oh yeah! so svec, `is` and friends are not generic functions, so of course 
you cant apply the `methods` function on them, but you can apply it on 
integers, strings, chars and anything else? (at least non generic functions 
are still kinda functions right?)

Honestly I've been saying WTF a lots of time as I keep experimenting with 
them LOL, because, it seems that `is` is not a generic func but literal 
integers somehow are no problem to give the impression of being treated as 
such? 

Builtins are not anonymous functions either, but that is what typeof tells 
you, only one can get that error message? I think we should not use the 
ones not intended for public consumption after bootstrap if that can be 
done, promote the others to generic functions and of course document all of 
them either way.

I think this is wrong:

methods(x::ANY) = methods(call, Tuple{isa(x,Type) ? Type{x} : typeof(x), 
Vararg{Any}})

form: https://github.com/JuliaLang/julia/blob/master/base/reflection.jl#L193

methods(x::DataType) = ...

Would be better IMHO, less voodoo. Why force `methods` to work with 
anything?

As I keep on digging this stuff, my WTF are increasing, documentation 
obscurantism doesn't help a bit either :-)

I hope I can understand enough so I can at least make a decent issue, I 
don't really know. I could be all wrong and just I just don't get it, but 
this smells fishy.

julia> typeof(is)
Function

julia> typeof(Base.svec)
Function

help?> Base.svec
  No documentation found.

  Core.svec is an *anonymous* Function.

Honeslty I wish that at some point we could devote a whole release cycle to 
documentation, another to testing, another for performance, etc, before 
continuing to add more stuff. Something like what Linus wanted to do with a 
Linux release cycle. Why does femtolisp can't shouldn't be documented also 
for example?

>From femtolisp: *This project is mostly a matter of style. Look at the code 
and you'll understand. (...yeah sure!)*

Then you find things like 
this: https://github.com/JeffBezanson/femtolisp/blob/master/flisp.boot   
--^

Sorry for the rambling I just found too many twisted things I can 
understand  for a single night, so I'll call it a day, but I'm truly and 
deeply intrigued by this and how to make it better.

El martes, 5 de enero de 2016, 0:39:39 (UTC-6), Mauro escribió:
>
> As far as I understand: svecs are simple indexable containers; they are 
> used in bootstrap before arrays are defined.  Once arrays are defined 
> they are not really useful anymore and thus not intended as a datatype 
> for public consumption.  Still, they should get some documentation as 
> one can stumble upon them.  Github may be able to tell you more. 
>
> On Tue, 2016-01-05 at 06:08, Ismael Venegas Castelló  > wrote: 
> > 
> >- What exactly are these SimpleVectors? 
> >- Why show them as svec? 
> >- What's their purpose? 
> >- How to use SimpleVector constructor manually, without using 
> Core.svec? 
> > 
> > 
> > They are not documented at all. All I understand is that they are svec 
> is 
> > not generic but "intrinsic" / "builtin", I think they are used earlier 
> in 
> > bootstrap? 
> > 
> > Since they don't work with @which, an @whereis kinda macro would be nice 
> to 
> > give a link to their source code in github, even if it's in C or 
> whatever. 
> > IMHO we should really differentiate all this "anonymous" (that's what 
> > typeof tell you) functions and document them. 
> > 
> > Couldn't we just wrap them in Julia functions and treat them as the 
> rest? 
> > 
> > julia> svec(args...) = Core.svec(args...) 
> > svec (generic function with 1 method) 
> > 
> > julia> svec(1) 
> > svec(1) 
>


[julia-users] Re: Why SimpleVector / svec?

2016-01-04 Thread Ismael Venegas Castelló
This would also allow to use @which, `methods` and other reflection 
functions.

El lunes, 4 de enero de 2016, 23:25:29 (UTC-6), Ismael Venegas Castelló 
escribió:
>
> I feel we should either differentiate them or integrate them better, they 
> are not listed anywhere, Steffan provided a complicated way of getting a 
> list of those:
>
> function builtins()
>nams = filter(s -> isdefined(Base, s), names(Base, true, true))
>objs   = map(s -> Base.(s), nams)
>funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), objs)
>convert(Vector{Symbol}, sort!(map(symbol, unique(funcs
> end
>
> julia> builtins()
> 22-element Array{Symbol,1}:
> :_apply
> :_expr
> :applicable
> :apply_type
> :arrayref
> :arrayset
> :arraysize
> :fieldtype
> :getfield
> :invoke
> ⋮
> :isdefined
> :issubtype
> :kwcall
> :nfields
> :setfield!
> :svec
> :throw
> :tuple
> :typeassert
> :typeof
>
> Here: https://groups.google.com/forum/#!topic/julia-users/m_5t0-bIJ8c
>
> I think that it would be possible to change the names of those builtins to 
> __ instead of , and then in boot.jl, have the julian 
> definitions like (args::types) = __(args). So it would be 
> possible to extend such functions.
>
>
> El lunes, 4 de enero de 2016, 23:08:52 (UTC-6), Ismael Venegas Castelló 
> escribió:
>>
>>
>>- What exactly are these SimpleVectors?
>>- Why show them as svec?
>>- What's their purpose? 
>>- How to use SimpleVector constructor manually, without using 
>>Core.svec? 
>>
>>
>> They are not documented at all. All I understand is that they are svec is 
>> not generic but "intrinsic" / "builtin", I think they are used earlier in 
>> bootstrap?
>>
>> Since they don't work with @which, an @whereis kinda macro would be nice 
>> to give a link to their source code in github, even if it's in C or 
>> whatever. IMHO we should really differentiate all this "anonymous" (that's 
>> what typeof tell you) functions and document them.
>>
>> Couldn't we just wrap them in Julia functions and treat them as the rest?
>>
>> julia> svec(args...) = Core.svec(args...)
>> svec (generic function with 1 method)
>>
>> julia> svec(1)
>> svec(1)
>>
>

[julia-users] Re: Why SimpleVector / svec?

2016-01-04 Thread Ismael Venegas Castelló
I feel we should either differentiate them or integrate them better, they 
are not listed anywhere, Steffan provided a complicated way of getting a 
list of those:

function builtins()
   nams = filter(s -> isdefined(Base, s), names(Base, true, true))
   objs   = map(s -> Base.(s), nams)
   funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), objs)
   convert(Vector{Symbol}, sort!(map(symbol, unique(funcs
end

julia> builtins()
22-element Array{Symbol,1}:
:_apply
:_expr
:applicable
:apply_type
:arrayref
:arrayset
:arraysize
:fieldtype
:getfield
:invoke
⋮
:isdefined
:issubtype
:kwcall
:nfields
:setfield!
:svec
:throw
:tuple
:typeassert
:typeof

Here: https://groups.google.com/forum/#!topic/julia-users/m_5t0-bIJ8c

I think that it would be possible to change the names of those builtins to 
__ instead of , and then in boot.jl, have the julian 
definitions like (args::types) = __(args). So it would be 
possible to extend such functions.


El lunes, 4 de enero de 2016, 23:08:52 (UTC-6), Ismael Venegas Castelló 
escribió:
>
>
>- What exactly are these SimpleVectors?
>- Why show them as svec?
>- What's their purpose? 
>- How to use SimpleVector constructor manually, without using 
>Core.svec? 
>
>
> They are not documented at all. All I understand is that they are svec is 
> not generic but "intrinsic" / "builtin", I think they are used earlier in 
> bootstrap?
>
> Since they don't work with @which, an @whereis kinda macro would be nice 
> to give a link to their source code in github, even if it's in C or 
> whatever. IMHO we should really differentiate all this "anonymous" (that's 
> what typeof tell you) functions and document them.
>
> Couldn't we just wrap them in Julia functions and treat them as the rest?
>
> julia> svec(args...) = Core.svec(args...)
> svec (generic function with 1 method)
>
> julia> svec(1)
> svec(1)
>


[julia-users] Why SimpleVector / svec?

2016-01-04 Thread Ismael Venegas Castelló

   
   - What exactly are these SimpleVectors?
   - Why show them as svec?
   - What's their purpose? 
   - How to use SimpleVector constructor manually, without using Core.svec? 
   

They are not documented at all. All I understand is that they are svec is 
not generic but "intrinsic" / "builtin", I think they are used earlier in 
bootstrap?

Since they don't work with @which, an @whereis kinda macro would be nice to 
give a link to their source code in github, even if it's in C or whatever. 
IMHO we should really differentiate all this "anonymous" (that's what 
typeof tell you) functions and document them.

Couldn't we just wrap them in Julia functions and treat them as the rest?

julia> svec(args...) = Core.svec(args...)
svec (generic function with 1 method)

julia> svec(1)
svec(1)


Re: [julia-users] Why does the subtypes method produce an array rather than a set?

2016-01-04 Thread Ismael Venegas Castelló
After watching the video: *Jeff Bezanzon: Julia - The base language, future 
directions and speculations  *as 
Scott mentions, returning a Union type indeed starts to make sense to me.


El sábado, 2 de enero de 2016, 13:09:43 (UTC-6), Scott Jones escribió:
>
> Going by Jeff's JuliaCon 2015 talk, and the code in 
> examples/JuliaTypes.jl, I think returning the subtypes as a set of types 
> (which is the same as a union of types) makes perfect sense.
> I'm hoping that this change does make it into 0.5, I think it does clean 
> up a lot of bad corner cases in the current type system (which Jeff also 
> mentioned in his talk)
>
> On Tuesday, December 29, 2015 at 5:45:51 PM UTC-5, Ray Toal wrote:
>>
>> But maybe I'm not understanding this correctly? Was it suggested that a 
>> type union be the result of the subtypes method? I don't think that makes 
>> sense The subtypes of a type is a set of types, not a type (even if 
>> that type were the union of all the subtypes). It strikes me as a little 
>> odd, but I may have misheard, or there might me an interpretation of it 
>> that I haven't thought about.
>>
>> On Tuesday, December 29, 2015 at 7:02:41 AM UTC-8, Scott Jones wrote:
>>>
>>> Yes! 😄 I was hoping that Jeff had implemented something super fast for 
>>> type unions.
>>
>>

[julia-users] Re: Escher File Upload

2015-12-29 Thread Ismael Venegas Castelló
Hi! I just hanted to point out that there is also an active Escher chat 
room here:

* https://gitter.im/shashi/Escher.jl

El martes, 29 de diciembre de 2015, 10:24:33 (UTC-6), Brandon Miller 
escribió:
>
> I am wanting to implement a form for file uploads.  There does not appear 
> to be any Escher widgets that support drag and drops or directory browsing. 
>  My question being does anyone know of any file upload example web code or 
> the right libraries to look into that works well with Escher if I need to 
> develop a widget from scratch?   Also are there any plans for a Escher 
> widget for drag and drop or file browsing?  Thank you!
>


[julia-users] Re: Interactive selection of points in PyPlot

2015-12-29 Thread Ismael Venegas Castelló
Immerse.jl offers mouse interactivity:

* https://github.com/JuliaGraphics/Immerse.jl
* 
https://www.youtube.com/watch?v=urM4SY92QTI&list=PLP8iPy9hna6SQ5eBWQLVGBXSQMdEADeiA

El martes, 29 de diciembre de 2015, 7:08:49 (UTC-6), Johan Silen escribió:
>
> Assume you plot a dataset plot(x,y,"o"). Using ginput() it is possible to 
> find positions of the mouse to get e.g. windowing
> limits from even a complex polygon. Is there a direct method available to 
> extract those points from the set x,y belonging to the polygon by some 
> simple PyPlot function or is it necessary to build this one self?
>
> Tanks Johan
>


[julia-users] Re: Pipe operator and functions with multiple arguments

2015-12-29 Thread Ismael Venegas Castelló
My proposal in the PR is:

julia> show_off(x, y) = (@show x y; nothing)
show_off (generic function with 1 method)

julia> show_off(1, 2)
x = 1
y = 2

julia> (1, 2) |> show_off
ERROR: MethodError: `show_off` has no method matching 
show_off(::Tuple{Int64,Int
64})
Closest candidates are:
  show_off(::Any, ::Any)
 in |> at operators.jl:198
 in eval at boot.jl:263

julia> Base.|>(xs::Tuple, f) = f(xs...)
|> (generic function with 7 methods)

julia> (1, 2) |> show_off
x = 1
y = 2

Note: splat *...* is slow, type inference is broken don't use this in 
performance critical code. Since this is I/O it's ok I guess. Since |> may 
be deprecated, in the future there also may be a package that allows to do 
this and extend the functionality beyond, for now you have to define that 
method yourself, if you decide t use it you can put the method definition 
in you ~/.juliarc.jl configuration file.



El martes, 29 de diciembre de 2015, 11:02:09 (UTC-6), Adrian Salceanu 
escribió:
>
> I'm a bit puzzled by the behavior of the pipe operator when feeding values 
> to functions expecting multiple arguments. Basically it doesn't seem to 
> work at all. Am I missing something? 
>
> Ex: 
>
> julia> function show_off(x, y)
>println(x)
>println(y)
>end
> show_off (generic function with 1 method)
>
>
> julia> show_off(1, 2)
> 1
> 2
>
>
> julia> 1 |> show_off(2)
> ERROR: MethodError: `show_off` has no method matching show_off(::Int64)
> Closest candidates are:
>   show_off(::Any, ::Any)
>
>
> julia> 1,2 |> show_off
> ERROR: MethodError: `show_off` has no method matching show_off(::Int64)
> Closest candidates are:
>   show_off(::Any, ::Any)
>  in |> at operators.jl:198
>
>
> julia> (1,2) |> show_off
> ERROR: MethodError: `show_off` has no method matching show_off(::Tuple{
> Int64,Int64})
> Closest candidates are:
>   show_off(::Any, ::Any)
>  in |> at operators.jl:198
>
>

[julia-users] Re: Pipe operator and functions with multiple arguments

2015-12-29 Thread Ismael Venegas Castelló
Hi Adrian, that's the way it works now for now, single-input single-output 
functions only, |> may be even deprecated in the future since type 
inference doesn't work well at all for now, it's going to be removed from 
Base it seems. Currying/function chaining has been discussed a lot at 
GitHub.

Here is a pull request I made to make what you want possible (it contains 
links to several other similar discussions at GitHub), since I also just 
expected it to work:

* https://github.com/JuliaLang/julia/pull/14476

You can see my solution (and other peoples solutions) there and decide 
whether to use it or not yourself.



El martes, 29 de diciembre de 2015, 11:02:09 (UTC-6), Adrian Salceanu 
escribió:
>
> I'm a bit puzzled by the behavior of the pipe operator when feeding values 
> to functions expecting multiple arguments. Basically it doesn't seem to 
> work at all. Am I missing something? 
>
> Ex: 
>
> julia> function show_off(x, y)
>println(x)
>println(y)
>end
> show_off (generic function with 1 method)
>
>
> julia> show_off(1, 2)
> 1
> 2
>
>
> julia> 1 |> show_off(2)
> ERROR: MethodError: `show_off` has no method matching show_off(::Int64)
> Closest candidates are:
>   show_off(::Any, ::Any)
>
>
> julia> 1,2 |> show_off
> ERROR: MethodError: `show_off` has no method matching show_off(::Int64)
> Closest candidates are:
>   show_off(::Any, ::Any)
>  in |> at operators.jl:198
>
>
> julia> (1,2) |> show_off
> ERROR: MethodError: `show_off` has no method matching show_off(::Tuple{
> Int64,Int64})
> Closest candidates are:
>   show_off(::Any, ::Any)
>  in |> at operators.jl:198
>
>

[julia-users] Re: strange behavior with float value multiplication

2015-12-28 Thread Ismael Venegas Castelló
You can see the binary representation of those `Float64`s with the `bits` 
function:

julia> for i in 1:10
 @show bits(a * i)
   end
bits(a * i) = 
"00001001100110011001100110011001100110011001100110011010"

bits(a * i) = 
"00011001100110011001100110011001100110011001100110011010"

bits(a * i) = 
"00100011001100110011001100110011001100110011001100110100"

bits(a * i) = 
"00101001100110011001100110011001100110011001100110011010"

bits(a * i) = 
"0011"

bits(a * i) = 
"00110011001100110011001100110011001100110011001100110100"

bits(a * i) = 
"00110110011001100110011001100110011001100110011001100111"

bits(a * i) = 
"00111001100110011001100110011001100110011001100110011010"

bits(a * i) = 
"0000110011001100110011001100110011001100110011001101"

bits(a * i) = 
"0100"



El lunes, 28 de diciembre de 2015, 3:59:24 (UTC-6), Yonghee Kim escribió:
>
> I wrote simple code like this
>
> --
> a = 0.2
>
> for i in 1:10
>   println(a * i)
> end
> ---
>
>
> and what I got is not 0.2, 0.4, 0.6, 0.8, 1.0  
>
> but this.
>
> 0.2
> 0.4
> 0.6001
> 0.8
> 1.0
> 1.2002
> 1.4001
> 1.6
> 1.8
> 2.0
>
>
>
> println(0.2 * 3) does the same thing. not 0.6 but 0.6001
>
> does anyone know why this happens? 
>
>

Re: [julia-users] Why does the subtypes method produce an array rather than a set?

2015-12-28 Thread Ismael Venegas Castelló
Stefan, wouldn't using `sort!` instead of `sort` be better here in this 
case?:

subtypes(m::Module, x::DataType) = sort(collect(_subtypes(m, x)), by=string)

subtypes(m::Module, x::DataType) = sort!(collect(_subtypes(m, x)), 
by=string)



El lunes, 28 de diciembre de 2015, 9:25:08 (UTC-6), Stefan Karpinski 
escribió:
>
> No, please don't spend time on this. We're not going to change this to 
> return a heavyweight data structure like a Set when a simple structure like 
> and Array will do. In mathematics sets are simpler than ordered 
> collections, but in programming languages the relationship is reversed. In 
> general data structures like Set are only used when they are necessary, 
> such as when you need O(1) checking for inclusion. Since there's no such 
> need here, an array is simpler and better.
>
> On Mon, Dec 28, 2015 at 2:40 AM, Kevin Squire  > wrote:
>
>> Hi Ray,
>>
>> You're probably the first person to make this observation. I can see your 
>> point, and I don't really have a strong argument or opinion, really--the 
>> main reason it's sorted is probably because it looks nicer--at least if 
>> I did write that code, that would  have been my reasoning.
>>
>> If you're up for it, you could change it to create a set and submit a 
>> pull request. No guarantees it gets accepted, but the likelihood increases 
>> significantly over not submitting one. :-)
>>
>> Cheers,
>>Kevin 
>>
>>
>> On Sunday, December 27, 2015, Ray Toal > 
>> wrote:
>>
>>> I'm sure the order won't ever change, but I'd still find it odd if the 
>>> documentation of subtypes were to say
>>>
>>> "Returns a list of subtypes, sorted by the name of the subtype"
>>>
>>> because, well, what about namespaces? What about all sorts of Unicode 
>>> collation definitions that would have to be a part of such a definition?
>>>
>>> Yes, as much as I would like to just assert that the result of calling 
>>> subtypes on Type produces the array [DataType, TypeConstructor, Union] it's 
>>> just not supposed to be an array, even if today we can guarantee that the 
>>> array will be sorted, and it is ridiculously unlikely to change.
>>>
>>> I just think of unordered collections as sets. I don't think anyone 
>>> would or should ever write code that takes advantage of the fact that this 
>>> array is sorted, though. :)
>>>
>>> Thanks for the responses
>>>
>>> Ray
>>>
>>>
>>> On Sunday, December 27, 2015 at 5:10:46 PM UTC-8, Kevin Squire wrote:
>>>>
>>>> Thanks for looking and posting (I've been on my phone).  I think I 
>>>> might have written that code, actually. ;-)
>>>>
>>>> Cheers!
>>>>Kevin 
>>>>
>>>> On Sunday, December 27, 2015, Ismael VC  wrote:
>>>>
>>>>> Kevin I tested in my Win laptop with 0.3.11, 0.4.2, 0.4, 0.5+ also the 
>>>>> same versions in julia box, and the output is deterministically sorted, 
>>>>> It 
>>>>> seems this has been the way it works for some time now, then I looked at 
>>>>> the code and it’s indeed sorted (should have done that first! :P ):
>>>>>
>>>>>- http://git.io/vEXL9 
>>>>>
>>>>> subtypes(m::Module, x::DataType) = sort(collect(_subtypes(m, x)), 
>>>>> by=string)
>>>>> subtypes(x::DataType) = subtypes(Main, x)
>>>>>
>>>>> I would expect a very good reason in order to justify a change for 
>>>>> this now.
>>>>> ​
>>>>>
>>>>> 2015-12-27 18:06 GMT-06:00 Kevin Squire
>>>>>
>>>>>> Ray, thanks for the clarification--makes sense. In fact, for 
>>>>>> introspection code like 'subtypes', performance is probably the wrong 
>>>>>> argument--it's unlikely that it occurs in performance-critical code. I 
>>>>>> think it's really that arrays are just simpler. 
>>>>>>
>>>>>> One aesthetic change I could imagine would be to have the results 
>>>>>> sorted before returning, which would keep the same data structure, but 
>>>>>> solve your problem, and present the subtypes in a way the user would 
>>>>>> likely 
>>>>>> find more useful.  
>>>>>>
>>>>>> Ismael, it might be a little 

Re: [julia-users] Does any one have Raspberry Pi 2 Julia binaries?

2015-12-27 Thread Ismael Venegas Castelló
I just found this Rpi Emulator (I don't want to hinder the build process in 
my Rpi2 rigth now), but it dosen't say which Rpi it's emulating.

* http://sourceforge.net/projects/rpiqemuwindows

El domingo, 27 de diciembre de 2015, 17:05:05 (UTC-6), Ismael Venegas 
Castelló escribió:
>
> Thank you Milan I will test this ASAP :D
>
> El domingo, 27 de diciembre de 2015, 16:46:45 (UTC-6), Milan Bouchet-Valat 
> escribió:
>>
>> Le dimanche 27 décembre 2015 à 11:47 -0800, Ismael Venegas Castelló a 
>> écrit : 
>> > has anyone successfully built Julia for Raspberry Pi 2? I understand 
>> > that it's able to build now. If anyone has been able to do this 
>> > ...could you share your binary? I'm building it right now, but it 
>> > seems it's going to take ages, and I have yet to see it fail or not! 
>> > 
>> > I want to build a Raspberry Pi 2 Julia DIY calculator! Like this one: 
>> > https://www.youtube.com/watch?v=lJu1ij_Emlk 
>> > 
>> > These could be used for plotting: 
>> > https://github.com/johnmyleswhite/ASCIIPlots.jl 
>> > https://github.com/sunetos/TextPlots.jl 
>> > https://github.com/Evizero/UnicodePlots.jl 
>> Viral posted a link to 0.4 ARM binaries here: 
>> https://groups.google.com/d/msg/julia-users/lEDCaBbMMKM/jQ5W4-tdAAAJ 
>>
>>
>> Regards 
>>
>

Re: [julia-users] Does any one have Raspberry Pi 2 Julia binaries?

2015-12-27 Thread Ismael Venegas Castelló
Thank you Milan I will test this ASAP :D

El domingo, 27 de diciembre de 2015, 16:46:45 (UTC-6), Milan Bouchet-Valat 
escribió:
>
> Le dimanche 27 décembre 2015 à 11:47 -0800, Ismael Venegas Castelló a 
> écrit : 
> > has anyone successfully built Julia for Raspberry Pi 2? I understand 
> > that it's able to build now. If anyone has been able to do this 
> > ...could you share your binary? I'm building it right now, but it 
> > seems it's going to take ages, and I have yet to see it fail or not! 
> > 
> > I want to build a Raspberry Pi 2 Julia DIY calculator! Like this one: 
> > https://www.youtube.com/watch?v=lJu1ij_Emlk 
> > 
> > These could be used for plotting: 
> > https://github.com/johnmyleswhite/ASCIIPlots.jl 
> > https://github.com/sunetos/TextPlots.jl 
> > https://github.com/Evizero/UnicodePlots.jl 
> Viral posted a link to 0.4 ARM binaries here: 
> https://groups.google.com/d/msg/julia-users/lEDCaBbMMKM/jQ5W4-tdAAAJ 
>
>
> Regards 
>


[julia-users] Re: passing function as arguments and avoiding unecessary allocations

2015-12-27 Thread Ismael Venegas Castelló
Alan please don't double post the same 
question: https://groups.google.com/forum/#!topic/julia-users/2AoQQKVP2Do

It makes it difficult to follow the thread, thanks!

El domingo, 27 de diciembre de 2015, 11:21:35 (UTC-6), alan souza escribió:
>
> Hi. I was wondering what is the correct way to pass a function as argument 
> preserving the return type information
>
> For instance in the following code:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *function sinc{T<:Real}(x::T)return T((x != zero(T) 
> )?(sin(pi*x)/(pi*x)):(one(T)))endfunction calcF{T<:Real}(X::Array{T,1}, 
> F::Function)n = length(X); @assert(n > 0)y = zeros(T, n)for 
> i in eachindex(X)y[i] = F(X[i])endreturn yendfunction 
> calcSinc{T<:Real}(X::Array{T,1})n = length(X); @assert(n > 0)y 
> = zeros(T, n)for i in eachindex(X)y[i] = sinc(X[i])end
> return yendfunction main{T<:Real}(min::T, max::T, d::T)X = 
> collect(min:d:max)calcF(X, sinc)calcSinc(X)@code_warntype 
> calcF(X, sinc)@time calcF(X, sinc)@code_warntype calcSinc(X)
> @time calcSinc(X)YF = calcF(X, sinc)YS = 
> calcSinc(X)endmain(-1.0*pi,1.0*pi,0.1)*After running this code I got 
> these results (using @code_warntype and @time) :
> function CalcF:
>
>
>
>
>
>
> *  #s1 = GenSym(5) # /home/user/scratch/julia/test.jl, line 10:  
> GenSym(2) = 
> (F::F)((Base.arrayref)(X::Array{Float64,1},i::Int64)::Float64)::ANY  
> (Base.arrayset)(y::Array{Float64,1},(top(typeassert))((Base.convert)(Float64,GenSym(2))::ANY,Float64)::Float64,i::Int64)::Array{Float64,1}
>   
> 5:   unless 
> (Base.box)(Base.Bool,(Base.not_int)((Base.box)(Base.Bool,(Base.not_int)(#s1::Int64
>  
> === 
> (Base.box)(Base.Int,(Base.add_int)((top(getfield))(GenSym(0),:stop)::Int64,1))::Bool
>  
> goto 4  3:   0.080181 seconds (1.88 M allocations: 33.556 MB, 6.41% gc 
> time)*
>
> but for the function calcSinc:
>
>
>
>
>
>
> *  #s1 = GenSym(5) # /home/user/scratch/julia/test.jl, line 20:  
> GenSym(2) = 
> (Main.sinc)((Base.arrayref)(X::Array{Float64,1},i::Int64)::Float64)::Float64  
> 
> (Base.arrayset)(y::Array{Float64,1},GenSym(2),i::Int64)::Array{Float64,1} 
>  
> 5:   unless 
> (Base.box)(Base.Bool,(Base.not_int)((Base.box)(Base.Bool,(Base.not_int)(#s1::Int64
>  
> === 
> (Base.box)(Base.Int,(Base.add_int)((top(getfield))(GenSym(0),:stop)::Int64,1))::Bool
>  
> goto 4  3:   0.031224 seconds (2 allocations: 4.794 MB)*
>
> Is there a way to avoid these allocation on the first case?
>
> thanks.
>


Re: [julia-users] Nongeneric functions

2015-12-27 Thread Ismael Venegas Castelló
I think this would be useful even if not exported so we can give better 
error messages, ie:

julia> @which 1 === 1
ERROR: ArgumentError: argument is not a generic function
 in methods at reflection.jl:140

Ok, so it's not a generic function, then what it is?

julia> @which 1 === 1
ERROR: ArgumentError: argument `is` is a builtin function not a generic 
function
for a list of builtin functions use `builtins()`
 in methods at reflection.jl:140


ERROR: ArgumentError: argument `x` is an intrinsic function not a X function
for a list of intrinsic functions use `intrinsics()`
 in methods at reflection.jl:140


Which I think it's better, IMHO, I had absolutely no idea `is` was an anon 
func, nor that it was a builtin, and we don't list or explain the 
difference in the manual, which pherhaps could be included also, even if 
its in the dev docs.

Is a builtin the same as an intrinsic? Why is `is` not a `BuiltinFunction` 
or something like that?

I think this could be used if we are going to change Function to an 
abstract type, (I red this recently), then all the other function variants 
could be subtypes of Function (IntrinsicFunction is alone in the Type tree).

What I don't understand quite well is if ther is going to be an 
`AnonymousFunction` type, I understand that this will be lowered to 
gensymed generic functions, am I right?

All in all I think that what we really need are more informative error 
messages, the `info` function could be used a lot more IMHO for example, 
and the functions I proposed could be used for this purpose, even if the 
implementation changes, the point remains the same, more 
introspection/reflexion and better info/war/error messages overall.


El domingo, 27 de diciembre de 2015, 15:08:40 (UTC-6), Stefan Karpinski 
escribió:
>
> Perhaps, but all of this is going to change fairly soon. Why is this 
> information useful?
>
> On Sun, Dec 27, 2015 at 4:03 PM, Ismael Venegas Castelló <
> ismael...@gmail.com > wrote:
>
>> We could use something like this:
>>
>> julia> isbuiltin(x) = in(symbol(x), builtins())
>> isbuiltin (generic function with 1 method)
>>
>> julia> isbuiltin(is)
>> true
>>
>> We could also change this functions documentation, something like this:
>>
>> help?> is
>> search: ind2sub ind2sub! @ip_str include_string @int128_str is isa issym 
>> isqrt
>>
>>   Builtin function:
>>
>>   is(x, y) -> Bool
>>   ===(x,y) -> Bool
>>   ≡(x,y) -> Bool
>>
>>   Determine whether x and y are identical, in the sense that no program 
>> could
>>   distinguish them. Compares mutable objects by address in memory, and
>>   compares immutable objects (such as numbers) by contents at the bit 
>> level.
>>   This function is sometimes called egal.
>>
>>   ..  ===(x, y)
>>  ≡(x,y)
>>
>>   See the :func:`is` operator
>>
>>
>>
>> El domingo, 27 de diciembre de 2015, 14:59:31 (UTC-6), Ismael Venegas 
>> Castelló escribió:
>>>
>>> So `is` is a builtin anonymous function?
>>>
>>> julia> Base.function_name(is)
>>> :anonymous
>>>
>>> Stefan perhaps we should add a builtins function to inference.jl? Indeed 
>>> it's not obvious at all!
>>>
>>> julia> function builtins()
>>>nams = filter(s -> isdefined(Base, s), names(Base, true, 
>>> true))
>>>objs   = map(s -> Base.(s), nams)
>>>funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), 
>>> objs)
>>>sort!(map(symbol, unique(funcs)))
>>>end
>>> builtins (generic function with 1 method)
>>>
>>> julia> builtins()
>>> 24-element Array{Any,1}:
>>>  :_apply
>>>  :_expr
>>>  :applicable
>>>  :apply_type
>>>  :arraylen
>>>  :arrayref
>>>  :arrayset
>>>  :arraysize
>>>  :fieldtype
>>>  :getfield
>>>  :invoke
>>>  :is
>>>  :isa
>>>  :isdefined
>>>  :issubtype
>>>  :kwcall
>>>  :method_exists
>>>  :nfields
>>>  :setfield!
>>>  :svec
>>>  :throw
>>>  :tuple
>>>  :typeassert
>>>  :typeof
>>>
>>> julia>
>>>
>>>
>>>
>>> El domingo, 27 de diciembre de 2015, 14:36:52 (UTC-6), Stefan Karpinski 
>>> escribió:
>>>>
>>>> In Julia 0.4 anonymous functions are non-generic (in 0.5 they will, 
>>>> however, be generic), so that's one way to create a non-generic function. 

Re: [julia-users] Nongeneric functions

2015-12-27 Thread Ismael Venegas Castelló
I needed to ad a `convert(Vector{Symbol}, .)`, since map can't tell 
it's a Symbol array, why?

function builtins()
nams = filter(s -> isdefined(Base, s), names(Base, true, true))
objs   = map(s -> Base.(s), nams)
funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), objs)
convert(Vector{Symbol}, sort!(map(symbol, unique(funcs
end

julia> builtins()
22-element Array{Symbol,1}:
 :_apply
 :_expr
 :applicable
 :apply_type
 :arrayref
 :arrayset
 :arraysize
 :fieldtype
 :getfield
 :invoke
 ⋮
 :isdefined
 :issubtype
 :kwcall
 :nfields
 :setfield!
 :svec
 :throw
 :tuple
 :typeassert
 :typeof



El domingo, 27 de diciembre de 2015, 15:03:04 (UTC-6), Ismael Venegas 
Castelló escribió:
>
> We could use something like this:
>
> julia> isbuiltin(x) = in(symbol(x), builtins())
> isbuiltin (generic function with 1 method)
>
> julia> isbuiltin(is)
> true
>
> We could also change this functions documentation, something like this:
>
> help?> is
> search: ind2sub ind2sub! @ip_str include_string @int128_str is isa issym 
> isqrt
>
>   Builtin function:
>
>   is(x, y) -> Bool
>   ===(x,y) -> Bool
>   ≡(x,y) -> Bool
>
>   Determine whether x and y are identical, in the sense that no program 
> could
>   distinguish them. Compares mutable objects by address in memory, and
>   compares immutable objects (such as numbers) by contents at the bit 
> level.
>   This function is sometimes called egal.
>
>   ..  ===(x, y)
>  ≡(x,y)
>
>   See the :func:`is` operator
>
>
>
> El domingo, 27 de diciembre de 2015, 14:59:31 (UTC-6), Ismael Venegas 
> Castelló escribió:
>>
>> So `is` is a builtin anonymous function?
>>
>> julia> Base.function_name(is)
>> :anonymous
>>
>> Stefan perhaps we should add a builtins function to inference.jl? Indeed 
>> it's not obvious at all!
>>
>> julia> function builtins()
>>nams = filter(s -> isdefined(Base, s), names(Base, true, true))
>>objs   = map(s -> Base.(s), nams)
>>funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), 
>> objs)
>>sort!(map(symbol, unique(funcs)))
>>end
>> builtins (generic function with 1 method)
>>
>> julia> builtins()
>> 24-element Array{Any,1}:
>>  :_apply
>>  :_expr
>>  :applicable
>>  :apply_type
>>  :arraylen
>>  :arrayref
>>  :arrayset
>>  :arraysize
>>  :fieldtype
>>  :getfield
>>  :invoke
>>  :is
>>  :isa
>>  :isdefined
>>  :issubtype
>>  :kwcall
>>  :method_exists
>>  :nfields
>>  :setfield!
>>  :svec
>>  :throw
>>  :tuple
>>  :typeassert
>>  :typeof
>>
>> julia>
>>
>>
>>
>> El domingo, 27 de diciembre de 2015, 14:36:52 (UTC-6), Stefan Karpinski 
>> escribió:
>>>
>>> In Julia 0.4 anonymous functions are non-generic (in 0.5 they will, 
>>> however, be generic), so that's one way to create a non-generic function. 
>>> Aside from anonymous functions, the only non-generic are the builtins, 
>>> defined in C code using the add_builtin_func function:
>>>
>>> $ ack add_builtin_func src
>>> src/builtins.c
>>> 1196:static void add_builtin_func(const char *name, jl_fptr_t f)
>>> 1204:add_builtin_func("is", jl_f_is);
>>> 1205:add_builtin_func("typeof", jl_f_typeof);
>>> 1206:add_builtin_func("sizeof", jl_f_sizeof);
>>> 1207:add_builtin_func("issubtype", jl_f_subtype);
>>> 1208:add_builtin_func("isa", jl_f_isa);
>>> 1209:add_builtin_func("typeassert", jl_f_typeassert);
>>> 1210:add_builtin_func("throw", jl_f_throw);
>>> 1211:add_builtin_func("tuple", jl_f_tuple);
>>> 1214:add_builtin_func("getfield",  jl_f_get_field);
>>> 1215:add_builtin_func("setfield!",  jl_f_set_field);
>>> 1216:add_builtin_func("fieldtype", jl_f_field_type);
>>> 1217:add_builtin_func("nfields", jl_f_nfields);
>>> 1218:add_builtin_func("isdefined", jl_f_isdefined);
>>> 1221:add_builtin_func("arrayref", jl_f_arrayref);
>>> 1222:add_builtin_func("arrayset", jl_f_arrayset);
>>> 1223:add_builtin_func("arraysize", jl_f_arraysize);
>>> 1226:add_builtin_func("applicable", jl_f_applicable);
>>> 1227:add_builtin_func("invoke", jl_f_invoke

Re: [julia-users] Nongeneric functions

2015-12-27 Thread Ismael Venegas Castelló
We could use something like this:

julia> isbuiltin(x) = in(symbol(x), builtins())
isbuiltin (generic function with 1 method)

julia> isbuiltin(is)
true

We could also change this functions documentation, something like this:

help?> is
search: ind2sub ind2sub! @ip_str include_string @int128_str is isa issym 
isqrt

  Builtin function:

  is(x, y) -> Bool
  ===(x,y) -> Bool
  ≡(x,y) -> Bool

  Determine whether x and y are identical, in the sense that no program 
could
  distinguish them. Compares mutable objects by address in memory, and
  compares immutable objects (such as numbers) by contents at the bit level.
  This function is sometimes called egal.

  ..  ===(x, y)
 ≡(x,y)

  See the :func:`is` operator



El domingo, 27 de diciembre de 2015, 14:59:31 (UTC-6), Ismael Venegas 
Castelló escribió:
>
> So `is` is a builtin anonymous function?
>
> julia> Base.function_name(is)
> :anonymous
>
> Stefan perhaps we should add a builtins function to inference.jl? Indeed 
> it's not obvious at all!
>
> julia> function builtins()
>nams = filter(s -> isdefined(Base, s), names(Base, true, true))
>objs   = map(s -> Base.(s), nams)
>funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), 
> objs)
>sort!(map(symbol, unique(funcs)))
>end
> builtins (generic function with 1 method)
>
> julia> builtins()
> 24-element Array{Any,1}:
>  :_apply
>  :_expr
>  :applicable
>  :apply_type
>  :arraylen
>  :arrayref
>  :arrayset
>  :arraysize
>  :fieldtype
>  :getfield
>  :invoke
>  :is
>  :isa
>  :isdefined
>  :issubtype
>  :kwcall
>  :method_exists
>  :nfields
>  :setfield!
>  :svec
>  :throw
>  :tuple
>  :typeassert
>  :typeof
>
> julia>
>
>
>
> El domingo, 27 de diciembre de 2015, 14:36:52 (UTC-6), Stefan Karpinski 
> escribió:
>>
>> In Julia 0.4 anonymous functions are non-generic (in 0.5 they will, 
>> however, be generic), so that's one way to create a non-generic function. 
>> Aside from anonymous functions, the only non-generic are the builtins, 
>> defined in C code using the add_builtin_func function:
>>
>> $ ack add_builtin_func src
>> src/builtins.c
>> 1196:static void add_builtin_func(const char *name, jl_fptr_t f)
>> 1204:add_builtin_func("is", jl_f_is);
>> 1205:add_builtin_func("typeof", jl_f_typeof);
>> 1206:add_builtin_func("sizeof", jl_f_sizeof);
>> 1207:add_builtin_func("issubtype", jl_f_subtype);
>> 1208:add_builtin_func("isa", jl_f_isa);
>> 1209:add_builtin_func("typeassert", jl_f_typeassert);
>> 1210:add_builtin_func("throw", jl_f_throw);
>> 1211:add_builtin_func("tuple", jl_f_tuple);
>> 1214:add_builtin_func("getfield",  jl_f_get_field);
>> 1215:add_builtin_func("setfield!",  jl_f_set_field);
>> 1216:add_builtin_func("fieldtype", jl_f_field_type);
>> 1217:add_builtin_func("nfields", jl_f_nfields);
>> 1218:add_builtin_func("isdefined", jl_f_isdefined);
>> 1221:add_builtin_func("arrayref", jl_f_arrayref);
>> 1222:add_builtin_func("arrayset", jl_f_arrayset);
>> 1223:add_builtin_func("arraysize", jl_f_arraysize);
>> 1226:add_builtin_func("applicable", jl_f_applicable);
>> 1227:add_builtin_func("invoke", jl_f_invoke);
>> 1230:add_builtin_func("apply_type", jl_f_instantiate_type);
>> 1231:add_builtin_func("_apply", jl_f_apply);
>> 1232:add_builtin_func("kwcall", jl_f_kwcall);
>> 1233:add_builtin_func("_expr", jl_f_new_expr);
>> 1234:add_builtin_func("svec", jl_f_svec);
>>
>>
>> You can determine the same list from the Julia side by this 
>> not-so-obvious code:
>>
>> julia> unique(filter(x->isa(x,Function) && isa(x.env,Symbol), 
>> map(s->Base.(s), filter(s->isdefined(Base,s), names(Base, true, true)
>> 22-element Array{Any,1}:
>>  issubtype
>>  is
>>  _apply
>>  _expr
>>  applicable
>>  apply_type
>>  arrayref
>>  arrayset
>>  arraysize
>>  fieldtype
>>  getfield
>>  invoke
>>  isa
>>  isdefined
>>  kwcall
>>  nfields
>>  setfield!
>>  svec
>>  throw
>>  tuple
>>  typeassert
>>  typeof
>>
>>
>> On Sun, Dec 27, 2015 at 2:57 PM, Ray Toal  wrote:
>>
>>> In the REPL
>>>
>>>
>>> *julia> **methods(is)*
>>>
>>> *ERROR: ArgumentError: argument is not a generic function*
>>>
>>> * in methods at reflection.jl:180*
>>>
>>>
>>> and ditto for isa and typeof and perhaps others.
>>>
>>> Two quick questions:
>>>
>>>- Is it possible for the programmer to create nongeneric functions 
>>>in Julia?
>>>- If not, is there a complete (at least up to the current release 
>>>version of the language) list of nongeneric functions?
>>>
>>>
>>>
>>>
>>

Re: [julia-users] Nongeneric functions

2015-12-27 Thread Ismael Venegas Castelló
So `is` is a builtin anonymous function?

julia> Base.function_name(is)
:anonymous

Stefan perhaps we should add a builtins function to inference.jl? Indeed 
it's not obvious at all!

julia> function builtins()
   nams = filter(s -> isdefined(Base, s), names(Base, true, true))
   objs   = map(s -> Base.(s), nams)
   funcs = filter(x -> isa(x, Function) && isa(x.env, Symbol), objs)
   sort!(map(symbol, unique(funcs)))
   end
builtins (generic function with 1 method)

julia> builtins()
24-element Array{Any,1}:
 :_apply
 :_expr
 :applicable
 :apply_type
 :arraylen
 :arrayref
 :arrayset
 :arraysize
 :fieldtype
 :getfield
 :invoke
 :is
 :isa
 :isdefined
 :issubtype
 :kwcall
 :method_exists
 :nfields
 :setfield!
 :svec
 :throw
 :tuple
 :typeassert
 :typeof

julia>



El domingo, 27 de diciembre de 2015, 14:36:52 (UTC-6), Stefan Karpinski 
escribió:
>
> In Julia 0.4 anonymous functions are non-generic (in 0.5 they will, 
> however, be generic), so that's one way to create a non-generic function. 
> Aside from anonymous functions, the only non-generic are the builtins, 
> defined in C code using the add_builtin_func function:
>
> $ ack add_builtin_func src
> src/builtins.c
> 1196:static void add_builtin_func(const char *name, jl_fptr_t f)
> 1204:add_builtin_func("is", jl_f_is);
> 1205:add_builtin_func("typeof", jl_f_typeof);
> 1206:add_builtin_func("sizeof", jl_f_sizeof);
> 1207:add_builtin_func("issubtype", jl_f_subtype);
> 1208:add_builtin_func("isa", jl_f_isa);
> 1209:add_builtin_func("typeassert", jl_f_typeassert);
> 1210:add_builtin_func("throw", jl_f_throw);
> 1211:add_builtin_func("tuple", jl_f_tuple);
> 1214:add_builtin_func("getfield",  jl_f_get_field);
> 1215:add_builtin_func("setfield!",  jl_f_set_field);
> 1216:add_builtin_func("fieldtype", jl_f_field_type);
> 1217:add_builtin_func("nfields", jl_f_nfields);
> 1218:add_builtin_func("isdefined", jl_f_isdefined);
> 1221:add_builtin_func("arrayref", jl_f_arrayref);
> 1222:add_builtin_func("arrayset", jl_f_arrayset);
> 1223:add_builtin_func("arraysize", jl_f_arraysize);
> 1226:add_builtin_func("applicable", jl_f_applicable);
> 1227:add_builtin_func("invoke", jl_f_invoke);
> 1230:add_builtin_func("apply_type", jl_f_instantiate_type);
> 1231:add_builtin_func("_apply", jl_f_apply);
> 1232:add_builtin_func("kwcall", jl_f_kwcall);
> 1233:add_builtin_func("_expr", jl_f_new_expr);
> 1234:add_builtin_func("svec", jl_f_svec);
>
>
> You can determine the same list from the Julia side by this not-so-obvious 
> code:
>
> julia> unique(filter(x->isa(x,Function) && isa(x.env,Symbol), 
> map(s->Base.(s), filter(s->isdefined(Base,s), names(Base, true, true)
> 22-element Array{Any,1}:
>  issubtype
>  is
>  _apply
>  _expr
>  applicable
>  apply_type
>  arrayref
>  arrayset
>  arraysize
>  fieldtype
>  getfield
>  invoke
>  isa
>  isdefined
>  kwcall
>  nfields
>  setfield!
>  svec
>  throw
>  tuple
>  typeassert
>  typeof
>
>
> On Sun, Dec 27, 2015 at 2:57 PM, Ray Toal 
> > wrote:
>
>> In the REPL
>>
>>
>> *julia> **methods(is)*
>>
>> *ERROR: ArgumentError: argument is not a generic function*
>>
>> * in methods at reflection.jl:180*
>>
>>
>> and ditto for isa and typeof and perhaps others.
>>
>> Two quick questions:
>>
>>- Is it possible for the programmer to create nongeneric functions in 
>>Julia?
>>- If not, is there a complete (at least up to the current release 
>>version of the language) list of nongeneric functions?
>>
>>
>>
>>
>

[julia-users] Re: Why does the subtypes method produce an array rather than a set?

2015-12-27 Thread Ismael Venegas Castelló
You can just do:

@assert subtypes(Type) == [DataType, TypeConstructor, Union]

I just tested this:

julia> @time for i in 1:1000
   @assert subtypes(Type) == [DataType, TypeConstructor, Union]
   end
  3.025415 seconds (767.00 k allocations: 224.075 MB, 0.49% gc time)



El sábado, 26 de diciembre de 2015, 12:52:51 (UTC-6), Ray Toal escribió:
>
> I noticed that 
>
> *julia> **subtypes(Type)*
>
> *3-element Array{Any,1}:*
>
> * DataType  *
>
> * TypeConstructor*
>
> * Union *
>
> and was wondering if there was any significance in the order of the 
> subtypes. If not, could the method have produced a Set instead?
>
>

[julia-users] Re: Why does the subtypes method produce an array rather than a set?

2015-12-27 Thread Ismael Venegas Castelló
I just tested and the output seems to be deterministically ordered:

julia> x = map(string, subtypes(Any));

julia> y = sort!(map(string, subtypes(Any)));

julia> x == y
true



El sábado, 26 de diciembre de 2015, 12:52:51 (UTC-6), Ray Toal escribió:
>
> I noticed that 
>
> *julia> **subtypes(Type)*
>
> *3-element Array{Any,1}:*
>
> * DataType  *
>
> * TypeConstructor*
>
> * Union *
>
> and was wondering if there was any significance in the order of the 
> subtypes. If not, could the method have produced a Set instead?
>
>

[julia-users] Re: How to avoid extra allocations when passing a function as parameter

2015-12-27 Thread Ismael Venegas Castelló
For calcF your variables:

Variables:
  X::Array{Float64,1}
  F::F
  n::Int64
  y::Array{Float64,1}
  #s76::Int64
  i::Int64
  ##dims#7321::Tuple{Int64}

and return value:

return y::Array{Float64,1}
end::Array{Float64,1}

Are correctly inferred if I use floats so it seems fine.

But if I use int's as arguments to main I get an InexactError, are you sure 
it should accept `T <: Real`?  Maybe you just need Float64?



El domingo, 27 de diciembre de 2015, 11:21:35 (UTC-6), alan souza escribió:
>
> Hi. I was wondering what is the correct way to pass a function as argument 
> preserving the return type information of this function
>
> For instance in the following code:
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
>
> *function sinc{T<:Real}(x::T)return T((x != zero(T) 
> )?(sin(pi*x)/(pi*x)):(one(T)))endfunction calcF{T<:Real}(X::Array{T,1}, 
> F::Function)n = length(X); @assert(n > 0)y = zeros(T, n)for 
> i in eachindex(X)y[i] = F(X[i])endreturn yendfunction 
> calcSinc{T<:Real}(X::Array{T,1})n = length(X); @assert(n > 0)y 
> = zeros(T, n)for i in eachindex(X)y[i] = sinc(X[i])end
> return yendfunction main{T<:Real}(min::T, max::T, d::T)X = 
> collect(min:d:max)calcF(X, sinc)calcSinc(X)@code_warntype 
> calcF(X, sinc)@time calcF(X, sinc)@code_warntype calcSinc(X)
> @time calcSinc(X)YF = calcF(X, sinc)YS = calcSinc(X)end*
>
> Running this code with julia (versions 0.5+dev or 0.4.2) I got these 
> results:
>
>
>
>
>
>
> *  #s1 = GenSym(5) # /home/me/scratch/julia_fd/teste.jl, line 10:  
> GenSym(2) = 
> (F::F)((Base.arrayref)(X::Array{Float64,1},i::Int64)::Float64)::ANY  
> (Base.arrayset)(y::Array{Float64,1},(top(typeassert))((Base.convert)(Float64,GenSym(2))::ANY,Float64)::Float64,i::Int64)::Array{Float64,1}
>   
> 5:   unless 
> (Base.box)(Base.Bool,(Base.not_int)((Base.box)(Base.Bool,(Base.not_int)(#s1::Int64
>  
> === 
> (Base.box)(Base.Int,(Base.add_int)((top(getfield))(GenSym(0),:stop)::Int64,1))::Bool
>  
> goto 4  3:   0.080181 seconds (1.88 M allocations: 33.556 MB, 6.41% gc 
> time)*
>
> and for the calcSinc function:
>
>
>
>
>
>
>
> *   #s1 = GenSym(5) # /home/me/scratch/julia_fd/teste.jl, line 20:  
> GenSym(2) = 
> (Main.sinc)((Base.arrayref)(X::Array{Float64,1},i::Int64)::Float64)::Float64  
> 
> (Base.arrayset)(y::Array{Float64,1},GenSym(2),i::Int64)::Array{Float64,1} 
>  
> 5:   unless 
> (Base.box)(Base.Bool,(Base.not_int)((Base.box)(Base.Bool,(Base.not_int)(#s1::Int64
>  
> === 
> (Base.box)(Base.Int,(Base.add_int)((top(getfield))(GenSym(0),:stop)::Int64,1))::Bool
>  
> goto 4  3:   0.031224 seconds (2 allocations: 4.794 MB)*
> Is there a way to prevent the result of function to "evaluate" to ::Any on 
> the first case?
>
> thanks
>
>

[julia-users] Does any one have Raspberry Pi 2 Julia binaries?

2015-12-27 Thread Ismael Venegas Castelló
has anyone successfully built Julia for Raspberry Pi 2? I understand that 
it's able to build now. If anyone has been able to do this ...could you 
share your binary? I'm building it right now, but it seems it's going to 
take ages, and I have yet to see it fail or not!

I want to build a Raspberry Pi 2 Julia DIY calculator! Like this one:

   - https://www.youtube.com/watch?v=lJu1ij_Emlk


These could be used for plotting:

   - https://github.com/johnmyleswhite/ASCIIPlots.jl
   - https://github.com/sunetos/TextPlots.jl
   - https://github.com/Evizero/UnicodePlots.jl



[julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-25 Thread Ismael Venegas Castelló
Min-Woong you could use convert, it works with NAs and you still get an 
error for free if conversion is not possible:

julia> df = DataFrame(x = @data [1,2,3, NA, typemax(Int8)])
5x1 DataFrames.DataFrame
| Row | x   |
|-|-|
| 1   | 1   |
| 2   | 2   |
| 3   | 3   |
| 4   | NA  |
| 5   | 127 |

julia> eltype(df[:x])
Int64

julia> df[:x] = convert(DataArray{Int8, 1}, df[:x]);

julia> eltype(df[:x])
Int8

julia> df = DataFrame(x = @data [1,2,3, NA, typemax(Int8) + 1])
5x1 DataFrames.DataFrame
| Row | x   |
|-|-|
| 1   | 1   |
| 2   | 2   |
| 3   | 3   |
| 4   | NA  |
| 5   | 128 |

julia> eltype(df[:x])
Int64

julia> df[:x] = convert(DataArray{Int8, 1}, df[:x]);
ERROR: InexactError()
 in copy! at abstractarray.jl:302



El jueves, 24 de diciembre de 2015, 5:02:14 (UTC-6), Min-Woong Sohn 
escribió:
>
> I want to reduce the amount of memory used by a dataframe that has lots of 
> binary variables. What is the best way to achieve this? For example, how 
> can I convert a variable from Int64 to Int8 in a dataframe.
>
> Thanks
>


[julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Ismael Venegas Castelló
Yichao, why is it bad idea to splat? Is it not performant?

El jueves, 24 de diciembre de 2015, 5:02:14 (UTC-6), Min-Woong Sohn 
escribió:
>
> I want to reduce the amount of memory used by a dataframe that has lots of 
> binary variables. What is the best way to achieve this? For example, how 
> can I convert a variable from Int64 to Int8 in a dataframe.
>
> Thanks
>


[julia-users] Re: Getting the last match for a regular expression in a string

2015-12-24 Thread Ismael Venegas Castelló
Where s is:

julia> s = "1.ts, 2.ts, , 00xyz.ts"
"1.ts, 2.ts, , 00xyz.ts"



El jueves, 24 de diciembre de 2015, 18:57:05 (UTC-6), Ismael Venegas 
Castelló escribió:
>
> Is something like this what you are looking for?
>
> julia> matchall(r"(\d+?.+?\.ts)", s)
> 3-element Array{SubString{UTF8String},1}:
>  "1.ts"
>  "2.ts"
>  "00xyz.ts"
>
>
>
> El jueves, 24 de diciembre de 2015, 12:30:52 (UTC-6), Douglas Bates 
> escribió:
>>
>> Short version:
>>
>> I have a string that contains several instances of names of the form 
>> 1.ts, 2.ts, , 00xyz.ts and I want to find the last match.   
>> That is, I want to find "00xyz.ts" or, alternatively, find all such names 
>> in sequence..
>>
>> Longer version:
>>
>> These are file names of a series of transport stream files containing 
>> audio, video, close captions, etc.  The device generating them, a Tablo 
>> over-the-air video recorder, http://tabotv.com, breaks a recording into 
>> many small segments with these names.  A program can query the device at a 
>> particular URL and get a listing of the directory containing these 
>> segments, returned as XHTML.  I want all the file names in sequence so that 
>> I can download each of these files in sequence and create a single file by 
>> appending them.
>>
>> The names each occur multiple times in the string but each one only once 
>> in the form that will match r">(\d+\.ts)<". 
>>
>> I can think of two ways of getting these names.  One is to parse the 
>> string as XHTML and walk through the object to find these names.  The other 
>> is to match the regular expression in the string, extract the "captures" 
>> field, match again starting at the current offset + 1, and continue until 
>> there are no further matches.
>>
>> The XML approach is more elegant but not especially easy.  The regular 
>> expression matching is reasonably straightforward to implement but more 
>> fragile.
>>
>> Am I missing an elegant, robust approach here?
>>
>

[julia-users] Re: Getting the last match for a regular expression in a string

2015-12-24 Thread Ismael Venegas Castelló
Is something like this what you are looking for?

julia> matchall(r"(\d+?.+?\.ts)", s)
3-element Array{SubString{UTF8String},1}:
 "1.ts"
 "2.ts"
 "00xyz.ts"



El jueves, 24 de diciembre de 2015, 12:30:52 (UTC-6), Douglas Bates 
escribió:
>
> Short version:
>
> I have a string that contains several instances of names of the form 
> 1.ts, 2.ts, , 00xyz.ts and I want to find the last match.   
> That is, I want to find "00xyz.ts" or, alternatively, find all such names 
> in sequence..
>
> Longer version:
>
> These are file names of a series of transport stream files containing 
> audio, video, close captions, etc.  The device generating them, a Tablo 
> over-the-air video recorder, http://tabotv.com, breaks a recording into 
> many small segments with these names.  A program can query the device at a 
> particular URL and get a listing of the directory containing these 
> segments, returned as XHTML.  I want all the file names in sequence so that 
> I can download each of these files in sequence and create a single file by 
> appending them.
>
> The names each occur multiple times in the string but each one only once 
> in the form that will match r">(\d+\.ts)<". 
>
> I can think of two ways of getting these names.  One is to parse the 
> string as XHTML and walk through the object to find these names.  The other 
> is to match the regular expression in the string, extract the "captures" 
> field, match again starting at the current offset + 1, and continue until 
> there are no further matches.
>
> The XML approach is more elegant but not especially easy.  The regular 
> expression matching is reasonably straightforward to implement but more 
> fragile.
>
> Am I missing an elegant, robust approach here?
>


[julia-users] Re: What is the best way to convert Int64 to Int8 in DataArray

2015-12-24 Thread Ismael Venegas Castelló
Something like this:

julia> df = DataFrame(x = Int[1:10; typemax(Int8)]);

julia> eltype(df[:x])
Int64

julia> df[:x] = Int8[df[:x]...];

julia> eltype(df[:x])
Int8

julia> df = DataFrame(x = Int[1:10; typemax(Int8) + 1]);

julia> eltype(df[:x])
Int64

julia> df[:x] = Int8[df[:x]...];
ERROR: InexactError()
 in getindex at array.jl:167



You get the error for free!

El jueves, 24 de diciembre de 2015, 5:02:14 (UTC-6), Min-Woong Sohn 
escribió:
>
> I want to reduce the amount of memory used by a dataframe that has lots of 
> binary variables. What is the best way to achieve this? For example, how 
> can I convert a variable from Int64 to Int8 in a dataframe.
>
> Thanks
>


[julia-users] Re: What is @d?

2015-12-24 Thread Ismael Venegas Castelló
Erick If you've found out by now what that macro does, you could send a PR 
with a docstring for it! Something like:

"Creates a typed dictionary."
macro d(xs...)
  @cond if VERSION < v"0.4-"
Expr(:typed_dict, :(Any=>Any), map(esc, xs)...)
  else
:(Dict{Any, Any}($(map(x->esc(prockey(x)), xs)...)))
  end
end

Is an improvement if one can do:

help?> @d
  Creates a typed dictionary.

Or something like that, you could also suggest to change the name to 
something like @typeddict.





El miércoles, 23 de diciembre de 2015, 21:47:02 (UTC-6), Eric Forgy 
escribió:
>
> Hi,
>
> I'm spending some quality time with Blink.jl trying to understand how it 
> works and came across a macro @d. As you can imagine, it is difficult to 
> search for this macro definition :D
>
> Any ideas? 
>
> Best regards,
> Eric
>


[julia-users] Re: What's in your .juliarc.jl file?

2015-12-23 Thread Ismael Venegas Castelló
I have found this ones at Gist:

* 
https://gist.github.com/search?l=julia&q=.juliarc.jl&ref=searchresults&utf8=%E2%9C%93

This one is aslo in my .juilarc.jl nowadays ...a total life saver! XD

"https://xkcd.com/303";
nethack() = run(`telnet nethack.alt.org`)



El miércoles, 23 de diciembre de 2015, 14:38:44 (UTC-6), SundaraRaman R 
escribió:
>
> I'm a newbie to Julia and just today learnt that there's a .juliarc.jl 
> initialization file. So I'm curious what sorts of things people use it for. 
>
> Some DDG-ing and Googling only returned this gist: 
> https://gist.github.com/Ismael-VC/6db0c310eaf04d0b0a1b in which at least 
> the `separator()` function can be useful, and this tweet: 
> https://twitter.com/Felipe_J_H/status/672465597075234816 that extends 
> `display()`.
> (There's also a suggestion to use the rc file to modify DL_LOAD_PATH in 
> the docs for Julia release 0.1 (
> http://docs.julialang.org/en/release-0.1/manual/packages/) but not in the 
> newer docs (http://docs.julialang.org/en/release-0.4/manual/packages/).)
>
> What does your .juliarc.jl contain?
>
>

[julia-users] Re: Using macros to override lots of operators for a user-defined type

2015-12-16 Thread Ismael Venegas Castelló
It's nice how does @show works! It returned a tuple because I made a 
mistake, without it, it looks like this:

julia> macro foo_op(op)
   quote
   dot_op = symbol(".$($op)")
   docstr = "`$($op)` also works for `Foo` types!"
   @show $op typeof($op)
   function Base.$op(a::Foo, b::Foo)
   Foo(dot_op(a.x, b.x))
   end
   @doc Markdown.parse(docstr) Base.$op
   Base.$op
   end
   end

julia> for op in [+, -]
   @foo_op op
   end
op = +
typeof(op) = Function
ERROR: UndefVarError: op not defined
 [inlined code] from none:6
 in anonymous at no file:0



El martes, 15 de diciembre de 2015, 10:28:53 (UTC-6), ami...@gmail.com 
escribió:
>
> Hello,
>
> I have a type M and I would like to redefine all the operations *, +, -, / 
> etc. over it. Since it would be everytime the same operations and since I 
> want my code to be concise I thought about using a macro to define them, 
> such as:
>
> type M
> a
> b
> end
>
> macro operator_obs(name)
> return quote
> function $name(m1::M, m2::M)
> return M($name(m1.a, m2.a), $name(m1.b, m2.b))
> end
> end
> end
>
> @operator_obs(+)
>
> m1 = M(2.0,3.0)
> m2 = M(4.0,5.0)
>
> +(m1, m2)
>
> But this doesn't seem to work. What did I do wrong?
>
> Many thanks,
>


[julia-users] Re: Using macros to override lots of operators for a user-defined type

2015-12-16 Thread Ismael Venegas Castelló
I haven't been able to figure out how to make it work inside a for loop 
though:

julia> for op in [+, -]
   @foo_op op
   end
ERROR: UndefVarError: op not defined
 [inlined code] from none:5
 in anonymous at no file:0

julia> macro foo_op(op)
   quote
   dot_op = symbol(".$($op)")
   docstr = "`$($op)` also works for `Foo` types!"
   @show $op, typeof($op)# seems rigth to me!
   function Base.$op(a::Foo, b::Foo)
   Foo(dot_op(a.x, b.x))
   end
   @doc Markdown.parse(docstr) Base.$op
   Base.$op
   end
   end


julia> for op in [+, -]
   @foo_op op
   end
(op,typeof(op)) = (+,Function)
ERROR: UndefVarError: op not defined
 [inlined code] from none:6
 in anonymous at no file:0



El martes, 15 de diciembre de 2015, 10:28:53 (UTC-6), ami...@gmail.com 
escribió:
>
> Hello,
>
> I have a type M and I would like to redefine all the operations *, +, -, / 
> etc. over it. Since it would be everytime the same operations and since I 
> want my code to be concise I thought about using a macro to define them, 
> such as:
>
> type M
> a
> b
> end
>
> macro operator_obs(name)
> return quote
> function $name(m1::M, m2::M)
> return M($name(m1.a, m2.a), $name(m1.b, m2.b))
> end
> end
> end
>
> @operator_obs(+)
>
> m1 = M(2.0,3.0)
> m2 = M(4.0,5.0)
>
> +(m1, m2)
>
> But this doesn't seem to work. What did I do wrong?
>
> Many thanks,
>


[julia-users] Re: Using macros to override lots of operators for a user-defined type

2015-12-16 Thread Ismael Venegas Castelló
Thanks to Michael's example, I did this other version of the macro:

julia> type Foo{T<:Number}
   x::Vector{T}
   end

julia> macro foo_op(op)
   quote
   dot_op = symbol(".$($op)")
   docstr = "`$($op)` also works for `Foo` types!"
   function Base.$op(a::Foo, b::Foo)
   Foo(dot_op(a.x, b.x))
   end
   @doc Markdown.parse(docstr) Base.$op
   Base.$op
   end
   end

julia> @foo_op ^
^ (generic function with 46 methods)

help?> ^
search: ^ .^

  ^(x, y)

  Exponentiation operator.

  ^(s, n)

  Repeat n times the string s. The repeat function is an alias to this
  operator.

  julia> "Test "^3
  "Test Test Test "

  ^ also works for Foo types!



El martes, 15 de diciembre de 2015, 10:28:53 (UTC-6), ami...@gmail.com 
escribió:
>
> Hello,
>
> I have a type M and I would like to redefine all the operations *, +, -, / 
> etc. over it. Since it would be everytime the same operations and since I 
> want my code to be concise I thought about using a macro to define them, 
> such as:
>
> type M
> a
> b
> end
>
> macro operator_obs(name)
> return quote
> function $name(m1::M, m2::M)
> return M($name(m1.a, m2.a), $name(m1.b, m2.b))
> end
> end
> end
>
> @operator_obs(+)
>
> m1 = M(2.0,3.0)
> m2 = M(4.0,5.0)
>
> +(m1, m2)
>
> But this doesn't seem to work. What did I do wrong?
>
> Many thanks,
>


Re: [julia-users] Re: Using macros to override lots of operators for a user-defined type

2015-12-16 Thread Ismael Venegas Castelló
I didn't know of "$($x)" to interpolate inside stirng inside expresion, 
thanks!

This also works:

macro foo_op(op)
quote
dot_op = symbol(".$($op)")
docstr = "`$($op)` also works for `Foo` types!"
function Base.$op(a::Foo, b::Foo)
Foo(dot_op(a.x, b.x))
end
@doc Markdown.parse(docstr) Base.$op
Base.$op
end
end

El miércoles, 16 de diciembre de 2015, 11:19:24 (UTC-6), Michael Hatherly 
escribió:
>
> If the macro returns a single documentable expression, such as a function 
> or type, then you shouldn’t need to do anything special, just add an @doc 
> to the for-loop that generates the methods.
>
> If the macro returns a block expression then you need to tell the 
> docsystem how you’d like to handle it. Use Base.@__doc__ to mark the 
> subexpression you’d like to document in expression returned by the macro. 
> See this section of the manual, 
> http://docs.julialang.org/en/latest/manual/documentation/#macro-generated-code,
>  
> for an example. Something like the following should work for the code in 
> this thread:
>
> macro operator_obs(name)
> M = esc(:M)
> n = esc(name)
> d = esc(symbol(".", name))
> quote
> import Base: $n
> Base.@__doc__ $(n)(m_1::$M, m_2::$M) = $(M)($(d)(m_1.a, m_2.a), 
> $(d)(m_1.b, m_2.b))
> end
> end
>
> for op in [:+, :-, :*, :/]
> @eval begin
> @doc "`$($op)` docs for type `M`." ->
> @operator_obs $op
> end
> end
>
> help?> M(1, 2) + M(2, 3)
>   + docs for type M.
>
> help?> M(1, 2) / M(2, 3)
>   / docs for type M.
>
> Documenting code generated by a function, rather than a macro, isn’t going 
> to be as clean though. You’d need to use @doc after defining the code, 
> perhaps something like:
>
> for op in [:+, :-, :*, :/]
> @eval begin
> operator_obs($op)
> @doc "`$($op)` docs for type `M`." $(op)(::M, ::M)
> end
> end
>
> to add docs to the correct op method.
>
> — Mike
> ​
>
>
> On Wednesday, 16 December 2015 17:41:36 UTC+2, j verzani wrote:
>>
>> While this topic is active, can anyone suggest how this can be 
>> incorporated with docstrings to add help entries to the newly generated 
>> methods?
>>
>> On Wednesday, December 16, 2015 at 5:22:24 AM UTC-5, Greg Plowman wrote:
>>>
>>> I have exactly the same requirement. 
>>> Additionally, I often have more than 2 fields and also change the fields 
>>> of my custom types.
>>>
>>> So I use a slightly more general version of the above:
>>>
>>>
>>> function CompositeBinaryOp(T::Symbol, op::Symbol)
>>> expressions = [ :($op(x1.$field, x2.$field)) for field in 
>>> fieldnames(eval(T)) ]
>>> body = Expr(:call, T, expressions...)
>>> quote
>>> function $op(x1::$T, x2::$T)
>>> return $body
>>> end
>>> end
>>> end
>>>
>>> type M
>>> a
>>> b
>>> end
>>>
>>> import Base: +, -, *, /, ^
>>>
>>> for T in [:M]
>>> for op in [:+, :-, :*, :/, :^]
>>> #eval(CompositeBinaryOp(T, op))
>>>
>>> code = CompositeBinaryOp(T, op)
>>> println(code, "\n")
>>> eval(code)
>>> end
>>> end
>>>
>>>  
>>> The advantage here for me is that I can change the fields (number, type 
>>> order etc.) and operators don't need manual updating.
>>>
>>> I have similar functions for copy constructors, unary operators etc.
>>>
>>

[julia-users] Re: Using macros to override lots of operators for a user-defined type

2015-12-16 Thread Ismael Venegas Castelló
You could also use a macro:

module MetaFoo

export Foo, ops, @foo_op

type Foo{T<:Number}
x::Vector{T}
end

const ops = [+, -, *, /]
const syms = [symbol(op) for op in ops]

for sym in syms
dot_sym = symbol(".$sym")
docstr = "`$sym` also works for `Foo` types!"
@eval begin
@doc $docstr ->
function Base.$sym(a::Foo, b::Foo)
Foo($dot_sym(a.x, b.x))
end
end
end

macro foo_op(op)
dot_op = symbol(".$op")
docstr = "`$op` also works for `Foo` types!"
quote
function Base.$op(a::Foo, b::Foo)
Foo($dot_op(a.x, b.x))
end
@doc $docstr Base.$op
Base.$op
end
end

end

Use:

help?> +
search: + .+

  +(x, y...)

  Addition operator. x+y+z+... calls this function with all arguments, i.e.
  +(x, y, z, ...).

julia> include("MetaFoo.jl")
MetaFoo

julia> using MetaFoo

help?> +
search: + .+

  +(x, y...)

  Addition operator. x+y+z+... calls this function with all arguments, i.e.
  +(x, y, z, ...).

  + also works for Foo types!

help?> ^
search: ^ .^

  ^(x, y)

  Exponentiation operator.

  ^(s, n)

  Repeat n times the string s. The repeat function is an alias to this
  operator.

  julia> "Test "^3
  "Test Test Test "

julia> @foo_op ^
^ (generic function with 46 methods)

help?> ^
search: ^ .^

  ^(x, y)

  Exponentiation operator.

  ^(s, n)

  Repeat n times the string s. The repeat function is an alias to this
  operator.

  julia> "Test "^3
  "Test Test Test "

  ^ also works for Foo types!

julia>


El martes, 15 de diciembre de 2015, 10:28:53 (UTC-6), ami...@gmail.com 
escribió:
>
> Hello,
>
> I have a type M and I would like to redefine all the operations *, +, -, / 
> etc. over it. Since it would be everytime the same operations and since I 
> want my code to be concise I thought about using a macro to define them, 
> such as:
>
> type M
> a
> b
> end
>
> macro operator_obs(name)
> return quote
> function $name(m1::M, m2::M)
> return M($name(m1.a, m2.a), $name(m1.b, m2.b))
> end
> end
> end
>
> @operator_obs(+)
>
> m1 = M(2.0,3.0)
> m2 = M(4.0,5.0)
>
> +(m1, m2)
>
> But this doesn't seem to work. What did I do wrong?
>
> Many thanks,
>


[julia-users] Re: Using macros to override lots of operators for a user-defined type

2015-12-16 Thread Ismael Venegas Castelló
julia> type Foo{T<:Number}
   x::Vector{T}
   end

julia> ops = [+, -, *, /]
4-element Array{Function,1}:
 +
 -
 *
 /

julia> syms = [symbol(op) for op in ops]
4-element Array{Any,1}:
 :+
 :-
 :*
 :/

julia> for sym in syms
   dot_sym = symbol(".$sym")# create 
element-wise symbol 
   docstr = "`$sym` also works for `Foo` types!"# this has to 
be created before `@eval`
   @eval begin
   @doc $docstr ->  # attach 
docstring
   function Base.$sym(a::Foo, b::Foo)
   Foo($dot_sym(a.x, b.x))  # infix 
notation wont work here!
   end
   end
   end

julia> x = Foo([1,2,3])
Foo{Int64}([1,2,3])

julia> y = deepcopy(x)
Foo{Int64}([1,2,3])

julia> for op in ops
   println("$x $op $y = $(op(x, y))")
   end
Foo{Int64}([1,2,3]) + Foo{Int64}([1,2,3]) = Foo{Int64}([2,4,6])
Foo{Int64}([1,2,3]) - Foo{Int64}([1,2,3]) = Foo{Int64}([0,0,0])
Foo{Int64}([1,2,3]) * Foo{Int64}([1,2,3]) = Foo{Int64}([1,4,9])
Foo{Int64}([1,2,3]) / Foo{Int64}([1,2,3]) = Foo{Float64}([1.0,1.0,1.0])

help?> +
search: + .+

  +(x, y...)

  Addition operator. x+y+z+... calls this function with all arguments, i.e.
  +(x, y, z, ...).

  + also works for Foo types!

julia>



El martes, 15 de diciembre de 2015, 10:28:53 (UTC-6), ami...@gmail.com 
escribió:
>
> Hello,
>
> I have a type M and I would like to redefine all the operations *, +, -, / 
> etc. over it. Since it would be everytime the same operations and since I 
> want my code to be concise I thought about using a macro to define them, 
> such as:
>
> type M
> a
> b
> end
>
> macro operator_obs(name)
> return quote
> function $name(m1::M, m2::M)
> return M($name(m1.a, m2.a), $name(m1.b, m2.b))
> end
> end
> end
>
> @operator_obs(+)
>
> m1 = M(2.0,3.0)
> m2 = M(4.0,5.0)
>
> +(m1, m2)
>
> But this doesn't seem to work. What did I do wrong?
>
> Many thanks,
>